Файл: sys/fnc/online2.php
Строк: 18
<?
function online2($user=NULL)
{
global $set,$time;
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `ban` WHERE `id_user` = '$user' AND `time` > '$time'"), 0)!=0)
return '<img src="/style/2.gif" alt=""/>';
elseif (mysql_result(mysql_query("SELECT COUNT(*) FROM `user` WHERE `id` = '$user' AND `date_last` > '".(time()-600)."' LIMIT 1"),0)==1)
{
if ($set['show_away']==0)$on='On';
else
{
$ank=mysql_fetch_array(mysql_query("SELECT `date_last` FROM `user` WHERE `id` = '$user' LIMIT 1"));
if ((time()-$ank['date_last'])==0)
$on='online';
else
$on='away: '.(time()-$ank['date_last']).' сек';
}
////////////////////////////
$adm = mysql_fetch_array(mysql_query("SELECT `pol`,`balls`,`rating` from `user` where `id`='$user' limit 1;"));
if ($adm['pol']==0 ){echo "<img src='/style/1.gif' alt=''/>";
}else
if ($adm['pol']==1){echo "<img src='/style/1.gif' alt=''/>";
}
}
else{
$adm = mysql_fetch_array(mysql_query("SELECT `pol`,`balls`,`rating` from `user` where `id`='$user' limit 1;"));
if ($adm['pol']==0 ){echo "<img src='/style/2.gif' alt=''/>";
}else
if ($adm['pol']==1){echo "<img src='/style/2.gif' alt=''/>";
}
}
}
?>