Файл: Dvig/online.php
Строк: 13
<?php
####################
## Автор - USER-X ##
## Copyright 2013 ##
## xcms.mcdir.ru ##
####################
define( 'xcms_pro', 1 ) ;
include_once ( 'core/core.php' ) ;
$title='Онлайн';
include_once ( 'core/head.php' ) ;
######
switch($act){
case 'guest':
break;
default:
$time = time();
$guest = mysql_result(mysql_query("SELECT COUNT(*) FROM `online` where `time` > ($time-90)"), 0);
$avtoriz = mysql_result(mysql_query("SELECT COUNT(*) FROM `users` where `time` > ($time-90)"), 0);
echo'<div id="razd">В сети '.$guest.' / '.$avtoriz.'</div>';
$time = time();
$time = ($time-90);
$total = mysql_result(mysql_query("SELECT COUNT(`id`) FROM `users` WHERE `time`>'$time'"), 0);
$k_page=k_page($total,$set['p_str']);
$page=page($k_page);
$start=$set['p_str']*$page-$set['p_str'];
if($total){
$sel = mysql_query("SELECT * FROM `users` where `time`>$time order by `id` ASC LIMIT $start, $set[p_str]");
while ($res = mysql_fetch_array($sel)) {
echo'<a id="nav" href="/'.$res['id'].'"><img src="'.$host.'/avatar/small/'.$res['id'].'.png" width="35" height="35"/> '.$res['login'].'</a>';
}
if ($k_page>1)str('?',$k_page,$page); // Вывод страниц
}else{echo'<div id="body">В онлайне нет зарегистрированных юзеров</div>';}
}
include_once('core/foot.php');
?>