<?
define('PROTECTOR', 1);

$headmod = 'rating';//фикс. места

$textl='Зал Славы';
include('files/path.php');
include($path.'files/db.php');
include($path.'files/auth.php');
include($path.'files/func.php');
include($path.'files/core.php');
include($path.'files/head.php');
include($path.'files/zag.php');

if ($_GET[page] == "" || $_GET[page] < 0 || $_GET[page] == "0")
{
$_GET[page] = 0;
}
$next = $_GET[page] + 1;
$back = $_GET[page] - 1;
$num = $_GET[page] * 10;
if($_GET[page] == "0")
{$i = 1;}
else{$i = ($_GET[page]*10)+1;}
$viso = mysql_num_rows(mysql_query("SELECT usr FROM bazar"));
$puslap = floor($viso/10);

$b = mysql_query("SELECT usr,exp,lvl,storona FROM users WHERE exp >'0' ORDER BY exp DESC LIMIT $num,10");
$avto=mysql_num_rows($b);
if($_GET[page] == "0")
{$i = 1;}
else{$i = ($_GET[page]*10)+1;}
While($best = mysql_fetch_array($b))
{
echo"$i. <img src=\"/pic/main/$best[storona].png\"><a href=\"search.php?nick=$best[usr]&amp;go=go\">$best[usr]</a> [<img src=\"/pic/up.png\"><b>$best[lvl]</b>] - <b>$best[exp]</b> оп.<br/>";
$i++;
}

$b = mysql_query("SELECT usr,exp FROM users WHERE exp >'$udata[exp]'");
$avto=mysql_num_rows($b);
$reg = mysql_num_rows(mysql_query("SELECT `id` FROM `users`"));
$poz = $avto-$reg;
if($poz > 10){
echo'...<br/> '.$poz.'. <a href="search.php?nick='.$log.'&amp;go=go">'.$log.'</a> [<b>'.$udata[lvl].'</b> уровень]</br>'; }

if ($_GET[page] > 0)
{
echo "<a href=\"rating.php?page=$back\"> < Назад</a> ";
}

if($_GET[page] < $puslap || $_GET[page] == "" || $_GET[page] == 0)
{echo " <a href=\"rating.php?page=$next\">Далее ></a>";}




echo"<br/><a href=\"rating.php?\">На первую страницу</a>";


include($path.'files/down.php');
?>