Quote:
Originally posted by trilOByte
man, I cant read through 60 pages of posts. Is there a way to make it so a user only has one entry - their high score, on the leader table? Otherwise one person who is dynamite at this game, will dominate the entire leaderboard.
|
This can be done. Here's an example:
http://www.shadowsofnamek.com/forum/...game=tetris&s=
Or another, from a different game:
http://www.shadowsofnamek.com/forum/...me=breakout&s=
Only each user's best score is shown. To accomplish this, you need to alter the query used in tetris.php for the "leaderboard" action.
From the original tetris.php file, you will want to replace this:
PHP Code:
$leaderboard_q = $DB_site->query("SELECT * FROM arcade WHERE game='tetris' ORDER BY score DESC LIMIT 10");
with this:
PHP Code:
$leaderboard_q = $DB_site->query("SELECT game,userid,comment,max(score) as maxscore
FROM arcade
WHERE game='tetris'
GROUP BY userid
ORDER BY maxscore DESC
LIMIT 10");
That should achieve the result you're looking for.