Extension:CommunityVoice

The CommunityVoice extension allows an editor to place a ratings scale anywhere in a wiki page, and then users can give 1-5 star ratings. Each ratings scale has a category and title attribute which will later be used by the ratings list tag, displaying top-rated titles in a category. Anyone can view the current rating, however if you are logged in you may also vote.

Has a dependency on Extension:ClientSide that provides functions for generating code in client-side formats such as HTML, CSS and JavaScript.

Installation
The ClientSide extension needs to be installed first for this extension to work.

Usage
The syntax to use is  ClientSide .


 * Category = Specify the properly category.
 * Title = Specify a title reference.



Example: 

Alternate syntax (works with templates):

Receiving an error
If you receive an error like:

Error returned by MySQL database is «1146: Table 'YOURWIKI.cv_ratings_votes' doesn't exist (localhost)».

Check your privileges, one of the possibles reasons it is the user have enough rights to create the tables required. Then try to run manually the Initialize.php through the shell. Go to the MediaWiki extensions folder and write the following code.

This will rebuild the tables required to run the extension.

Using a template to run the extension
Maybe in the future will be a good way to run properly the extension, it will be using a template, right now it's not possible because the extension don't support variables, it saves the variable value as a value, then it's not correct. Which is to say, the fields included as template parameters cannot be passed through reliably when the user clicks to vote -- eg, often ends up in the SQL db instead of the title, and an "error sending" message appears on the page. Do not use templates for this!

Create a simple template labeled Votes that contain the following code:

 Then to use the extension, it's easy use the template   and you will see the same thing of the screenshot.

Consider the use of template as a test, but not it to use seriously.

Strange behavior
When you refresh a page does it contain one rating value, you see  message instead of the correct message 0 / 5 (0 votes cast). If you introduce several rating values below of this, then the following rating messages are correct, but the first rating show an incorrect message. Right now it's unknown how to resolve this strange behavior.

None of the points above have solved my problem
If your are reading that, maybe your wiki is not running correctly the CommunityVoice, remember to check the files extension, for example. Sometimes the javascript files extension (.js) are changed to text files extension (.txt), then the javascript file is not executed. It's very particular for the file CommunityVoice.js.txt, if you see this then rename it to CommunityVoice.js.