> */ //Upload the arcade_block.gif (you can use you own gif - just name it arcade_block.gif) //to your Themes//images/ folder // -- SETUP EDITS --- $db_prefix = 'arcade_'; //edit this to your your database prefix - usually smf_ $no = 5; //number of top players to show // --LANGUAGE EDITS -- $txtplay = "Top 5 Players"; // change "The Top Players" to your language $txtwin = "Number Of Wins :";// change "Number Of Wins :" to your language $txtlate = "Latest High Score by ";// change "Latest High Score set by" to your language $txtwit = "with ";// change "with" to your language $txton = "on ";// change "on" to your language require('./Settings.php'); global $scripturl; $link = mysql_connect($db_server, $db_user, $db_passwd); mysql_select_db($db_name, $link); //Get newest champ or die $sql = "SELECT m.ID_MEMBER,m.realName,g.id, g.game, g.name,g.champion_score,g.thumb " . "FROM {$db_prefix}members m , {$db_prefix}games g " . "WHERE g.champion_score > 0 AND m.ID_MEMBER=g.champion_member " . "ORDER BY g.champion_time DESC LIMIT 0,1"; if(!($result = mysql_query($sql,$link))) { die("Could not get the newest champ"); } $row = mysql_fetch_assoc($result); mysql_free_result($result); //newest champ details $playerid = $row['ID_MEMBER']; $player = $row['realName']; $game_id = $row['id']; $game_name = $row['name']; $score = round($row['champion_score'],2); $game_pic = $boardurl."/Games/".$row['thumb']; //Get the 10 best players or die $sql = "SELECT m.ID_MEMBER, m.realName, count(g.id) As cnt" . " FROM {$db_prefix}games g, {$db_prefix}members m" . " WHERE m.ID_MEMBER=g.champion_member" . " GROUP BY realName " . " ORDER BY cnt DESC LIMIT 0,{$no}"; if(!($result = db_query($sql,__FILE__,__LINE__))) { die("Could not get the best players"); } $row = mysql_fetch_assoc($result); $score_poss=0; //players position ?>
',$game_name,'
',$txtlate,'
',$player,'
',$txtwit,' ',$score,' ',$txton,'',$game_name,'
------------------
',$txtplay,'

'; do { $score_poss++; echo '',$score_poss,' - ',$row['realName'],'
',$txtwin,' ',$row['cnt'],'

'; } while ($row = mysql_fetch_assoc($result)); echo '
'; mysql_free_result($result);