Файл: who.php
Строк: 73
<?php
error_reporting(0);
session_name('PHP');
session_start();
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=htmlspecialchars(mysql_real_escape_string(trim($_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']=='Klubv' OR $field['login']=='Admin') {
$field['mesto']='А вам это надо?';
}
/////////////////////////////////////////////
if ($field[pol]=="Мужской")
{
$img_pol='<img src="images/pol/m.png"/>';
}
if ($field[pol]=="Женский")
{
$img_pol='<img src="images/pol/j.png"/>';
}
echo'<div class="menuindexom">';
echo'<a href="info.php'.$_zapros.'user='.$field['login'].'"><font color="#009900">'.$img_pol.' <b>'.htmlspecialchars(stripslashes(trim($field['login']))).'</b></font></a>';
echo"<br/>Чем занят: [<font color='#778899'>".htmlspecialchars(stripslashes(trim($field['mesto'])))."</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;
}
include "header/end.inc.php";
If ($_enter)$_CONF['index_page']="enter.php".$_zapros;
?>