擴展:WikiLove
![]() 發行狀態: 穩定版 |
|
---|---|
![]() |
|
實現 | 用戶介面 |
描述 | 使在用戶討論頁添加積極反饋變得更容易 |
作者 | Ryan Kaldari, Jan Paul Posma, Brandon Harris (設計) |
最新版本 | 1.3.1 |
相容性政策 | 快照跟隨MediaWiki發佈。 master分支不向後相容。 |
MediaWiki | 1.27+ |
資料庫變更 | 是 |
表 | wikilove_log |
授權條款 | MIT授權條款 |
下載 | |
|
|
季度下載量 | 24 (Ranked 108th) |
前往translatewiki.net翻譯WikiLove擴充功能 | |
問題 | 開啟的任務 · 回報錯誤 |
WikiLove 是一個擴展,旨在促進 WikiLove 在維基百科和可能的其他維基中的傳播。 具體來講,它使向用戶討論頁添加獎勵、禮物和邀請變得像單擊幾個按鈕一樣簡單。
安裝
- 下載檔案,並將解壓後的
WikiLove
資料夾移動到extensions/
目錄中。
開發者和代碼貢獻人員應從Git安裝擴展,輸入:cd extensions/
git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/WikiLove - 將下列程式碼放置在您的LocalSettings.php 的底部:
wfLoadExtension( 'WikiLove' );
- 執行更新腳本,它將自動建立此擴充功能必須依賴的數據庫表。
完成 – 在您的wiki上導覽至Special:Version,以驗證已成功安裝擴充功能。
如果你想使用內置獎勵,你必須啟用 InstantCommons。 為此,請將其添加到 LocalSettings.php:
$wgUseInstantCommons = true;
擴展應該是活躍的。轉到首選項中的編輯標籤,打開界面。
你也可以在你的LocalSettings.php中找到。
$wgWikiLoveGlobal
- 為所有的用戶開啟,用戶可以在用戶設置中關閉(默認不打開)。- Note: you can also enable the setting by default but still give the users the option to turn it off (opt-out) by using:
$wgDefaultUserOptions['wikilove-enabled'] = 1;
$wgWikiLoveTabIcon
- 為支持它們的皮膚使用圖標(即 Vector)(默認值:true)$wgWikiLoveLogging
- 啟用 WikiLove 捐贈的日誌記錄(默認值:false); 這會自動創建一個數據庫表wikilove_log
,您可以將其用於統計查詢
用法
要使您的帳戶能夠使用 WikiLove,請轉到您首選項中的編輯選項卡,然後在「測試功能」(或者,在某些版本中,在 「常規選項」 下)打開 WikiLove。 In September 2022 this displays as "Enable showing appreciation for other users with the WikiLove tab".
要使用 WikiLove,請轉到用戶的討論頁(除您自己外)並單擊心形圖標。按照指示進行操作。
習慣配置
「要了解如何為單個編輯器(而不是整個 wiki)自定義 WikiLove,請參閱 user documentation。」
您可以通過編輯頁面 MediaWiki:WikiLove.js 來自定義您自己的 wiki 的選項。 在這裏,您可以像使用內置選項一樣更改配置:defaultOptions.js。 以下是自定義 WikiLove 配置的一些示例:
- Wikipedia
- Wikimedia Commons
The options at the top of defaultOptions.js are some default settings for your convenience.
If you omit certain properties from types or subtypes, these defaults will be used (defaultText, defaultBackgroundColor, defaultBorderColor, defaultImageSize, defaultImage
).
Then there is the list of types.
Each type can have the properties name
(required) and icon
(optional).
Furthermore, a type can have a list of subtypes, or not, in which case the additional properties will be assigned to the type itself.
If the type has subtypes, they are listed in an object list subtypes
.
Optionally, the type can also have the property select
, which specifies the label above the dropdown menu.
Each subtype can have the following properties:
option
- 下拉菜單中的名字descr
- Description of the subtypeheader
- Header of the message that is being added, i.e. the part that will be between== ... ==
title
- 消息框的標題text
- 消息框的文字(詳見下方)image
- 消息框的圖片gallery
- Gallery for selecting an image (see below for details)fields
- Array of fields that the user can edit; can contain these values:header, title, image, message
imageSize
- 圖片大小(例如100px
)backgroundColor
- 背景顏色(任何CSS有效顏色,例如#fdffe7
或yellow
)borderColor
- 邊框顏色(相同)
When not using subtypes, these options (except for the first two) should be added to the type itself.
In the text
and email
fields (as well as in defaultText
, mentioned earlier), you can use a few codes that will be substituted automatically:
- $1 - User message
- $2 - Title
- $3 - Image name
- $4 - Image size
- $5 - Background color
- $6 - Border color
- $7 - Username of the recipient
To make it easy for the user to select images, you can create a gallery with predefined images. For this, create a gallery
property, which has the following properties:
imageList
- An array of image nameswidth
- Maximum width of the images in the gallery (in pixels); for 3 images145
is recommendedheight
- Maximum height of the images in the gallery (in pixels)number
- Number of random images to show (optional); if omitted all images are shown
You can use images from Wikimedia Commons, as the default awards do. Like mentioned before, you have to enable InstantCommons for this.
//<nowiki>
and end it with //</nowiki>
so that any Wikitext code (such as signatures or {{subst:foo}}
) doesn't get expanded within the JavaScript.Removing WikiLove types
If you just want to remove some of the default WikiLove types, you can delete them from the $.wikiLoveOptions object. Here are some examples that you could use in your wiki's MediaWiki:WikiLove.js page:
// Delete the Random Acts of Kindness Barnstar from the barnstars list
delete $.wikiLoveOptions.types.barnstar.subtypes.kindness;
// Delete the cheeseburger from the food and drink list
delete $.wikiLoveOptions.types.food.subtypes.cheeseburger;
// Delete the kittens interface entirely
delete $.wikiLoveOptions.types.kitten;
Adding new WikiLove types
Here's an example of adding a new puppy type:
$.wikiLoveOptions.types.puppy = {
name: 'Puppy', // name of the type (appears in the types menu)
fields: [ 'header', 'message' ], // fields to ask for in form
header: 'You get a puppy!', // header that appears at the top of the talk page post (optional)
text: '[[File:2009-08-16 Puppy at Duke East 1.jpg|left|150px]]\n$1\n\n~~'+'~~<br style="clear: both;"/>', // $1 is the custom message
icon: 'http://www.mysite.com/images/wikilove-icon-puppy.png' // appears in the types menu
};
Here's an example of adding a new hedgehog type with a gallery of images to choose from:
$.wikiLoveOptions.types.hedgehog = {
name: 'Hedgehogs', // name of the type (appears in the types menu)
fields: [ 'header', 'message' ], // fields to ask for in form
header: 'A hedgehog for you!', // header that appears at the top of the talk page post (optional)
text: '[[$3|left|150px]]\n$1\n\n~~'+'~~\n<br style="clear: both"/>', // $3 is the image filename, $1 is the message
gallery: {
imageList: [ 'Hedgehog1.jpg', 'Orizo5.jpg', 'Erinaceus europaeus LC0119.jpg' ],
width: 145, // maximum width of the images in the gallery
height: 150, // maximum height of the images in the gallery
number: 3 // number of random images to show (optional)
},
icon: 'http://www.mysite.com/images/wikilove-icon-hedgehog.png' // appears in the types menu
Here's an example of adding a new falafel subtype under the existing food type:
$.wikiLoveOptions.types.food.subtypes.falafel = {
fields: [ 'header', 'message' ], // fields to ask for in form
option: 'Falafel', // option listed in the select list
descr: 'Falafel is a popular Middle Eastern street food made from ground chickpeas or fava beans and topped with salads, vegetables, and sauces. It is typically served in a pocket of pita bread.',
header: 'Some falafel for you!', // header that appears at the top of the talk page post (optional)
image: 'Falafel award.png', // image for the item
imageSize: '120px' // size to display image (optional)
};
故障和問題
If the talk page you are attempting to edit contains a word that has been subsequently added to Special:SpamRegex, attempts to use the interface to add a barnstar or other award will fail. This is because the page cannot be edited, as it contains a forbidden word. Removing the word from the page or from the filter will fix the problem.
API說明文件
WikiLove uses a special wikilove API to post messages to users' talk pages. The API is basically just a thin wrapper around some existing APIs. If the user's talk page is a Wikitext page, it uses the edit API. If it's a Flow page, it uses the flow API. And if it's a LiquidThreads page, it uses the threadaction API.
In order to call the API, use the parameter action=wikilove
.
參數:
title
- Title of the user or user talk page to send WikiLove to (required)
text
- Raw wikitext to add in the new section (required)
message
- Actual message the user has entered, for logging purposes (doesn't include the image and HTML formatting)
token
- Edit token. You can get one of these through prop=info (required)
subject
- Subject header of the new page section (required)
type
- Type of WikiLove (for statistics); this corresponds with a type selected in the left menu, and optionally a subtype after that (e.g. "barnstar-normal" or "kitten") (optional)
email
- Content of the optional email message to send to the user
例如:
api.php?action=wikilove&title=User:Dummy&text=Love&subject=Hi&token=%2B\
1.0版設計
![](https://cdn.statically.io/img/upload.wikimedia.org/wikipedia/commons/thumb/8/8c/WikiLove-Proposal-Dialog-1.png/220px-WikiLove-Proposal-Dialog-1.png)
![](https://cdn.statically.io/img/upload.wikimedia.org/wikipedia/commons/thumb/6/6a/WikiLove-Proposal-Dialog-2.png/220px-WikiLove-Proposal-Dialog-2.png)
![](https://cdn.statically.io/img/upload.wikimedia.org/wikipedia/commons/thumb/a/af/WikiLove-Proposal-Dialog-3.png/220px-WikiLove-Proposal-Dialog-3.png)
![](https://cdn.statically.io/img/upload.wikimedia.org/wikipedia/commons/thumb/e/ef/WikiLove-Proposal-Dialog-4.png/220px-WikiLove-Proposal-Dialog-4.png)
![](https://cdn.statically.io/img/upload.wikimedia.org/wikipedia/commons/thumb/a/a8/WikiLove-Proposal-Select-Hover.png/220px-WikiLove-Proposal-Select-Hover.png)
This document describes the design and behavior of the WikiLove system of positive feedback for Wikipedia. This tool is designed to promote the spread of WikiLove within Wikipedia. Specifically, it makes adding awards and gifts to user talk pages as simple as clicking a few buttons.
原理
Wikipedia, as a community, has several mechanisms for indicating displeasure or to provide negative feedback to its users. Certain gadgets, such as Twinkle, are heavily engineered towards warning, blocking, and reverting.
Since Wikipedia is in need of positive reinforcement, especially for new users, a system designed specifically and only towards positive feedback is desired.
異樣的設計
The system has a heavy style of "whimsy" to its design. This is intentional and is intended to align closer to the expectations of users of modern websites. Further, the entire principle of "awards" is in and of itself whimsical (e.g., cookies and kittens).
This style may be abandoned based on user feedback.
命名法註釋
Some template types, such as welcome templates, are not technically "awards".
This document uses the term award interchangeably with template. Since the system is user-focused, and not intended directly for power-users, user-facing nomenclature has been used.
過程
對話行為
The WikiLove dialog is modal. Initiating it (from anywhere) will cause it to appear over the text of the page. It can be dismissed with a simple click.
維基友愛系統需要JavaScript。
The user will initially be presented with a short set of easy-to-understand instructions and a list of available award categories.
Upon selecting an award type, the user is presented with a section in which they can add details to the award (such as a short message).
Note that some award categories (e.g., "cookie") will not have a secondary award creation step and will go directly to "Preview".
The user then clicks the "preview" button, which will load a preview of the award so that they may see how it will look on the user's talk page.
Once the user is satisfied, they may click the "Send WikiLove" button. At this time, AJAX calls to the server API will be fired, adding the template to the user's talk page.
電子郵件通知
Since most new users are unlikely to be aware that they even have talk pages, they may not be aware that they have received the WikiLove in question.
Accordingly, the server will email the recipient (if they have provided an email address) informing them of the WikiLove as well as short instructions on how to access their talk page.
站點配置
Initially, the awards that can be given are to be defined in the gadget itself. If this system is elevated to an extension, then the names of the awards and the templates should be defined in the site's LocalSettings.php.
Alternatively, such information can be stored in the database. An administration console would be required to add or subtract available awards and award categories.
數據存儲
For statistics gathering purposes, every time an award is given, data is tracked and stored in the database. A simple table, written to via the API, is all that need be required:
- From User - The username of the person who is giving the award
- To User - The username of the person receiving the award
- Template - the name of the template awarded
- Timestamp - when the award was given
- Award Text - Optional; this would be the text of the award
Special:WikiLoveStatistics
In the future, it should be possible to create a page, Special:WikiLoveStatistics, that could be used to see how often the system is used as well as providing insight into who gives the most love, what awards are most popular, and who receives the most awards.
This will help to provide a global overview of community health. The more awards given, the healthier the community.
未來思考
Phase two of this project could result in "Send WikiLove" links being dynamically added to signatures on talk pages. This would allow for WikiLove to be sent in a much easier manner, directly from other talk pages.
參見
- 維基友愛 - Original design document
- 擴展:感謝 - lighter-weight thanking for edits using Echo
- GiveCredit - MeatBall Wiki
![]() | 此擴充功能用於一個或多個維基媒體項目。 這可能意味着擴充功能足夠穩定、運作足夠良好,可以用在這樣的高流量的網站上。 請在維基媒體的CommonSettings.php和InitialiseSettings.php組態檔中查找此擴充功能的名稱以查看哪些網站安裝了該擴充功能。 特定wiki上的已安裝的擴充功能的完整列表位於Special:Version頁面。 |
![]() | 此擴充功能在以下wiki農場/託管網站和/或軟件包中提供: 這不是一份權威名單。 即使某些wiki農場/託管網站和/或軟件包未在這裏列出,它們也可能提供此擴充功能。 請檢查你的wiki農場/託管網站或軟件包以確認提供情況。 |
- Stable extensions/zh
- User interface extensions/zh
- MIT licensed extensions/zh
- Extensions in Wikimedia version control/zh
- BeforePageDisplay extensions/zh
- ChangeTagsListActive extensions/zh
- GetPreferences extensions/zh
- ListDefinedTags extensions/zh
- LoadExtensionSchemaUpdates extensions/zh
- SkinTemplateNavigation::Universal extensions/zh
- UserMergeAccountFields extensions/zh
- All extensions/zh
- Extensions used on Wikimedia/zh
- Extensions included in Miraheze/zh
- Extensions included in WikiForge/zh
- API extensions/zh