Extension:VoteNY

From MediaWiki.org
Jump to: navigation, search
MediaWiki extensions manual - list
Crystal Clear action run.png
VoteNY

Release status: stable

VoteNY.png
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
Parameters

$wgVoteDirectory

Added rights

vote

Hooks used
ParserFirstCallInit

RenameUserSQL
LoadExtensionSchemaUpdates
ParserGetVariableValueSwitch
MagicWordwgVariableIDs

Translate the VoteNY extension if possible

Check usage and version matrix; code metrics
Bugs: list open list all report

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[edit | edit source]

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

Installation[edit | edit source]

  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[edit | edit source]

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[edit | edit source]

  • New database table, Vote

Usage[edit | edit source]

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

Magic Words[edit | edit source]

  • {{NUMBEROFVOTES}}: Returns the entire number of votes on the wiki.
  • {{NUMBEROFVOTESPAGE}}: Returns the vote score on the current page.
  • {{NUMBEROFVOTESPAGE:<page>}}: Returns the vote score on the given page.

Internationalization[edit | edit source]

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[edit | edit source]

  • 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[edit | edit source]

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
Social tools
SocialProfile OverviewRoadmapDeveloper infoScreenshotsHistoryUserStatus (GSoC 2011 project)
Other social extensions Automatic Board WelcomeBlogPageFanBoxesNewUsersListPictureGamePollNYQuizGameRandomFeaturedUserRandomGameUnitRandomUsersWithAvatarsSiteMetricsSportsTeamsUserStatusUserWelcome
Semanticness Semantic Social Profile
Other related extensions
(which do not depend on SocialProfile)
AnswersCommentsLinkFilterMediaWikiChatNewSignupPageVideoVoteNYWikiForumWikiTextLoggedInOut