<?php
//v1.0 www.exoops.info 2006/05
function b_topgames_show(){
        global $db, $myts;
        $block = array();
        $block['title'] = _MDB_TITLE1;
        $block['content'] = '<table width="100%">';
        $block['content'] .= "<tr>";
        $block['content'] .= "<td></td>";
        $block['content'] .= "<td><b>"._MDB_TIMES."</b></td>";
        $block['content'] .= "<td><b>"._MDB_GAME."</b></td>";
        $block['content'] .= "</tr>";
        $sql = "SELECT gid,gcount,gname,gtitle from ".$db->prefix('arcade_games')." ORDER BY gcount DESC";
        $res = $db->query($sql, 10);
	include_once(XOOPS_ROOT_PATH."/modules/arcade/include/arcade_func.php");
	
        while ($row = $db->fetch_object($res)){
                $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>".$row->gcount."</td>";
                $block['content'] .= "<td><a href='".XOOPS_URL."/modules/arcade/index.php?act=play_game&gid=".$row->gid."' >".$row->gname."</a></td>";
                $block['content'] .= "</tr>";
        }
        $block['content'] .= '</table>';
        return $block;
}
?>