Extension:Ratings
Note: this extension is not finished enough for usage on production wikis. Some outstanding issues need to be resolved first.
|
Ratings Release status: experimental |
|
|---|---|
![]() |
|
| Description | Simple rating extension |
| Author(s) | Jeroen De Dauw |
| Last version | not released yet |
| MediaWiki | 1.16 or above |
| License | GPL v3 or above |
| Download |
Download snapshot (Git master)
Git [?]: repo summary • tree • code changes SVN [?]: checkout-url • tree • code changes |
|
Check usage (experimental) |
|
The Ratings extension provides a tag extension that when embedded in a page allows users to rate different "properties" of the page.
The main reason for creating a new extension is that Rating Bar has been replaced by W4G Rating Bar, which is not open source, so does not allow for adding any improvements. Other rating extensions I looked at do not allow doing the things I want to be able to do and are not written in a way that easily allows changing this.
Contents |
[edit] Version
Do note this extension is still in alpha stage. Although core functionality is mostly working, some things still need to be implemented, and many things are in need of some polishing. A particular thing lacking decent support now is handling of the rating control when the user is not allowed to rate. There are also significant issues with positioning of the rating stars. This is some lame CSS issue, help with it is welcome.
Some feature that might be added in the feature is displaying lists of votes and lists of pages based on votes. Integration with SMW is also possible. And vote summaries can be cached better.
[edit] Download
No releases are available yet.
You can also get the code directly from SVN. Tags can be obtained via
svn checkout http://svn.wikimedia.org/svnroot/mediawiki/tags/extensions/Ratings/REL_version
Where 'version' is the version number of the tag, such as 0_1 (see the available tags). The latest code can be obtained from trunk:
svn checkout http://svn.wikimedia.org/svnroot/mediawiki/trunk/extensions/Ratings/
Ratings requires Validator 0.4.5 or above in order to work. A compatible copy of Validator always comes bundled with the regular releases, and is automatically loaded by Ratings, so you do not need to worry about it when using one of these. If you are getting the code from SVN, make sure you also get a copy of Validator (see here for instructions).
[edit] Installation
Once you have downloaded the code, place the Ratings and Validator directories within your MediaWiki 'extensions' directory. Then add the following code to your LocalSettings.php file:
# Ratings require_once( "$IP/extensions/Ratings/Ratings.php" );
Note that you need to place this code before the inclusion of any extensions depending on Validator.
[edit] Usage
[edit] Starrating
Description: Displays a simple star rating control allowing the user to rate a certain property of a page. The current vote of the user will be displayed initially when he already voted.
Implemented as both parser function and as tag extension.
[edit] Parameters
| # | Parameter | Aliases | Type | Default | Description |
|---|---|---|---|---|---|
| 1 | tag | - | Text | required | The rating tag. The tag indicates what "property" of the page gets rated. |
| 2 | page | - | Text | The page the rating applies to. | |
| - | showdisabled | - | Yes/no | 1 | Show ratings when the user can not vote (in read-only mode). |
| - | incsummary | - | Yes/no | Show a summary of the current votes above the rating element? |
[edit] Syntax
Tag extension with only the required parameters.
<starrating tag="{Text}" />
Tag extension with all parameters.
<starrating tag="{Text}" page="{Text}" showdisabled="{Yes/no}" incsummary="{Yes/no}" />
Tag extension with all parameters using the default parameter notation.
<starrating page="{Text}" showdisabled="{Yes/no}" incsummary="{Yes/no}">{tag, Text}</starrating>
Parser function with only the required parameters.
{{#starrating:tag={Text}}}
Parser function with all parameters.
{{#starrating:
tag={Text}
| page={Text}
| showdisabled={Yes/no}
| incsummary={Yes/no}
}}
Parser function with all parameters using the default parameter notation.
{{#starrating:
{tag, Text}
| {page, Text}
| showdisabled=Yes/no
| incsummary=Yes/no
}}
[edit] Votesummary
Description: Displays a short summary of the votes for the specified page and property pair.
Implemented as both parser function and as tag extension.
[edit] Parameters
| # | Parameter | Aliases | Type | Default | Description |
|---|---|---|---|---|---|
| 1 | tag | - | Text | required | The rating tag. The tag indicates what "property" of the page gets rated. |
| 2 | page | - | Text | The page the rating applies to. |
[edit] Syntax
Tag extension with only the required parameters.
<votesummary tag="{Text}" />
Tag extension with all parameters.
<votesummary tag="{Text}" page="{Text}" />
Tag extension with all parameters using the default parameter notation.
<votesummary page="{Text}">{tag, Text}</votesummary>
Parser function with only the required parameters.
{{#votesummary:tag={Text}}}
Parser function with all parameters.
{{#votesummary:tag={Text}|page={Text}}}
Parser function with all parameters using the default parameter notation.
{{#votesummary:{tag, Text}|{page, Text}}}
[edit] Contributing to the project
[edit] Bugs and patches
If you found some bug and fixed it, please create a patch by going to the "Ratings" directory, and typing:
svn diff >descriptivename.patch
Then upload it somewhere and link to it from the talk page. Bug reports should also be added here. You can also send them to Jeroen De Dauw, jeroendedauw -at- gmail.com.
[edit] Feature requests
Feel free to add feature requests to the discussion page.
[edit] Translating
Translation of Ratings is done through translatewiki.net. The translation for this extension can be found here. To add language values or change existing ones, you should create an account on translatewiki.net, then request permission from the administrators to translate a certain language or languages on this page (this is a very simple process). Once you have permission for a given language, you can log in and add or edit whatever messages you want to in that language.
Translations for this documentation, especially the extension description, are also welcome.
[edit] Authors
Ratings has been written by Jeroen De Dauw.
[edit] Screenshots
[edit] External links
- Blog of the author about Ratings

