I got a database error when opening a games highscores while no one has yet played that game. So there were no highscores to show.
I found a solution though:
in arcade.php find:
Code:
if ($vbulletin->options['distinctscores'])
{
$scorecache = array();
while ($score = $db->fetch_array($scores))
{
$scorecache[] = "(arcade_sessions.score='$score[score]' AND arcade_sessions.userid=$score[userid])";
}
$scorecache = implode(' OR ', $scorecache);
$scores = $db->query_read("SELECT arcade_sessions.*, user.username, user.email FROM " . TABLE_PREFIX . "arcade_sessions AS arcade_sessions
LEFT JOIN " . TABLE_PREFIX . "user AS user ON (user.userid=arcade_sessions.userid)
WHERE arcade_sessions.valid=1 AND arcade_sessions.gameid=$game[gameid] AND ($scorecache)
ORDER BY score " . iif($game['isreverse']==1, 'ASC', 'DESC') . ", arcade_sessions.finish DESC
LIMIT " . $vbulletin->options['scoresperpage']);
}
and replace by
Code:
if ($vbulletin->options['distinctscores'])
{
$scorecache = array();
while ($score = $db->fetch_array($scores))
{
$scorecache[] = "(arcade_sessions.score='$score[score]' AND arcade_sessions.userid=$score[userid])";
}
$scorecache = implode(' OR ', $scorecache);
if (!empty($scorecache))
{
$scores = $db->query_read("SELECT arcade_sessions.*, user.username, user.email FROM " . TABLE_PREFIX . "arcade_sessions AS arcade_sessions
LEFT JOIN " . TABLE_PREFIX . "user AS user ON (user.userid=arcade_sessions.userid)
WHERE arcade_sessions.valid=1 AND arcade_sessions.gameid=$game[gameid] AND ($scorecache)
ORDER BY score " . iif($game['isreverse']==1, 'ASC', 'DESC') . ", arcade_sessions.finish DESC
LIMIT " . $vbulletin->options['scoresperpage']);
}
}