Hey masters,
pls. anyone help.
i want to Show,
TOP 10 users ORDER by Points.
pls. give me full Code.
pls. anyone help.
i want to Show,
TOP 10 users ORDER by Points.
pls. give me full Code.
$q = @mysql_query("select * from `USERTABLE` order by points desc LIMIT 0, 10;");
while ($data = @mysql_fetch_array($q))
{
$did = $data['id'];
$user = $data['username'];
$point = $data['point'];
echo "$did - $user - $point<br />";
}
else if($action=="toponline")
{
addonline(getuid_sid($sid),"Top Online Users","lists.php?action=$action");
getshouts($sid);
boxstart("Top Onliners");
//////ALL LISTS SCRIPT <<
if($page=="" || $page<=0)$page=1;
$num_items = regmemcount(); //changable
$items_per_page= 10;
$num_pages = ceil($num_items/$items_per_page);
if(($page>$num_pages)&&$page!=1)$page= $num_pages;
$limit_start = ($page-1)*$items_per_page;
//changable sql
$sql = "SELECT id, name, tottimeonl, sex FROM ibwf_users ORDER BY tottimeonl DESC LIMIT $limit_start, $items_per_page";
echo "<p>";
$items = mysql_query($sql);
echo mysql_error();
if(mysql_num_rows($items)>0)
{
while ($item = mysql_fetch_array($items))
{
if($item[3]=='M'){
$atxt="<img src=\"images/male.gif\" alt=\"M\"/>";
}
else if($item[3]=='F'){
$atxt="<img src=\"images/female.gif\" alt=\"F\"/>";
}
$lnk = "$atxt<a href=\"index.php?action=viewuser&who=$item[0]&sid=$sid\">$item[1]</a> Online Time: $item[2] seconds = ".gettimemsg($item[2])."";
echo "$lnk<br/>";
}
}
echo "</p>";
echo "<p align=\"center\">";
if($page>1)
{
$ppage = $page-1;
echo "<a href=\"lists.php?action=$action&page=$ppage&sid=$sid&view=$view\">«PREV</a> ";
}
if($page<$num_pages)
{
$npage = $page+1;
echo "<a href=\"lists.php?action=$action&page=$npage&sid=$sid&view=$view\">Next»</a>";
}
echo "<br/>$page/$num_pages<br/>";
if($num_pages>2)
{
$rets = "Jump to page<form action=\"lists.php\" method=\"get\"><input id=\"inputText\" name=\"page\" format=\"*N\" size=\"3\"/>";
$rets .= "<input type=\"hidden\" name=\"action\" value=\"$action\"/>";
$rets .= "<input type=\"hidden\" name=\"sid\" value=\"$sid\"/>";
$rets .= "<input id=\"inputButton\" type=\"submit\" value=\"Go\"/></form>";
echo $rets;
}
echo "</p>";
////// UNTILL HERE >>
echo "<p align=\"center\">";
echo "<a href=\"index.php?action=stats&sid=$sid\">";
echo "Site Stats</a><br/>";
echo "</p>";
}
Comment