John, why do you place that query in showthread.php? U could also put it by the rest. If you put it by the rest then $DB_site is already globalised.
admin/functions.php:
find:
PHP Code:
$datecut = time() - $cookietimeout;
Put after it:
PHP Code:
// King of Tetris Hack, by John Warwick
$leaderboard = $DB_site->query_first('SELECT userid FROM arcade WHERE game = "tetris" ORDER BY score DESC');
$kingid = $leaderboard['userid'];
if ($post[userid] == $kingid) {
$crown = '<img src="https://vborg.vbsupport.ru/images/crown.gif" alt="King of Tetris!" />';
} else {
$crown = '';
}