Файл: 3/rating.php
Строк: 77
<?php
require_once ('system/func.php');
$title = 'Зал славы';
require_once ('system/header.php');
auth(); // Закроем от гостей
echo'<div class="lent mlra w80">
<div class="bl-ttl"><div class="te"><div class="ttl">
'.$title.'
</div></div></div>';
$set['p_str'] = 10;
$k_post = $db->query("SELECT * FROM `users` WHERE `id`>'3' LIMIT 100")->num_rows;
$k_page = k_page($k_post,$set['p_str']);
$page = page($k_page);
$start = $set['p_str']*$page-$set['p_str'];
$q = $db->query("SELECT * FROM `users` WHERE `id`>'3' ORDER BY `str`+`def`+`max_health`+`max_energy` DESC, `online` DESC LIMIT $start, $set[p_str]");
echo "<div class='block'>";
if($page == 1){
$n_1 = $db->query("SELECT * FROM `users` WHERE `id`>'3' ORDER BY `str`+`def`+`max_health`+`max_energy` DESC, `online` DESC LIMIT 1")->fetch_assoc();
echo ico('icons','dost.png')." <font color='yellow'><b>Самый сильный</b></font><div class='mb10'></div>";
echo "<div class='oh'><img src='/images/avatars/".(!empty($opponent['avatar'])?$opponent['avatar']:'noavatar.png')."' width='110px' style='margin-right:3px;margin-top:-2px;'/></div>";
$nik='<span style="text-shadow: 1px 0 10px #'.$n_1[gradient2].';">'.gradient(''.$n_1[login].'',''.$n_1[gradient1].'', ''.$n_1[gradient2].'').'</span>';
echo icons_user($n_1['id'])." <a>$nik</a><br><br>";
echo ico('icons','str.png')." Сила: $n_1[str]<br>";
echo ico('icons','def.png')." Защита: $n_1[def]<br>";
echo ico('icons','health.png')." Жизнь: $n_1[max_health]<br>";
echo ico('icons','energy.png')." Энергия: $n_1[max_energy]";
echo "<div style='clear:both;'></div><div class='mb10'></div>";
}
while($post = $q->fetch_assoc()) {
$i++;
if($i < 11){
if($myID == $post[id])echo "<div style='background-color: darkred;'>";
else echo "<div>";
$nik='<span style="text-shadow: 1px 0 10px #'.$post[gradient2].';">'.gradient(''.$post[login].'',''.$post[gradient1].'', ''.$post[gradient2].'').'</span>';
echo $i+$start.". ".icons_user($post[id])." <a href='/profile/$post[id]' data-ajax>$nik</a>, ".ico('icons','level.png')." $post[level]ур.<br>";
echo "Сумма: ".ico('icons','sum_stat.png')." ".($post['str']+$post['def']+$post['max_health']+$post['max_energy']);
echo "</div><div class='mb10'></div>";
}
}
if($k_post>10){
str('?',$k_page,$page); // Вывод страниц
}
echo "</div>";
$q = $db->query("SELECT * FROM `users` WHERE `id`>'3' ORDER BY `str`+`def`+`max_health`+`max_energy` DESC, `online` DESC");
while($post = $q->fetch_assoc()){
$a++;
if($post[id] == $myID){
if($a <= 100)echo "<div class='mb10'></div><div class='block'><span class='info'>Вы находитесь на <b>$a</b> месте в рейтинге!</span></div>";
else echo "<div class='mb10'></div><div class='block'>Вы не участвуете в рейтинге...</div>";
}
}
echo "</div>";
require_once ('system/footer.php');
?>