Файл: vkollektive2014/users.php
Строк: 260
<?
include 'connect.php';
$location = '(В пользователях)';
if(!$u['id']){
header ("Location: /registration.php?err=1");
exit;
}
$title = $title.' | Пользователи';
include 'head.php';
# include 'core/page_ava.php';
include 'core/ava_min.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">';
ava_k($user['id'],30);
if(ban($user['id'])){
echo ' '.ico($user['sex'],$user['admin']).' <a href = "/page.php?id='.$user['id'].'"><del>'.$user['login'].'</del></a> '.online($user['online']).'';
} else {
echo ' '.ico($user['sex'],$user['admin']).' <a href = "/page.php?id='.$user['id'].'">'.$user['login'].'</a> '.online($user['online']).'';
}
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";
$vip = mysql_fetch_array(mysql_query("SELECT * FROM `vip_users` WHERE `id_user` = '".$user['id']."'"));
if((int)$vip['id'] > 0){ echo " <img src='/style/vip_icons/{$vip['icon']}.gif' />n"; }
if ($user['strana']==0)echo "n";
if ($user['strana']==1)echo "<img src='/style/strana/ru.png'>n";
if ($user['strana']==2)echo "<img src='/style/strana/ua.png'>n";
if ($user['strana']==3)echo "<img src='/style/strana/by.png'>n";
if ($user['strana']==4)echo "<img src='/style/strana/az.png'>n";
if ($user['strana']==5)echo "<img src='/style/strana/kz.png'>n";
if ($user['strana']==6)echo "<img src='/style/strana/uz.png'>n";
if ($user['strana']==7)echo "<img src='/style/strana/england.png'>n";
if ($user['strana']==8)echo "<img src='/style/strana/de.png'>n";
###
if($u['id']){
if($user['id'] != $u['id']){
echo'<div class="right"><a href = "mail.php?act=write&id='.$user['id'].'"><img src="/ico/mail.png" alt="Написать сообщение"></a></div>';
}}
###
echo '<br/>';
/*
if($u['id']){
if($user['id'] != $u['id']){
echo '<a href = "mail.php?act=write&id='.$user['id'].'">Сообщение</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'].'">Убрать из друзей</a><br/>';
else
echo '<a href = "friends.php?act=adding&id='.$user['id'].'">Добавить в друзья</a><br/>';
}
}
*/
echo '</div>';
$i++;
}
# echo '<div class="nav">';
if ($page != $total) {
# echo '<a name="page-down" style="float: right; text-decoration: none;" href="#page-up"><img src = "ico/page_up.png">Вверх</a></div>';
}
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>';
echo '</div>';
navigation($page, $total,'users.php?online='.$online.'&sort='.$sort.'&');
}else{
echo '<div class="div"> Пользователей не найдено !</div>';
}
echo '</div>';
include 'foot.php';
?>