Version: 1.4, by Oblivion Knight
Developer Last Online: Nov 2016
Version: 3.0.7
Rating:
Released: 02-22-2005
Last Update: 03-18-2005
Installs: 106
No support by the author.
This addon provides you with a Leader Board for v3arcade. Currently, it cannot be used for ibProArcade - if you adapt it, please share the code so that it can be added to the zip. You'll be credited for the work.
Dechevious has written a similar addon to this, but this code has been written from scratch and is far more optimized.. Currently, it is not fully phrased - but then again neither is v3arcade itself. Thanks to DRJ for his contributions toward v1.4. Enjoy!
Version History:
? [high]1.0[/high] - Original mod released.
? [high]1.1[/high] - Cached 2 previously uncached templates.
? [high]1.2[/high] - Query changed, orders count by DESC and userid by ASC.
? [high]1.3[/high] - *CRITICAL UPDATE* - Optimized query, improved performance.
? [high]1.4[/high] - arcade.php code block and arcade_kings_bit template changed.
Please click install if you find this useful..
Show Your Support
This modification may not be copied, reproduced or published elsewhere without author's permission.
I also made this mod. What I wanted was if there was a tie for a certain place then everyone should get that trophy. So if there is a tie for first then both users should have a gold, there would then be no silver and the next prize would be bronze.
If there is a three way (or more tie) then they would all get gold and there would be no silver or bronze. I believe I have this working properly, but it is hard to tell for sure. So maybe some other users that have a tie for first, second, or third could test this.
$navbits = array("arcade.php?$session[sessionurl]" => "Arcade");
$navbits[""] = "Leader Board";
$highscorers = $DB_site->query("
SELECT COUNT(games.highscorerid) AS count, user.username, user.userid FROM " . TABLE_PREFIX . "games AS games
LEFT JOIN " . TABLE_PREFIX . "user AS user ON user.userid = games.highscorerid
WHERE user.userid IS NOT NULL
GROUP BY user.username, user.userid ORDER BY count DESC, user.username ASC LIMIT 10
");
$row = '0';
$awards = '0';
$leaders = '0';
while ($kings = $DB_site->fetch_array($highscorers)) {
$leaders++;
if ($awards<>$kings[count]){
$row=$leaders;
}
$awards=$kings[count];
eval('$listkings .= "' . fetch_template('arcade_kings_bit') . '";');
}
in Arcade.php I ordered by username ASC instead of userid ASC since that makes more sense to me.
It was done as userid because I felt that there should be some advantages to being an older member.. - It's all down to personal perference with that one.
The other 2 changes you've made may be integrated into 1.4 once tested and confirmed as working, you'll be given credit for this of course.