Файл: online.php
Строк: 52
<?php
require_once('core/start.php');
$title = 'Онлайн';
require_once(root.'core/header.php');
switch($do){
default:
echo '<div class="ot4">'.$title.'</div>';
echo '<div class="block"> <b>Свои</b></a> | <a href="?do=guests">Гости</a></div>';
$count = core::$dbs->querySingle("SELECT count(id) FROM `users` WHERE `onl` > ?",array(time()-$onl));
if($count==0){
err('Никого нет...');
}
$n = new pager($count,$end, '?');
$online = core::$dbs->query("SELECT * FROM `users` WHERE `onl` > ? order by `onl` desc limit $n->start,$end",array(time()-$onl));
while($on = $online->fetch()){
echo '<div class="block"><a href="/profile/'.$on['id'].'">'.us($on['id']).' ('.times($on['onl']).')</div>';
}
echo $n->pag();
break;
case guests:
echo '<div class="ot4">Гости</div>';
echo '<div class="block"><a href="online.html">Свои</a> | <b>Гости</b></div>';
$count = core::$dbs->querySingle("SELECT count(ip) FROM session WHERE date > ?",array(time()-300));
if($count==0){
err('Никого нет...','error');}
$n = new pager($count,$end, '?do=guests&');
$online = core::$dbs->query("SELECT * FROM session WHERE date > ? order by date desc limit $n->start,$end",array(time()-300));
while($on = $online->fetch()){
echo '<div class="block"> '.$on['ip'].' ('.times($on['date']).')<br/>'.$on['ua'].'</div>';
}
echo $n->pag();
break;
}
require_once(root.'core/footer.php');
?>