Файл: system/who.php
Строк: 102
<?php
//session_name('im');
//session_start();
$_CONF['title']='Кто в клубе';
include '../header/config.inc.php';
include '../header/function.inc.php';
include '../header/header.inc.php';
include '../header/connect.inc.php';
include '../header/click-club.class.php';
include '../header/enter.inc.php';
include '../header/hellfish.inc.php';
include '../ban.php';
mysql_query("update `".prefix."users` set `mesto`='смотрит online', `online`='".time()."' where `id` = '".$_USER['id']."';");
If (!isset($_GET['mode']) || !ereg("^[a-z0-9_-]{1,15}$",$_GET['mode'])) $mode=false; else $mode=$_GET['mode'];
switch ($mode){
case 'u':
$time = time();
$result=mysql_query("SELECT * FROM `".prefix."users` WHERE `online` > ($time - 300)");
If (!$result){
echo 'Ошибка запроса к бд...<br/>';
}
$q = mysql_query("select * from `".prefix."users` where `online` > ($time - 300);");
$reg=mysql_num_rows($q);
echo"<div class='menuindex'>Пользователей онлайн: <b>".$reg."</b></div>";
while ($field=mysql_fetch_array($q)){
//// Скрываем юзеров в онлайн
if($field['login']=='admin') {$field['mesto']='Администрирует';}
//if($field['login']=='Krytim') {$field['mesto']='Модерирует';}
if($field['login']=='user') {$field['mesto']='Юзерит';}
echo'<div class="menuindexom">';
echo'<a href="/system/info.php'.$_zapros.'user='.$field['login'].'"><font color="#009900"><b>'.htmlspecialchars(stripslashes(trim($field['login']))).'</b></font></a>';
echo"<br/>Где: <font color='#990000'>".htmlspecialchars(stripslashes(trim($field['mesto'])))."</font>";
//echo"<br/>UserAgent: <font color='#999900'>".htmlspecialchars(stripslashes(trim($field['ua'])))."</font>";
//echo"<br/>IP- <font color='#99CC99'>".htmlspecialchars(stripslashes(trim($field['ip'])))."</font>";
echo"</div>";
}
break;
case 'g':
@mysql_query("update `".prefix."users` set `mesto`='смотрит онлайн', `online`='".time()."' where `id` = '".$_USER['id']."';");
print '<div class="menuindex">Гостей:</div>';
$time = time();
$g = mysql_query("select * from `online` where `time` > ($time - 300);");
$guest=mysql_num_rows($g);
while ($fie=mysql_fetch_array($g)){
echo'<div class="menuindexom">';
echo'<b>'.$fie['ua'].'</b> '.date("H:i:s",$fie['time']).'</div>';
}
$gue=mysql_num_rows(mysql_query('SELECT id FROM `online`'));
If($gue==0) echo '<div class="menuindex"> Нет гостей</div>';
break;
case 's':
mysql_query("update `".prefix."users` set `mesto`='Cмотрит онлайн за сутки', `online`='".time()."' where `id` = '".$_USER['id']."';");
print '<div class="menuindex">За сутки:</div>';
$time = time();
$s = mysql_query("select * from `".prefix."users` where `online` > ($time - 86400) ORDER BY `online` DESC;");
$seg=mysql_num_rows($s);
while ($fies=mysql_fetch_array($s)){
//if($fies['login']=='admin') {$fies['mesto']='Не знаю';}
echo'<div class="zag"><div class="menuindexom">';
echo'⇒ <a href="/system/info.php'.$_zapros.'user='.$fies['login'].'"><font color="#009900"><b>'.htmlspecialchars(stripslashes(trim($fies['login']))).'</b></font></a><br/>';
echo'⇒ <font color="#990000">'.date("d/H:i",$fies['online']).'</font><br/>';
If ($_enter && $_USER['admin']){
echo'⇒ <font color="#CCCCCC">'.htmlspecialchars(stripslashes(trim($fies['mesto']))).'</font><br/>';
}
echo'</div></div>';
}
break;
}
include "../header/end.inc.php";
If ($_enter)$_CONF['index_page']="enter.php".$_zapros;
?>