Wiki4Games:RatingBar

From Wiki4Games

Revision as of 07:25, 22 August 2009 by Mcqsmall (Talk | contribs)
(diff) ← Older revision | Current revision (diff) | Newer revision → (diff)
Jump to: navigation, search

RatingBar is an extension for MediaWiki developed by Franck Dernoncourt and Patheticcockroach for Wiki4Games.com.

Contents

[edit] Download

You can download the extension here:

[edit] File list

Important: the versions of these files available on the wiki aren't always the latest versions, people willing to install the extension should rather refer to the download section to grab the latest version.


No more in use:

[edit] To do, changelog

See Wiki4Games:RatingBar/todo and Wiki4Games:RatingBar/changelog

[edit] To be done before release

  • Update version number in ratingbar.php (for display on Special:Version)
  • Clear config.php (password and such)
  • Replace all Error: ".mysql_error()' with die("MySQL query failed")

[edit] Usage for w4g_ratingbar hook

[edit] Display rating bar

<w4g_ratingbar idpage="Wiki4Games:RatingBar"/>

Current user rating: 64% (12 votes)

 You need to enable Javascript to vote


Note: The idpage parameter is optional. If not specified, wgPageName will be used as the idpage.

For stars instead of the bar just add
style="stars"

[edit] Usages for w4g_ratinglist hook

[edit] Display top rated pages

<w4g_ratinglist numberofitems="10"/>
All time (Top 10)
Video game Rating Votes #
Template:Reviews users 100% 1
Duke Nukem 3D 98% 2
Dune 97% 2
Airline Tycoon Evolution 95% 1
Max Payne 95% 4
Flight Simulator X 95% 1
Grand Theft Auto 95% 1
Diablo 2 95% 1
Doom 3 95% 1
Need for Speed Underground 95% 1

[edit] Within a period of time

<w4g_ratinglist numberofitems ="3" numberofdays="10"/>
Last 10 days (Top 3)
Video game Rating Votes #

[edit] Hiding the number of votes

<w4g_ratinglist numberofitems="10" hidenumberofvotes/>
All time (Top 10)
Video game Rating
Template:Reviews users 100%
Duke Nukem 3D 98%
Dune 97%
Airline Tycoon Evolution 95%
Max Payne 95%
Flight Simulator X 95%
Grand Theft Auto 95%
Diablo 2 95%
Doom 3 95%
Need for Speed Underground 95%

[edit] Having a minimum number of votes

<w4g_ratinglist numberofitems="6" minimumvotenumber="3"/>
All time (Top 6)
Video game Rating Votes #
Max Payne 95% 4
Unreal Tournament 95% 4
GoldenEye 007 93% 3
Driver 93% 3
Rayman 92% 6
Moto Racer 90% 3

[edit] Within a category

<w4g_ratinglist numberofitems="5" category="Windows_games"/>
All time (Top 5)
Video game Rating Votes #
Duke Nukem 3D 98% 2
Grand Theft Auto 3 95% 1
Grand Theft Auto 95% 1
Unreal 95% 2
Unreal Tournament 95% 4

Note: The category can be written the spaces and underscores in the category name are interchangeable: <w4g_ratinglist numberofitems="5" category="Windows_games"/> will give the same result as <w4g_ratinglist numberofitems="5" category="Windows games"/>.


[edit] Display user's votes

Note for the admins: $allow_display_user_votes in config.php should be set to true to activate this function. If you only want users to be able to display their own votes, set $allow_display_user_own_votes_only in config.php to true.

[edit] Without limit on numbers of items

<w4g_ratinglist user="Franck Dernoncourt"/>
Franck Dernoncourt's votes
Video game User's vote
Unreal Tournament 100%
Mario Kart 64 100%
Driver 100%
Quake 3 100%
Rayman 100%
Sonic the Hedgehog 2 (16-bit) 100%
Duke Nukem 3D 100%
Wolfenstein 3D 99%
GoldenEye 007 99%
Formula One Grand Prix 97%
Super Mario 64 97%
Unreal 96%
Quake 94%
Age of Empires 94%
Dune 94%
Rayman Designer 94%
X-Moto 94%
Command & Conquer: Red Alert 93%
Moto Racer 93%
Command & Conquer: Red Alert 2 92%

[edit] With limit on numbers of items

<w4g_ratinglist user="Franck Dernoncourt" numberofitems="2"/>
Franck Dernoncourt's votes
Video game User's vote
Unreal Tournament 100%
Mario Kart 64 100%

[edit] With timestamp

<w4g_ratinglist user="Franck Dernoncourt" displaytimestamp/>
Franck Dernoncourt's votes
Video game User's vote Voting time
Unreal Tournament 100% February 23, 2009, 10:19 pm
Mario Kart 64 100% February 26, 2009, 1:42 am
Driver 100% February 27, 2009, 10:45 pm
Quake 3 100% March 1, 2009, 6:48 pm
Rayman 100% February 23, 2009, 10:14 pm
Sonic the Hedgehog 2 (16-bit) 100% March 26, 2009, 2:05 pm
Duke Nukem 3D 100% February 23, 2009, 12:58 pm
Wolfenstein 3D 99% May 16, 2009, 7:30 pm
GoldenEye 007 99% February 26, 2009, 1:41 am
Formula One Grand Prix 97% March 29, 2009, 1:10 pm
Super Mario 64 97% February 26, 2009, 1:42 am
Unreal 96% February 23, 2009, 12:58 pm
Quake 94% February 26, 2009, 1:42 am
Age of Empires 94% February 22, 2009, 9:27 pm
Dune 94% February 25, 2009, 4:46 pm
Rayman Designer 94% March 29, 2009, 1:13 pm
X-Moto 94% March 29, 2009, 11:14 am
Command & Conquer: Red Alert 93% March 11, 2009, 3:37 pm
Moto Racer 93% February 23, 2009, 10:17 pm
Command & Conquer: Red Alert 2 92% March 10, 2009, 2:13 pm

