<?

////Модификация DCMS 6.6.4 by Kyber\\\\
////Специально для  сети klybok.net\\\\
////Распространение бесплатное FREE\\\\
////Запрещено присваивать мод права\\\\
////Безопасные моды на-> klybok.net\\\\
////Автор CMS Desure | MOD by Kyber\\\\

include_once 'sys/inc/start.php';
include_once 'sys/inc/compress.php';
include_once 'sys/inc/sess.php';
include_once 'sys/inc/home.php';
include_once 'sys/inc/settings.php';
include_once 'sys/inc/db_connect.php';
include_once 'sys/inc/ipua.php';
include_once 'sys/inc/fnc.php';
include_once 'sys/inc/user.php';
$set['title']='Гости онлайн';
include_once 'sys/inc/thead.php';

title();
aut();

$k_post=mysql_result(mysql_query("SELECT COUNT(*) FROM `guests` WHERE `date_last` > '".(time()-600)."' 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()-600)."' AND `pereh` > '0' ORDER BY `date_aut` DESC LIMIT $start, $set[p_str]");
echo "<table class='post'>\n";
if ($k_post==0){
echo "<tr><td class='p_t'>Сейчас никого нету</td></tr>\n";
}
while ($guest = mysql_fetch_assoc($q))
{
echo "<tr>\n";
if ($set['set_show_icon']==2){
echo "<td class='icon48' rowspan='2'><img src='/style/themes/$set[set_them]/guest.png' alt='' /></td>";
}
echo "<td class='p_t'>Гость</td></tr><tr><td class='p_m'>\n";
echo "<span class=\"ank_n\">Посл. посещение:</span> <span class=\"ank_d\">".vremja($guest['date_last'])."</span><br />\n";
echo "<span class=\"ank_n\">Переходов:</span> <span class=\"ank_d\">$guest[pereh]</span><br />\n";
if ($guest['ua']!=NULL)echo "<span class=\"ank_n\">UA:</span> <span class=\"ank_d\">$guest[ua]</span><br />\n";

if (isset($user) && ($user['level']>0)){
if (user_access('guest_show_ip') && $guest['ip']!=0)echo "<span class=\"ank_n\">IP:</span> <span class=\"ank_d\">".long2ip($guest['ip'])."</span><br />\n";
if (user_access('guest_show_ip') && opsos($guest['ip']))echo "<span class=\"ank_n\">Пров:</span> <span class=\"ank_d\">".opsos($guest['ip'])."</span><br />\n";
if (otkuda($guest['url']))echo "<span class=\"ank_n\">URL:</span> <span class=\"ank_d\"><a href='$guest[url]'>".otkuda($guest['url'])."</a></span><br />\n";
}
echo "</td></tr>\n";
}
echo "</table>\n";
if ($k_page>1)str("?",$k_page,$page); // Вывод страниц
include_once 'sys/inc/tfoot.php';
?>