Файл: play/users_rating.php
Строк: 57
<?
require_once("../connect.php");
require_once("../core/page_ava.php");
$title = $title . ' : Лучшие по рейтингу';
$location = '(Смотрит nоп лучших по рейтингу)';
include ('../head.php');
echo '<div class="div">';
echo 'Топ лучших по рейтингу:';
echo '</div>';
if (@$u['setting_users_list'])
$count = $u['setting_users_list']; else
$count = 10;
$all = mysql_result(mysql_query("SELECT COUNT(*) FROM `users` WHERE `rating`"), 0);
if ($all > 0) {
$total = intval(($all - 1) / $count) + 1;
$page = num(@$_GET['page']);
if (empty($page) or $page < 0)
$page = 1;
if ($page > $total)
$page = $total;
$start = $page * $count - $count;
$result = mysql_query("SELECT * FROM `users` WHERE `rating` ORDER BY `rating` DESC LIMIT $start, $count");
while ($user = mysql_fetch_assoc($result)) {
echo $i % 2 ? '<div class="div">' : '<div class="div">';
echo '<table><tr><td VALIGN=top>';
page_ava($user['id'], 50);
echo '</td><td VALIGN=top>';
if ($user['delete'] == 1) {
echo '' . ico($user['sex'], $user['admin'], $user['online']) . ' <a href = "/page.php?id=' . $user['id'] . '"><del><b><font color="#79358c">' . $user['login'] . '</font></b></del></a>';
} else {
echo '' . ico($user['sex'], $user['admin'], $user['online']) . ' <a href = "/page.php?id=' . $user['id'] . '"><b><font color="#79358c">' . $user['login'] . '</font></b></a>';
}
# echo '' . medal($user['rating']) . '';
/*
if ($user['online'] > (time() - $system['online_time'])) {
echo '<font color="black">';
echo ' ' . $user['location'] . '';
echo '</font>';
}
*/
echo '<br />';
//~~~~~~~~~~~~~~~Высчитываю возвраст~~~~~~~~~~~~~~//
$e = date("Y");
$d = $user['anketa_byear'];
$qwe = $e - $d;
if ($qwe == $e) {
} else {
echo "Лет: $qwe<br />";
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
if ($user['anketa_city']) {
if ($user['anketa_byear']) {
echo ' ';
}
echo 'Город: ' . $user['anketa_city'] . '';
echo '<br />';
} else {
if ($user['anketa_byear']) {
}
}
if($u['id']){
if($user['id']!=$u['id']){
$req = mysql_query("SELECT*FROM `friends`WHERE `user` = '".$u['id']."' and friend = '".$user['id']."' LIMIT 1");
if(mysql_num_rows($req))
echo ' <a href = "/friends.php?act=delete&id='.$user
['id'].'">Удалить из друзей</a><br/>';
else
echo ' <a href = "/friends.php?act=adding&id='.$user['id'].'">Добавить в друзья</a><br/>';
}
if ($user['id'] != @$u['id']) {
echo '<a href="/mail.php?act=write&id='.$user['id'].'">Написать сообщение</a>';
}
}
echo '</table></div>';
$i++;
}
navigation($page, $total, 'users_rating.php?&');
} else {
echo '<div class="div"> Обитатилей не найдено !</div>';
}
echo '</div>';
include '../foot.php';
?>