Файл: vfermu.ru/sys/other/rating.php
Строк: 64
<?
$set['p_str']=20;
echo "<title>Игроки</title>";
echo "<div class='content'>";
echo "<div class='block'>";
if(isset($_GET['teh']))
{
$sort='tehnika';
$sort2='/teh';
}
if(isset($_GET['teh']))
{
$sort='tehnika';
$sort2='/mehanik';
}
elseif(isset($_GET['dost']))
{
$sort='dostig';
$sort2='/dost';
}
elseif(isset($_GET['arena_rate']))
{
$sort='arena_rating';
$sort2='/arena_rate';
}
elseif(isset($_GET['admin_money']))
{
$sort='money';
$sort2='/money';
}
elseif(isset($_GET['admin_rubies']))
{
$sort='rubies';
$sort2='/rubies';
}
elseif(isset($_GET['r_kazino']))
{
$sort='r_kazino';
$sort2='/r_kazino';
}
else
{
$sort='level';
$sort2=NULL;
}
$k_post = mysql_result(mysql_query("SELECT COUNT(*) FROM `farm_user`"),0);
if ($k_post==0)
{
echo "Список пуст...";
}
$k_page=k_page($k_post,$set['p_str']);
$page=page($k_page);
$start=$set['p_str']*$page-$set['p_str'];
$num=($page-1)*$set['p_str'];
$q=mysql_query("SELECT * FROM `farm_user` ORDER BY $sort DESC, rating DESC LIMIT $start, $set[p_str]");
echo "<li class='feedbackPanelINFO'><span class='feedbackPanelINFO'> <span class='title'>Вы находитесь на ".(mysql_result(mysql_query("SELECT COUNT(*) FROM `farm_user` WHERE ".($sort=='level'?"`rating`>'$ku[rating]'":"`$sort`>'$ku[$sort]' || (`$sort`='$ku[$sort]' && `rating`>'$ku[rating]')").""),0)+1)." месте</span><li class='ptm'></li>";
while($post=mysql_fetch_array($q))
{
$num++;
echo "<li><span class='minor'><span>$num.</span></span> <span>";
echo "".on_k($post['id'])."";
echo " <a class='' href='/user/$post[id]'>".nc($post['id'])."</a></span><span class='title'> $post[$sort]</span></li>";
}
echo "</ul><li class='pt'></li>";
if ($k_page>1)new_str("rating$sort2/",$k_page,$page); // Вывод страниц
echo "<h3>Рейтинг по:</h3>";
echo "<ul>";
echo "<li><img width='16' height='16' src='images/icons/rating.png' alt='o'> ".(isset($_GET['dost']) || isset($_GET['teh'])?"<a href='/rating'>Уровню</a>":"Уровню")."</li>";
echo "<li><img width='16' height='16' src='images/icons/rating.png' alt='o'> ".(!isset($_GET['r_kazino'])?"<a href='/rating/r_kazino'>Казино</a>":"Казино")."</li>";
echo "<li><img width='16' height='16' src='images/icons/rating.png' alt='o'> ".(!isset($_GET['teh'])?"<a href='/rating/teh'>Механизации</a>":"Механизации")."</li>";
echo "<li><img width='16' height='16' src='images/icons/rating.png' alt='o'> ".(!isset($_GET['dost'])?"<a href='/rating/dost'>Достижениям</a>":"Достижениям")."</li>";
echo "</ul>";
echo "</div>";
include_once'sys/other/foot.php';
?>