Файл: pages/users/index.php
Строк: 107
<?php
include '../../system/mysql.php';
include '../../system/sys_func.php';
switch ($_GET['menu']) {
default:
$title = 'Все пользователи';
include '../../system/head.php';
echo '<div class="title">Все пользователи</div>
<div class="post">
Все | <a href="?menu=online">Онлайн</a> | <a href="?menu=online_guests">Гости</a> | <a href="?menu=visitors">Посетители</a>
</div>';
$c_p = mysql_result(mysql_query("SELECT COUNT(*) FROM `users`"),0);
if (isset($user)) $p_page = $user['p_page'];
else $p_page = '10';
$k_page = k_page($c_p, $p_page);
$page = page($k_page);
$start = $p_page*$page-$p_page;
if ($c_p == 0) {
echo '<div class="post">
Нет пользователей!
</div>';
}
$q = mysql_query("SELECT * FROM `users` ORDER BY `id` DESC LIMIT $start, ". $p_page);
while ($ank = mysql_fetch_assoc($q)) {
echo '<a class="link" href="/pages/users/user.php?name='. $ank['login'] .'">
<span class="c_date">'. ptime($ank['time_last']) .'</span>
<table cellpadding="0" cellspacing="0">
<tr>
<td>';
avatar($ank['id'], 'b');
echo ' </td>
<td>';
echo online($ank['id']);
echo $ank['login'];
echo user($ank['id']);
echo '</td>
</tr>
</table>
</a>';
}
if ($k_page > 1)str('?', $k_page, $page);
include '../../system/foot.php';
break;
case 'online':
$title = 'Пользователи онлайн';
include '../../system/head.php';
echo '<div class="title">Пользователи онлайн</div>
<div class="post">
<a href="index.php">Все</a> | Онлайн | <a href="?menu=online_guests">Гости</a> | <a href="?menu=visitors">Посетители</a>
</div>';
$c_p = mysql_result(mysql_query("SELECT COUNT(*) FROM `users` WHERE `time_last` > '".(time()-600)."'"),0);
if (isset($user)) $p_page = $user['p_page'];
else $p_page = '10';
$k_page = k_page($c_p, $p_page);
$page = page($k_page);
$start = $p_page*$page-$p_page;
if ($c_p == 0) {
echo '<div class="post">
Нет пользователей!
</div>';
}
$q = mysql_query("SELECT * FROM `users` WHERE `time_last` > '".(time()-600)."' ORDER BY `time_last` DESC LIMIT $start, ". $p_page);
while ($ank = mysql_fetch_assoc($q)) {
echo '<a class="link" href="/pages/users/user.php?name='. $ank['login'] .'">
<span class="c_date">'. ptime($ank['time_last']) .'</span>
<table cellpadding="0" cellspacing="0">
<tr>
<td>';
avatar($ank['id'], 'b');
echo ' </td>
<td>';
echo online($ank['id']);
echo $ank['login'];
echo user($ank['id']);
echo '</td>
</tr>
</table>
</a>';
}
if ($k_page > 1)str('?menu=online&', $k_page, $page);
include '../../system/foot.php';
break;
case 'online_guests':
$title = 'Гости онлайн';
include '../../system/head.php';
echo '<div class="title">Онлайн гости</div>
<div class="post">
<a href="index.php">Все</a> | <a href="?menu=online">Онлайн</a> | Гости | <a href="?menu=visitors">Посетители</a>
</div>';
$c_p = mysql_result(mysql_query("SELECT COUNT(*) FROM `guests` WHERE `time` > '".(time()-600)."'"), 0);
if (isset($user)) $p_page = $user['p_page'];
else $p_page = '10';
$k_page = k_page($c_p, $p_page);
$page = page($k_page);
$start = $p_page*$page-$p_page;
if ($c_p == 0) {
echo '<div class="post">
Нет гостей!
</div>';
}
$q = mysql_query("SELECT * FROM `guests` WHERE `time` > '".(time()-600)."' ORDER BY `time` DESC LIMIT $start, ". $p_page);
while ($post = mysql_fetch_assoc($q)) {
$browser = strtok($post['browser'], '(');
echo '<div class="post">
<img src="/design/imgs/users/guest.png">
<span class="c_date">'. ptime($post['time']) .'</span>';
if (preg_match('#(YandexBot/3.0)#ui', $post['browser'])) {
echo '<b>YandexBot/3.0</b><br>';
} elseif (preg_match('#(Googlebot/2.1)#ui', $post['browser'])) {
echo '<b>Googlebot/2.1</b><br>';
} elseif (preg_match('#(Opera Mini)#ui', $post['browser'])) {
echo '<b>Opera Mini</b><br>';
} elseif (preg_match('#(Chrome/26.0)#ui', $post['browser'])) {
echo '<b>Chrome/26.0</b><br>';
} elseif (preg_match('#(Opera)#ui', $post['browser'])) {
echo '<b>Opera</b><br>';
} else {
echo '<b>'. $browser .'</b><br>';
}
echo 'IP: '. $post['ip'] .'
</div>';
}
if ($k_page > 1)str('?menu=online_guests&', $k_page, $page);
include '../../system/foot.php';
break;
case 'visitors':
$title = 'Посетители';
include '../../system/head.php';
echo '<div class="title">Посетители</div>
<div class="post">
<a href="index.php">Все</a> | <a href="?menu=online">Онлайн</a> | <a href="?menu=online_guests">Гости</a> | Посетители
</div>';
$c_p = mysql_result(mysql_query("SELECT COUNT(*) FROM `users` WHERE `time_last` > '". (time()-43200) ."'"), 0);
if (isset($user)) $p_page = $user['p_page'];
else $p_page = '10';
$k_page = k_page($c_p, $p_page);
$page = page($k_page);
$start = $p_page*$page-$p_page;
if ($c_p == 0) {
echo '<div class="post">
За последние 12 часов, посетителей небыло!
</div>';
}
$q = mysql_query("SELECT * FROM `users` WHERE `time_last` > '". (time()-43200) ."' ORDER BY `time_last` DESC LIMIT $start, ". $p_page);
while ($ank = mysql_fetch_assoc($q)) {
echo '<a class="link" href="/pages/users/user.php?name='. $ank['login'] .'">
<span class="c_date">'. ptime($ank['time_last']) .'</span>
<table cellpadding="0" cellspacing="0">
<tr>
<td>';
avatar($ank['id'], 'b');
echo ' </td>
<td>';
echo online($ank['id']);
echo $ank['login'];
echo user($ank['id']);
echo '</td>
</tr>
</table>
</a>';
}
if ($k_page > 1)str('?menu=visitors&', $k_page, $page);
include '../../system/foot.php';
break;
}
?>