Wiki4Games:W4G Rating Bar/syntax

From Wiki4Games
Jump to: navigation, search
Back to W4G Rating Bar

This page lists all possible uses of W4G Rating Bar as of version 2.0-b2.

Contents

Displaying a rating bar

{{#w4grb_rate:[page name]}}
If no page name is specified, the bar will rate the page where it's inserted. For instance both the following bars rate this page: Current user rating: 71/100 (2 votes)

 You need to enable JavaScript to vote

Current user rating: 71/100 (2 votes)

 You need to enable JavaScript to vote


Displaying the rating of a specific page

{{#w4grb_rawrating:[page name]}}
If no page name is specified, the bar will give the rating of the page where it's inserted. For instance this page is rated: 71.
It's also possible to display the number of votes cast on a page by using {{#w4grb_rawrating:[page name]|n}}
For instance this page was voted on: 2 time(s).

Displaying top lists

This time, you don't use a parser function but a tag. The base tag is <w4grb_ratinglist/>, but if you don't provide any parameters it will output an error, like this:

There is an error in your syntax, you should check the extension's documentation.

Standard parameters

Some parameters are available for all or most functions:

Max amount of items

To limit the maximum number of items in the list, use the items parameter. For instance <w4grb_ratinglist toppages items="10"/>. Note that:

  • the maximum amount of items can be limited by the wiki's administrator using $wgW4GRB_Settings['max-items-per-list'].
  • if you don't set this parameter it will default to $wgW4GRB_Settings['default-items-per-list']

Hide table caption/title

To prevent the table caption from showing up, add the notitle parameter. For instance <w4grb_ratinglist toppages notitle/>.

Make a non-sortable list

By default, the list is sortable. To disable this, add the nosort parameter. For instance <w4grb_ratinglist toppages nosort/>.

Skip the X first items

You can skip the first results of the list by setting the offset parameter. For instance <w4grb_ratinglist toppages offset="2"/> will skip the first top 2 pages.

Make a list from a specific category

To apply the list to one specific category, set the category parameter. For instance <w4grb_ratinglist toppages category="2009 games"/> will display the top page in Category:2009 games, like this:

Pages with the highest average rating in category 2009_games (showing up to 10 pages)
Page Rating Vote count
Grand Ages: Rome 79% 2
Armada 2526 78% 1
Risen 74% 2
Call of Duty: Modern Warfare 2 70% 6
NecroVisioN 67% 3
Altitude 63% 3
Battlefield Heroes 51% 4
Hunting Unlimited 2010 33% 1

Only consider votes from within the last X days

To apply the list only to the X latest days before today, set the days parameter. Note that if the wiki's administrator set $wgW4GRB_Settings['allow-unoptimized-queries'] to false, this setting will be disable in the toppages top list.

Latest votes

Add the latestvotes parameter to display the latest votes cast. Note that if the wiki's administrator set $wgW4GRB_Settings['show-voter-names'] to false, you won't be able to see the name of the users who voted. This list has no specific parameters. For instance <w4grb_ratinglist latestvotes items="5" nosort/> will display the latest 5 votes over the whole wiki in a non-sortable table, like this:

Latest votes (showing up to 5 votes)
Time Page Rating User
March 21, 2012, 2:48 pm Castlot 48% Patheticcockroach
January 20, 2012, 5:22 pm NBA Live 07 54% Patheticcockroach
January 10, 2012, 12:08 am Wiki4Games:Sandbox/RBtest 76% Prentice
December 7, 2011, 8:51 pm Wiki4Games:W4G Rating Bar/syntax 63% Chris
December 1, 2011, 7:35 am Template:Newpage VG 72% Shabbir

Latest votes for a specific page

Add the pagevotes parameter to display the latest votes cast on a specific page. You'll also need to specify the specific idpage parameter (full page name of the page), or you'll get an error. For instance <w4grb_ratinglist pagevotes idpage="Age of Empires" items="5"/> will display the 5 latest votes on Age of Empires, like this:

Votes for Age of Empires (showing up to 5 votes)
Time Rating User
June 3, 2011, 1:09 pm 98% Uma
May 30, 2011, 4:30 pm 97% Meko
February 1, 2011, 5:43 pm 85% Nitramrp
January 15, 2011, 10:52 am 77% Sh4rm1
January 15, 2011, 10:40 am 85% ShalKekNemRon

Latest votes by a user

Add the uservotes parameter to display the latest votes cast by a user. You'll also need to specify the specific user parameter (user name of the user), or you'll get an error. Note that this function will be totally disabled if $wgW4GRB_Settings['show-voter-names'] was set to false by the wiki's administrator. For instance <w4grb_ratinglist uservotes user="Patheticcockroach" items="5"/> will display the 5 latest votes cast by User:Patheticcockroach, like this:

Patheticcockroach's votes (showing up to 5 votes)
Page Rating Time
Castlot 48% March 21, 2012, 2:48 pm
NBA Live 07 54% January 20, 2012, 5:22 pm
Armada 2526 78% May 30, 2011, 10:34 pm
Silent Hunter 3 86% May 21, 2011, 9:00 am
Dune 100% May 11, 2011, 4:05 pm

Additional parameters

If you want to sort the highest votes by a user instead of their latest vote, add orderby="rating". If you want to sort in ascending order instead of the standard descending order, use order="asc" (NB: this order option should later by deployed to the other top lists).

Top pages

Add the toppages parameter to display the top pages, either by rating (default) or by amount of votes (for this add the topvotecount parameter). Optional specific parameters: hidevotecount to hide the vote count and minvotecount to specify the minimum vote count for a page to be included in the top list. For instance <w4grb_ratinglist toppages items="5" minvotecount="2" hidevotecount/> will display the 5 top rated pages with at least 2 votes, hiding the vote count, like this:

Pages with the highest average rating (showing up to 5 pages with at least 2 votes)
Page Rating
The Witcher 2: Assassins of Kings 97%
Age of Wonders: Shadow Magic 95%
Need for Speed: Most Wanted 95%
Beneath a Steel Sky 94%
Formula One Grand Prix 94%

Some options (like days) can be disabled if the wiki's administrator set $wgW4GRB_Settings['allow-unoptimized-queries'] to false. hideavgrating will hide the actual ratings - useful if you only want to show most voted pages.

Top voters

Add the topvoters parameters to display a list of users with the most votes. This function is disabled if the wiki's administrator set $wgW4GRB_Settings['allow-unoptimized-queries'] to false. For instance <w4grb_ratinglist topvoters items="5"/> will display the 5 users who voted the most, like this:

Users who voted the most (showing up to 5 voters)
User Rating Vote count
ShalKekNemRon 56% 129
Patheticcockroach 74% 105
Roses 78% 97
Franck Dernoncourt 81% 84
Sh4rm1 64% 48