Файл: who.php
Строк: 86
<?php
include 'inc/config.php';
include 'inc/func.php';
include 'inc/conn.php';
include 'inc/header.php';
include 'inc/ent.php';
include 'inc/zapros.php';
include 'inc/ban.php';
mysql_query("update `".prefix."users` set `mesto`='Смотрит онлайн', `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':
$timed = time();
$result=mysql_query("SELECT * FROM `".prefix."users` WHERE `online` > ($timed - 300)");
If (!$result){
echo 'Ошибка запроса к бд...<br/>';
}
$q = mysql_query("select * from `".prefix."users` where `online` > ($timed - 300);");
$reg=mysql_num_rows($q); // заменить
echo '<div class="menu1"><div class="menu3">Пользователей онлайн: '.$reg.'<br /></div></div>';
$n = 1;
while ($field=mysql_fetch_array($q))
{
## Зёбра =)
if(is_integer($n/2))
{echo '<div class="in"><div class="rek">';}
else
{echo '<div class="in"><div class="mes">';}
$n++;
##
echo ' <a href="info.php'.$_zapros.'user='.$field['login'].'">'.htmlspecialchars(stripslashes(trim($field['login']))).'</a> [<b>'.htmlspecialchars(stripslashes(trim($field['ua']))).'</b>] <a href="pm.php?mode=new&l='.$field['login'].'">[л/с]</a><br />';
#if (strtolower($field['login'])=='DemaN' $mesto='Секрет'; else $mesto=htmlspecialchars(stripslashes(trim($field['mesto'])));
echo '<b> '.htmlspecialchars(stripslashes(trim($field['mesto']))).'</b><br/>';
//If ($reg>1){echo '<div class="menu1"><div class="menu3" align="center">-----</div></div>';}
##
echo '</div></div>';
}
break;
case 'g':
echo '<div class="menu1"><div class="menu3">Гости сайта</div></div>';
$timed = time();
$g = mysql_query("select * from `online` where `time` > ($timed - 300);");
$guest=mysql_num_rows($g);
while ($fie=mysql_fetch_array($g))
{
## Зёбра =)
if(is_integer($i/2))
{echo '<div class="in"><div class="rek">';}
else
{echo '<div class="in"><div class="mes">';}
##
echo'<b>'.$fie['ua'].'</b> '.date("H:i:s",$fie['time']).'<br/>';
##
echo '</div></div>';
}
$gue=mysql_num_rows(mysql_query('SELECT id FROM `online`')); //замена
If($gue==0) echo '<b> Нет гостей</b>';
//echo '<b> Временно отключил :)</b>';
break;
}
*/
$timed = time();
$result=mysql_query("SELECT * FROM `".prefix."users` WHERE `online` > ($timed - 300)");
If (!$result){
echo 'Ошибка запроса к бд...<br/>';
}
$q = mysql_query("select * from `".prefix."users` where `online` > ($timed - 300);");
$reg=mysql_num_rows($q); // заменить
echo '<div class="menu1"><div class="menu3">Пользователей онлайн: '.$reg.'<br /></div></div>';
$n = 1;
while ($field=mysql_fetch_array($q))
{
## Зёбра =)
if(is_integer($n/2))
{echo '<div class="in"><div class="rek">';}
else
{echo '<div class="in"><div class="mes">';}
$n++;
##
echo ' <a href="info.php'.$_zapros.'user='.$field['login'].'">'.htmlspecialchars(stripslashes(trim($field['login']))).'</a> [<b>'.htmlspecialchars(stripslashes(trim($field['ua']))).'</b>] <a href="pm.php?mode=new&l='.$field['login'].'">[л/с]</a><br />';
#if (strtolower($field['login'])=='DemaN' $mesto='Секрет'; else $mesto=htmlspecialchars(stripslashes(trim($field['mesto'])));
echo '<b> '.htmlspecialchars(stripslashes(trim($field['mesto']))).'</b><br/>';
//If ($reg>1){echo '<div class="menu1"><div class="menu3" align="center">-----</div></div>';}
##
echo '</div></div>';
}
include 'inc/foot.php';
?>