PHP Code:
/////////////////////////////////////////Statutus trivia put tihs in core
function trivia($uid)
{
$info= mysql_fetch_array(mysql_query("SELECT trivia, sex FROM lib3rtymrc_users WHERE id='".$uid."'"));
if(isbanned($uid))
{
return "Banat(a)!";
}
if($info[0]<1000)
{
return "Left";
}else if($info[0]<5000)
{
return "Beginner";
}else if($info[0]<10000)
{
return "Amateur";
}else if($info[0]<15000)
{
return "advanced";
}else if($info[0]<40000)
{
return "good";
}else if($info[0]<70000)
{
return "very good";
}else if($info[0]<80000)
{
return " Super Advanced";
}else
{
return "Genius";
}
}
PHP Code:
////////////////////tihis in profil
echo "<small>Rang Trivia: <a href=\"trivia.php?actiune=top&sid=$sid\"><b>".trivia($who)."</b></a></small><br/>";
PHP Code:
//////////////////// end tihs in trivia.php
//////////////////////////////////Top Trivia
else if($actiune=="top")
{
addonline(getuid_sid($sid),"Vizualizeaza Top Trivia","trivia.php?actiune=$actiune&wap=$r");
echo "<card id=\"main\" title=\"Top Trivia\">";
echo "<p align=\"center\">";
echo "<b>Top Trivia</b>";
echo "</p>";
//////ALL LISTS SCRIPT <<
if($page=="" || $page<=0)$page=1;
$num_items = regmemcount(); //changable
$items_per_page= 20;
$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, trivia FROM lib3rtymrc_users ORDER BY trivia DESC LIMIT $limit_start, $items_per_page";
echo "<p>";
$items = mysql_query($sql);
//$cou =1;
$cou = $limit_start;
echo mysql_error();
if(mysql_num_rows($items)>0)
{
while ($item = mysql_fetch_array($items))
{
$cou++;
$simbol = getsimbol($item[0]);
$lnk = "<small><b>Locul $cou :</b> <a href=\"profil.php?who=$item[0]&sid=$sid\"> $simbol$item[1]</a> - $item[2] puncte <br/>".trivia($item[0])."</small>";
echo "$lnk<br/>";
echo "----<br/>";
}
}
echo "</p>";
echo "<p align=\"left\">";
if($page>1)
{
$ppage = $page-1;
echo "<small><a href=\"trivia.php?actiune=top&page=$ppage&sid=$sid&view=$view\">pagina anterioara</a></small><br/> ";
}
if($page<$num_pages)
{
$npage = $page+1;
echo "<small><a href=\"trivia.php?actiune=top&page=$npage&sid=$sid&view=$view\">pagina urmatoare</a></small>";
}
echo "<br/>$page din $num_pages<br/>";
if($num_pages>2)
{
$rets = "Du-te la pagina:<input name=\"pg\" format=\"*N\" size=\"3\"/>";
$rets .= "<anchor>[du-te]";
$rets .= "<go href=\"trivia.php\" method=\"get\">";
$rets .= "<postfield name=\"actiune\" value=\"$actiune\"/>";
$rets .= "<postfield name=\"sid\" value=\"$sid\"/>";
$rets .= "<postfield name=\"page\" value=\"$(pg)\"/>";
$rets .= "</go></anchor>";
echo $rets;
}
echo "</p>";
Comment