Jump to content

Extension:VoteNY

From mediawiki.org
Revision as of 23:03, 13 August 2012 by KrenairBot (talk | contribs) (This extension appears to be in SVN, not Git.)
MediaWiki extensions manual
VoteNY
Release status: stable
Implementation Parser extension
Description JavaScript-based voting with the <vote> tag
Author(s) Aaron Wright
David Pean
Jack Phoenix
Latest version 2.4
MediaWiki 1.18+
Database changes Yes
License GNU General Public License 2.0 or later
Download Template:WikimediaDownload/svn
$wgVoteDirectory
vote
Quarterly downloads 21 (Ranked 113rd)
Translate the VoteNY extension if it is available at translatewiki.net
Issues Open tasks · Report a bug

Vote a.k.a VoteNY extension adds the <vote> parser hook tag to allow voting on articles where the tag is present.

The magic word {{NUMBEROFVOTES}} can be used to display the number of votes in the database; this number is cached (in memcached) for 24 hours, so it's not totally up-to-date.

The special page Special:TopRatings displays the highest rated pages on the wiki. It supports filtering by category and namespace and its output can be embedded on wiki pages, so {{Special:TopRatings/Adventure Games/0/10}} will show 10 ratings where the pages are in the "Adventure Games" category and the pages are in the main (0) namespace.

Parameters

  • $wgVoteDirectory — path to the extension's files. Defaults to $IP/extensions/VoteNY.

Installation

  1. Download the files into $IP/extensions/VoteNY
  2. Add require_once("$IP/extensions/VoteNY/Vote.php"); into the wiki's LocalSettings.php
  3. Create the required database table Vote by re-running the MediaWiki updater script, update.php from command line
  4. Installation can now be verified through the wiki's Special:Version

User rights

This extension adds one new user right, vote, which is required in order to vote. By default, anonymous users do not have this right and thus they cannot vote but registered users can.

Dependencies

  • New database table, Vote

Usage

<vote /> outputs a green square voting box, <vote type=1 /> outputs five voting stars.

Internationalization

Message English Description
vote-link Vote
vote-unvote-link unvote Displayed to the user after their vote has been successfully added.
vote-community-score community score: $1 "community score" is the average score of the page in question
vote-ratings {{PLURAL:$1|one rating|$1 ratings}} $1 is the number of ratings, if said number is greater than 1.
vote-remove remove
vote-gave-this you gave this a $1 $1 is the score you gave to the page, for example 5 or 3.50.
vote-votes {{PLURAL:$1|one vote|$1 votes}} $1 is the number of votes.
topratings Top Ratings Title of Special:TopRatings, will be shown on the listing of special pages at Special:SpecialPages and on Special:TopRating itself.
topratings-no-pages No top rated pages. Shown on Special:TopRatings if there are absolutely no pages that have been rated yet (as is the case usually right after installing the extension).
right-vote Vote pages Displayed on Special:ListGroupRights.

To-do list

  • If user doesn't have 'vote' right or the DB is locked the extension should say that, not just fail silently or require the user to log in

Version history

Version SVN revision Release date Comments
2.4 r108076 4 January 2012 Compatible with ResourceLoader; requires MediaWiki 1.18 or greater
2.3.3 r97068 14 September 2011 Initial public release
2.0 N/A N/A Less external dependencies, RSS & Publish stuff removed
1.0 N/A N/A Initial cleaned-up version of extensions/wikia/Vote/ by Jack Phoenix