Файл: archive/www/musimka.ru/users.php
Строк: 184
<?
require('connect.php');
require('core/ava_min.php');
$title = $title.' | Пользователи';
require('head.php');
if(!$u['id']){ header ("Location: login.php?");}
$online = num($_GET['online']);
if($online) echo '<div class="title"><img src = "ico/10.gif"> Пользователи онлайн</div>';
else
echo '<div class="title"><img src="ico/users.png"> Пользователи</div>';
if($online)
$onlineq = "WHERE `online` > '".(time()-$system['online_time'])."'";
else
$onlineq = '';
if($u['setting_users_list']) $count = $u['setting_users_list']; else $count = 10;
$all = mysql_result(mysql_query("SELECT COUNT(*) FROM `users` $onlineq"), 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;
echo '<div class="nav">';
if ($page != $total) {
echo '<a name="page-up" style="float: right; text-decoration: none;" href="#page-down"><img src = "ico/page_down.png"></a>';
}
echo ' Сортировка: <br/>';
$sort = check($_GET['sort']);
if($sort == 'time') {
$sortq = '`anketa_datareg`';
echo '<a href = "users.php?online='.$online.'&sort=rating&page='.$page.'">Популярность</a> | <a href = "users.php?online='.$online.'&sort=likes&page='.$page.'">Привлекательность</a> | <a href = "users.php?online='.$online.'&sort=money&page='.$page.'">Богатство</a> | <b>Новые</b>';
}
if($sort == 'likes') {
$sortq = '`likes`';
echo '<a href = "users.php?online='.$online.'&sort=rating&page='.$page.'">Популярность</a> | <b>Привлекательность</b> | <a href = "users.php?online='.$online.'&sort=money&page='.$page.'">Богатство</a> | <a href = "users.php?online='.$online.'&sort=time&page='.$page.'">Новые</a>';
}
if($sort == 'money') {
$sortq = '`money`';
echo '<a href = "users.php?online='.$online.'&sort=rating&page='.$page.'">Популярность</a> | <a href = "users.php?online='.$online.'&sort=likes&page='.$page.'">Привлекательность</a> | <b>Богатство</b> | <a href = "users.php?online='.$online.'&sort=time&page='.$page.'">Новые</a>';
}
if($sort == 'rating' || empty($sortq)) {
$sort = 'rating';
$sortq = '`rating`';
echo '<b>Популярность</b> | <a href = "users.php?online='.$online.'&sort=likes&page='.$page.'">Привлекательность</a> | <a href = "users.php?online='.$online.'&sort=money&page='.$page.'">Богатство</a> | <a href = "users.php?online='.$online.'&sort=time&page='.$page.'">Новые</a>';
}
echo '</div>';
$result = mysql_query("SELECT * FROM `users` $onlineq ORDER BY $sortq DESC LIMIT $start, $count");
while($user = mysql_fetch_assoc($result)){
echo $i % 2 ? '<div class="div">' : '<div class="div">';
echo '<table>
<tr>
<td>';
ava_k($user['id'],50);
echo '</td>
<td VALIGN=top>';
if(ban($user['id'])){
echo '<a href = "/'.$user['id'].'"><del>'. ico($user['sex'],$user['admin']) .' <b>'; echo GradientText("$user[login]", "$user[ncolor]", "$user[ncolor2]"); echo '</b> '. online($user['online']) .'</del></a>';
} else {
echo '<a href = "/'.$user['id'].'">'. ico($user['sex'],$user['admin']) .' '; echo GradientText("$user[login]", "$user[ncolor]", "$user[ncolor2]"); echo ' '. online($user['online']) .'</a>';
}
if($user['rating']>=1000 && $user['rating']<=1999)echo "<img src='ico/b.png' alt='' class='icon'</a>n";
if($user['rating']>=2000 && $user['rating']<=2999)echo "<img src='ico/s.png' alt='' class='icon'</a>n";
if($user['rating']>=3000)echo "<img src='ico/z.png' alt='' class='icon'</a>n";
if($ank['money']>=500 && $ank['money']<=1000){echo "<img src='style/zol.png'>n";} if($user['money']>=250 && $user['money']<=499){echo "<img src='style/silver.png'>n";} if($user['money']>=500 && $user['money']<=3088888888888888888000){echo "<img src='style/zol.png'>n";}
if($user['id'] == 1) { echo ' </br>Браузер: Opera by Admin</br>'; }else{ $ip = $user[ip]; $ua = $user[ua]; echo '</br><img src="http://delowap.ru/icon/ico23/publish.png"> Браузер: '.$ua.'</br>';}
if($u['id']){
if($user['id'] != $u['id']){
echo '<a href = "mail.php?act=write&id='.$user['id'].'"><img src="nov/mail.gif"> Сообщение</a><br/>';
$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'].'"><img src = "nov/harem.gif"> Убрать из друзей</a><br/>';
else
echo '<a href = "friends.php?act=adding&id='.$user['id'].'"><img src = "nov/harem.gif"> Добавить в друзья</a><br/>';
}
}
echo '</td>
</tr>
</table>';
echo '</div>';
echo '</div>';
$i++;
}
if ($page != $total) {
echo '<a name="page-down" style="float: right; text-decoration: none;" href="#page-up"><img src = "ico/page_up.png"></a>';
}
if($sort == 'time') {
$sortq = '`anketa_datareg`';
}
if($sort == 'likes') {
$sortq = '`likes`';
}
if($sort == 'money') {
$sortq = '`money`';
}
if($sort == 'rating' || empty($sortq)) {
$sort = 'rating';
$sortq = '`rating`';
}
echo '</div>';
echo '</div>';
navigation($page, $total,'users.php?online='.$online.'&sort='.$sort.'&');
}else{
echo '<div class="div"> Пользователей не найдено !</div>';
}
echo '</div>';
require('foot.php');
?>