I wrote this script to pull the top 10 leaders out of the vbpool software
PHP Code:
<?php
require_once('./global.php');
global $vbulletin;
$query = $vbulletin->db->query_read
("SELECT COUNT(G.vbpool_gameid) AS score, U.username AS username, P.userid AS userid
FROM vbpool_game G, vbpool_picks P, user U, vbpool_week W, vbpool_pool X
WHERE (G.winner=P.pick OR G.winner='-1')
AND G.vbpool_gameid=P.vbpool_gameid
AND P.userid=U.userid
AND W.vbpool_weekid=G.vbpool_weekid
AND X.vbpool_poolid=W.vbpool_poolid
AND X.vbpool_poolid=2
GROUP BY userid
ORDER BY score DESC, username ASC
LIMIT 10");
$rownum = 1;
//echo '<tbody><tr>';
// Retrieve and print every record.
while($player=$db->fetch_array($query))
{
if($rownum==1) $leader = $player['userid'];
$thisscore = $player['score'];
$thisname = $player['username'];
$thisuserid = $player['userid'];
$weekscore = $scorecache[$thisuserid];
$rownum++;
echo "<td class='smallfont' align='left'><strong>$thisname</strong></td>
<td align='right'>$thisscore</td><br />";
}
echo '</tr></tbody>';
?>
i have a sidebar on the left side of my forums:
http://www.sportsrant.com/forums/ and I want to place this on the side bar
I just do not know where to place the hook, I am not to familiar with that part
Any help would be great
Thanks
Mike
sportsrant.com
I was able to get a hook in place but i now I am having another problem.
Right now I am getting my results, but if I use to cells within a row, the cells go outside the rows and cause the results to expand the cells
Can someone help me out here