File size: 3.24Kb
<?php
$title='Кто онлайн';
require"../system/config.php";
require"../system/func.php";
require"../system/head.php";
require"../system/error.php";
echo'<div class="i">Онлайн<br></div>';
function gdefor($def){
$vis=$def;
return $vis;}
function whereip($ip){if(strpos($ip,'.')!==false){
$ip=explode(".",$ip);
$ip=$ip[0]*256*256*256+$ip[1]*256*256+$ip[2]*256+$ip[3];
}
$res=mysql_query("SELECT * FROM `ip` WHERE `min`<='$ip' AND `max`>='$ip' LIMIT 1");
if(mysql_num_rows($res)){
$m=mysql_fetch_array($res);
$ret=$m['oper'].'('.$m['country'].').';
}else{
$ret='Не определено';
}
return $ret;
}
switch($_GET['act']){
default:
$online=mysql_query("SELECT `id_user`, `gdeon`,`lip` FROM `users` WHERE `online`>'".(time()-120)."'");
$nasaj=mysql_num_rows($online);
echo'<div class="p">Пользователи сайта: '.$nasaj.'<br></div>';
if($nasaj!=0){
$vc=0;
while($naso=mysql_fetch_array($online)){$vc++;
echo'<div class="p"><b>'.$vc.'.</b> '.nik_tri($naso['id_user']).'<br>Инфo: '.whereip($naso['lip']).'<br>Находится: <a href="'.$naso['gdeon'].'">Тут</a>';}
echo'</div>';}
$guests=mysql_query("SELECT * FROM `online` WHERE `timer`>'".(time()-120)."'"); $gkol=mysql_num_rows($guests);
echo'<div class="p">Гости сайта: '.$gkol.'</div>';
if($gkol!=0){
$vcg=0;
while($guest=mysql_fetch_array($guests)){$vcg++;
echo'<div class="p"><b>'.$vcg.'.</b> IP: '.$guest['iper'].'<br>UA: '.$guest['uaer'].' <br>Информация: '.whereip($guest['iper']).'<br>Находится: <a href="'.$guest['query'].'">Тут</a></div>';}} break;
case'forum':
$onlinp=mysql_query("SELECT `id_user`, `gdeon` FROM `users` WHERE `gdeon` LIKE '/forum/%' AND `online`>'".(time()-120)."'");
$nasaj=mysql_num_rows($onlinp);
echo'<div class="p">Наших: '.$nasaj.'<br></div>';
if($nasaj!=0){
$vc=0;
while($naso=mysql_fetch_array($onlinp)){$vc++;
echo'<div class="p"><b>'.$vc.'.</b> Кто: '.nik_tri($naso['id_user']).'<br>Где: <a href="'.$naso['gdeon'].'">Перейти</a>'; echo'</div>';}
echo'</div>';}
$guesa=mysql_query("SELECT * FROM `online` WHERE `query` LIKE '/forum/%' AND `timer`>'".(time()-120)."'");
$gkol=mysql_num_rows($guesa);
echo'<div class="p">Гостей: '.$gkol.'</div>';
if($gkol!=0){
$vcg=0;
while($gues=mysql_fetch_array($guesa)){$vcg++;
echo'<div class="p"><b>'.$vcg.'.</b> IP: '.$gues['iper'].'<br>UA: '.$gues['uaer'].' <br>Где: <a href="'.$gues['query'].'">Перейти</a>'; echo'</div></div>';}}
break;
case'chat': $onl=mysql_result(mysql_query("SELECT COUNT(*) FROM `users` WHERE `gdeon` LIKE '/chat/%' AND `online`>'".(time()-120)."'"),0); echo'<div class="i">Кто в 4ate ['.$onl.']</div>'; $quere=mysql_query("SELECT `id_room`,`name` FROM `chat_room`");
while($da=mysql_fetch_array($quere)){ $onm=mysql_result(mysql_query("SELECT COUNT(*) FROM `users` WHERE `gdeon` LIKE '/chat/room.php?r=".$da['id_room']."%' AND `online`>'".(time()-120)."'"),0); echo'<br><b>'.$da['name'].'</b> ('.$onm.'): <br>'; $quera=mysql_query("SELECT
`id_user` FROM `users` WHERE `gdeon` LIKE '/chat/room.php?r=".$da['id_room']."%' AND `online`>'".(time()-120)."'");
while($de=mysql_fetch_array($quera)){ echo nik_tri($de['id_user']).',';}} echo'<div class="p"><a href="/chat/">Назад в чат</a></div>'; break; }
require"../system/foot.php";
?>