Extension:RatePage

The RatePage extension enables readers to rate pages on a wiki.

On desktop skins (currently tested under Monobook, Vector and Timeless) it adds a widget in the sidebar that allows readers to choose any of five available ratings for a page. The extension also works on Minerva, adding the widget in the footer. The extension is configurable and allows for disabling of the default frontend and potentially using a different one. The main functionality is provided via an API module and the data is stored in a custom database table.

Configuration

 * $wgRPRatingAllowedNamespaces: Array of namespace IDs that are allowed to be rated. Default is null, which allows all namespaces. An empty array means no namespaces are allowed.
 * $wgRPRatingPageBlacklist: Array of page titles that are not allowed to be rated. Default is an empty array. You may want to add the main page to the blacklist.
 * $wgRPSidebarPosition: Integer indicating where in the sidebar should the widget be placed (one-based index). Default is 2, which places the widget directly under the first (default) sidebar section.
 * $wgRPFrontendEnabled: Bool indicating whether the default frontend module should be loaded. Default is true. Disable this if you want to write your own custom JS script for voting.
 * $wgRPAddSidebarSection: Bool indicating whether to add the default sidebar section for the widget. Default is true. Disable this if you want to write your own custom JS script for voting and you don't want to rely on the extension adding a section to the sidebar.
 * $wgRPRatingMin: Minimal allowed rating. Default is 1. You may want to change that if you decide to remove the default frontend module and write your own that for example allows for only three different ratings.
 * $wgRPRatingMax: Maximal allowed rating. Default is 5.

Rate limiting
RatePage supports rate limiting for its API. For more information about $wgRateLimits and how to set it up, read Manual:$wgRateLimits, the action key is.

Sidebar cache
RatePage does not function properly with sidebar cache enabled. It is disabled by default, but if you have it enabled, you should disable it through the $wgEnableSidebarCache configuration variable.

API
RatePage adds one API module that can be used both for voting on pages and retrieving votes that have been added so far.

action = pagerating
Allows users to rate pages and retrieve all votes that have been submitted so far.


 * Parameters
 * : The id of the page
 * : The title of the page (you must specify either  or
 * : Your rating of the page (optional). If you do not specify the  parameter, the API will just return the current votes.


 * Example