Файл: sys/fnc/online.php
Строк: 46
<?
function online($user=NULL)
{
global $set,$time;
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `user` WHERE `id` = '$user' AND `date_last` > '".(time()-600)."' LIMIT 1"),0)==1)
{
$ank=mysql_fetch_array(mysql_query("SELECT * FROM `user` WHERE `id` = $user LIMIT 1"));
if ($ank['group_access']>1 && $ank['group_access']<=7)
{
if ($ank['pol']==1) $mod='<img src="/style/user/man_mod.png" alt="" class="icon"/>';
else
$mod='<img src="/style/user/woman_mod.png" alt="" class="icon"/>';
echo "$mod";
}
else
if ($ank['group_access']>7)
{
if ($ank['pol']==1) $adm='<img src="/style/user/man_adm.png" alt="" class="icon"/>';
else
$adm='<img src="/style/user/woman_adm.png" alt="" class="icon"/>';
echo "$adm";
}
else
if(isset ($ank['status'])==0)
{
if ($ank['pol']==1) $on='<img src="/style/user/man_on.png" alt="" class="icon"/>';
else
$on='<img src="/style/user/woman_on.png" alt="" class="icon"/>';
echo "$on";
}
}
else
{
$ank=mysql_fetch_array(mysql_query("SELECT * FROM `user` WHERE `id` = $user LIMIT 1"));
if ($ank['pol']==1) return '<img src="/style/user/man_off.png" alt="" class="icon"/>';
else
return '<img src="/style/user/woman_off.png" alt="" class="icon"/>';
}
}
?>