Ninth Dimension |
08-18-2002 11:54 AM |
This is how you add the score to your post bit. These instructsion have been written as if you already have the tetris king hack installed.
In /admin/functions.php, find
PHP Code:
// King of Tetris Hack, by John Warwick
$kingid = $GLOBALS['kingid'];
if ($post[userid] == $kingid) {
$crown = '<img src="{imagesfolder}/crown.gif" alt="King of Tetris!" />';
} else {
$crown = '';
}
replace with
PHP Code:
// King of Tetris Hack, by John Warwick
$kingid = $GLOBALS['kingid'];
if ($post[userid] == $kingid) {
$crown = '<img src="{imagesfolder}/crown.gif" alt="King of Tetris!" />';
$tscore = $kingscore;
} else {
$crown = '';
$tscore = '';
}
In showthread.php, find
PHP Code:
$leaderboard = $DB_site->query_first('SELECT userid FROM arcade WHERE game = "tetris" ORDER BY score DESC');
$kingid = $leaderboard['userid'];
replace with
PHP Code:
$leaderboard = $DB_site->query_first('SELECT userid,score FROM arcade WHERE game = "tetris" ORDER BY score DESC');
$kingid = $leaderboard['userid'];
$kingscore = $leaderboard['score'];
then just add $tscore where you want thr score to apear in the postbit template.
The above code should work, but i've not tested it yet., make sure you get a back-up of all files b4 you apply this modification
|