Файл: user/inc/online_guest.php
Строк: 32
<?php
only_reg();
$set['title'] = 'Гости на сайте';
$k_post = mysql_result(mysql_query("SELECT COUNT(*) FROM `guests` WHERE `date_last` > '" . (time() - $set['user_online']) . "' AND `pereh` > '0'"), 0);
$k_page = k_page($k_post, $set['p_str']);
$page = page($k_page);
$start = $set['p_str'] * $page - $set['p_str'];
$q = mysql_query("SELECT * FROM `guests` WHERE `date_last` > '" . (time() - $set['user_online']) . "' AND `pereh` > '0' ORDER BY `date_aut` DESC LIMIT $start, $set[p_str]");
if ($k_post == 0) {
echo "<div class='list-group-item'>";
echo "<span class='fa fa-info-circle fa-fw'></span> " . lang('Нет гостей на сайте');
echo "</div>";
}
while ($guest = mysql_fetch_assoc($q)) {
echo "<div class='list-group-item'>";
echo lang('Посл. посещение') . ": <span style='color:grey;' title='" . date::time($guest['date_last']) . "'>" . date::times($guest['date_last']) . "</span><br />n";
echo lang('Переходов') . ": <span style='color:grey;'>$guest[pereh]</span><br />n";
if ($guest['ua'] != NULL) {
echo "UA: <span style='color:grey;'>$guest[ua]</span><br />n";
}
if (isset($user) && $user['level'] > 0) {
if (user_access('guest_show_ip') && $guest['ip'] != 0) {
echo "IP: <span style='color:grey;'>" . long2ip($guest['ip']) . "</span><br />n";
}
if (user_access('guest_show_ip') && opsos($guest['ip'])) {
echo "" . lang('Пров') . ": <span style='color:grey;'>" . opsos($guest['ip']) . "</span><br />n";
}
if (otkuda($guest['url'])) {
echo "URL: <span style='color:grey;'><a href='$guest[url]'>" . otkuda($guest['url']) . "</a></span><br />n";
}
}
echo "</div>";
}
if ($k_page > 1) {
str("?", $k_page, $page);
}