First of all nice hack john. I didn't read all of the posts in this thread so just ignore me if this was already mentioned. I wanted to change the amount of leaders displayed to 50 instead of 10 and noticed you have a single query for each user name on the list.
Edited with better instructions for Jashugan
All instruction below need to be done twice!
Change both instances of $leaderboard_q to (replace 10 with whatever number of leaders you want shown):
PHP Code:
$leaderboard_q = $DB_site->query("SELECT arcade.*,user.username FROM arcade,user WHERE game='tetris' AND user.userid=arcade.userid ORDER BY score DESC LIMIT 10");
Under $s_userid = $leadloop['userid']; add:
PHP Code:
$s_username = $leadloop['username'];
Delete the following block
PHP Code:
$user_result = $DB_site->query("SELECT username FROM user WHERE userid='$s_userid'");
$details_array=$DB_site->fetch_array($user_result);
$s_username = $details_array['username'];
This will save you 10 queries on the leader board or in my case 50