<?php
//v1.0.4 www.bcoos.net 2006/10 GPL
function b_highscores_show()
{
        global $db, $myts;
        $block = array();
        $block['title'] = _MDB_TITLE;
        $block['content'] = '<table width="100%">';
        $block['content'] .= "<tr>";
        $block['content'] .= "<td></td>";
        $block['content'] .= "<td><b>"._MDB_SCORE."</b></td>";
        $block['content'] .= "<td><b>"._USER."</b></td>";
        $block['content'] .= "</tr>";
        $sql = "select gid,gname,gtitle from ".$db->prefix('arcade_games')." ORDER BY RAND(NOW())";
        $res = $db->query($sql, 10);
	include_once(XOOPS_ROOT_PATH."/modules/arcade/include/arcade_func.php");
        while ($row = $db->fetch_object($res))
        {
                $highscore = _get_game_highscore($row->gid);
                $block['content'] .= "<tr>";
                $block['content'] .= "<td><a href='".XOOPS_URL."/modules/arcade/index.php?act=play_game&gid=".$row->gid."' ><img src='".XOOPS_URL."/modules/arcade/cache/images/".$row->gname."2.gif' alt='".$row->gtitle."'></a></td>";
                $block['content'] .= "<td>".$highscore['score']."</td>";
                $block['content'] .= "<td>".$highscore['uname']."</td>";
                $block['content'] .= "</tr>";
        }
        $block['content'] .= '</table>';
        return $block;
}
?>