Hi there. If it's the first time you come here, maybe you want to read a short site presentation. If you're interested in editing, you can check how to create a page and how to edit a page to get started right away! You may also want to make an account, so your name will be linked to your contributions.

If you already have an account, you should log in now.

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.

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: {{#w4grb_rate:}} {{#w4grb_rate:Wiki4Games:W4G Rating Bar/syntax}}

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: {{#w4grb_rawrating:}}.
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: {{#w4grb_rawrating:|n}} 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:

<w4grb_ratinglist/>

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: <w4grb_ratinglist toppages category="2009 games"/>

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: <w4grb_ratinglist latestvotes items="5" nosort/>

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: <w4grb_ratinglist pagevotes idpage="Age of Empires" items="5"/>

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: <w4grb_ratinglist uservotes user="Patheticcockroach" items="5"/>

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: <w4grb_ratinglist toppages items="5" minvotecount="2" hidevotecount/> 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: <w4grb_ratinglist topvoters items="5"/>