[edit] Within a period of time

<w4g_ratinglist user="Franck Dernoncourt" numberofdays="10"/>
Franck Dernoncourt's votes
Video game User's vote

[edit] Within a category

<w4g_ratinglist user="Franck Dernoncourt" category="2006 games"/>
Franck Dernoncourt's votes
Video game User's vote
F.E.A.R. Perseus Mandate 83%
ArmA: Armed Assault 82%
The Elder Scrolls 4: Oblivion 81%
F.E.A.R. Combat 81%
Call of Juarez 80%
Prey 80%
Driver: Parallel Lines 78%
F.E.A.R. Extraction Point 75%
Pirates of the Caribbean: The Legend of Jack Sparrow 70%
Bad Day L.A. 21%

[edit] Display top voters

<w4g_ratinglist topvoters/>
Top 20 voters all time
User Average rating Votes
Roses 77% 95
Franck Dernoncourt 80% 79
Patheticcockroach 74% 62
Wandy 85% 13
Asher 80% 9
Redekopmark 82% 8
WonderAlice 81% 8
Worms 86% 7
PMike 78% 6
Prentice 68% 5
Aldo 80% 4
Cplaguest 64% 4
Viraba 96% 4
FrankyRP 43% 3
Bandicoot456 44% 3
Joseesoj 77% 3
Anden21 92% 3
GameInformer100 87% 2
Digital 71% 2
Rahmanaout 37% 2

[edit] With limit on numbers of items

<w4g_ratinglist topvoters="3"/>
Top 3 voters all time
User Average rating Votes
Roses 77% 95
Franck Dernoncourt 80% 79
Patheticcockroach 74% 62

[edit] Within a period of time

<w4g_ratinglist topvoters="3" numberofdays="10"/>
Top 3 voters over the last 10 days
User Average rating Votes

[edit] Within a category

<w4g_ratinglist topvoters="5" category="2006 games"/>
Top 5 voters all time
User Average rating Votes
Roses 73% 21
Franck Dernoncourt 73% 10
Patheticcockroach 63% 8
Wandy 83% 3
GameInformer100 87% 2

[edit] List voters for one page

<w4g_ratinglist idpage="Driver: Parallel Lines" displayvoters/>
Voters for Driver: Parallel Lines
User Rating Time
Patheticcockroach 79% February 22, 2009, 9:53 pm
Franck Dernoncourt 78% February 22, 2009, 9:28 pm

Note for the admins: $allow_display_voters_for_one_page in config.php should be set to true to activate this function.

[edit] With limit on numbers of items

<w4g_ratinglist idpage="Age of Empires" numberofitems="3" displayvoters/>
Voters for Age of Empires
User Rating Time
Cplaguest 94% May 9, 2009, 6:24 pm
Redekopmark 80% April 22, 2009, 4:48 am
Wandy 91% April 2, 2009, 12:19 am

[edit] Within a period of time

<w4g_ratinglist idpage="Unreal Tournament 3" numberofdays="5" displayvoters/>
Voters for Unreal Tournament 3
User Rating Time

[edit] Latest votes

<w4g_ratinglist latestvotes="5"/>
Latest votes (5)
Time Video game Rating User
October 23, 2009, 12:43 am Evil Genius 78% Franck Dernoncourt
October 17, 2009, 11:54 pm Evil Genius 85% Roses
October 17, 2009, 11:47 pm Diablo 2 95% Roses
October 16, 2009, 2:36 pm World of Warcraft: The Burning Crusade 88% Roses
October 16, 2009, 2:20 pm Glory of the Roman Empire 77% Roses

Note: If latestvotes is set to 0 (<w4g_ratinglist latestvotes="5"/>) or unspecified (<w4g_ratinglist latestvotes/>), it will list all votes.
Note for the admins: $allow_display_latest_votes in config.php should be set to true to activate this function.

[edit] Within a category

<w4g_ratinglist latestvotes="5" category="Nintendo_64_games"/>
Latest votes (5)
Time Video game Rating User
September 23, 2009, 5:33 am GoldenEye 007 85% Joseesoj
August 16, 2009, 6:34 pm Mario Kart 64 48% Prentice
May 9, 2009, 6:45 pm Super Mario 64 65% Cplaguest
April 16, 2009, 3:09 am Mario Kart 64 100% Redekopmark
April 16, 2009, 2:51 am Super Mario 64 100% Redekopmark

[edit] Titles

If you want not to display title, add notitle as a parameter. For example:

<w4g_ratinglist latestvotes="5" notitle/>
Time Video game Rating User
October 23, 2009, 12:43 am Evil Genius 78% Franck Dernoncourt
October 17, 2009, 11:54 pm Evil Genius 85% Roses
October 17, 2009, 11:47 pm Diablo 2 95% Roses
October 16, 2009, 2:36 pm World of Warcraft: The Burning Crusade 88% Roses
October 16, 2009, 2:20 pm Glory of the Roman Empire 77% Roses

[edit] Unsortable table

If you want not to have an unsortable table, add nosort as a parameter. For example:

<w4g_ratinglist latestvotes="5" nosort/>
Latest votes (5)
Time Video game Rating User
October 23, 2009, 12:43 am Evil Genius 78% Franck Dernoncourt
October 17, 2009, 11:54 pm Evil Genius 85% Roses
October 17, 2009, 11:47 pm Diablo 2 95% Roses
October 16, 2009, 2:36 pm World of Warcraft: The Burning Crusade 88% Roses
October 16, 2009, 2:20 pm Glory of the Roman Empire 77% Roses
Partners
...more partners