I wanted there to be a trophy icon next to the nick of any user who had a high score in the arcade. I made these changes:
showflat.php
Find: [] // ------------------------------------------------ // Keep the current thread number for page linking $pagelinker = $current; [/]
Under this add: [] // --------------------------------- // Get the top scores for the arcade $query = " SELECT title, SUBSTRING(MAX(CONCAT(LPAD(score,6,'0'),userid)), 7) AS userid, 0.00 + LEFT(MAX(CONCAT(LPAD(score,6,'0'),userid)), 6) AS score FROM w3t_gamesessions, w3t_games WHERE (w3t_gamesessions.gamename = w3t_games.shortname) GROUP BY gamename; "; $sth = $dbh -> do_query($query,__LINE__,__FILE__); while (list($title,$userid,$score) = $dbh -> fetch_array($sth)) { $topscores[$title] = $userid; } $dbh -> finish_sth($sth); [/]
Find this: [] // --------------------- // Is it their birthday? if ($showbday) { if (preg_match("/^$month\/$day\//",$bday)) { $Username = "<img src="{$config['images']}/birthday.gif" alt="{$ubbt_lang['HAPPYBDAY']}" title="{$ubbt_lang['HAPPYBDAY']}" />$Username"; } } [/]
Under this add: [] // ---------------------------------------- // Do they have a high score in the arcade?
Under this add: [] // --------------------------------- // Get the top scores for the arcade $query = " SELECT title, SUBSTRING(MAX(CONCAT(LPAD(score,6,'0'),userid)), 7) AS userid, 0.00 + LEFT(MAX(CONCAT(LPAD(score,6,'0'),userid)), 6) AS score FROM w3t_gamesessions, w3t_games WHERE (w3t_gamesessions.gamename = w3t_games.shortname) GROUP BY gamename; "; $sth = $dbh -> do_query($query,__LINE__,__FILE__); while (list($title,$userid,$score) = $dbh -> fetch_array($sth)) { $topscores[$title] = $userid; } $dbh -> finish_sth($sth); [/]
Find: [] // --------------------- // Is it their birthday? if ($showbday) { if (preg_match("/^$month\/$day\//",$bday)) { $Username .= "<img src="{$config['images']}/birthday.gif" alt="{$ubbt_lang['HAPPYBDAY']}" title="{$ubbt_lang['HAPPYBDAY']}" />"; } } [/]
Under this add: [] // ---------------------------------------- // Do they have a high score in the arcade?
Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.
Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.