Файл: sys/fnc/online.php
Строк: 254
<?
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']==0) //Гость
{
if ($ank['pol']==1) $on='<img src="/style/icons/user/man.user.on.png" alt="" class="icon"/>';
else
$on='<img src="/style/icons/user/girl.user.on.png" alt="" class="icon"/>';
}
if ($ank['group_access']==1) //Пользователь
{
if ($ank['pol']==1) $on='<img src="/style/icons/user/man.user.on.png" alt="" class="icon"/>';
else
$on='<img src="/style/icons/user/girl.user.on.png" alt="" class="icon"/>';
}
if ($ank['group_access']==2) //Модератор чата
{
if ($ank['pol']==1) $on='<img src="/style/icons/user/man.moder.on.png" alt="" class="icon"/>';
else
$on='<img src="/style/icons/user/girl.moder.on.png" alt="" class="icon"/>';
}
if ($ank['group_access']==3) //Модератор форума
{
if ($ank['pol']==1) $on='<img src="/style/icons/user/man.moder.on.png" alt="" class="icon"/>';
else
$on='<img src="/style/icons/user/girl.user.on.png" alt="" class="icon"/>';
}
if ($ank['group_access']==4) //Модератор загруз-центра
{
if ($ank['pol']==1) $on='<img src="/style/icons/user/man.moder.on.png" alt="" class="icon"/>';
else
$on='<img src="/style/icons/user/girl.user.on.png" alt="" class="icon"/>';
}
if ($ank['group_access']==5) //Модератор библиотека
{
if ($ank['pol']==1) $on='<img src="/style/icons/user/man.moder.on.png" alt="" class="icon"/>';
else
$on='<img src="/style/icons/user/girl.user.on.png" alt="" class="icon"/>';
}
if ($ank['group_access']==6) //Модератор Фотогалереи
{
if ($ank['pol']==1) $on='<img src="/style/icons/user/man.moder.on.png" alt="" class="icon"/>';
else
$on='<img src="/style/icons/user/girl.user.on.png" alt="" class="icon"/>';
}
if ($ank['group_access']==7) //Главный модератор
{
if ($ank['pol']==1) $on='<img src="/style/icons/user/man.moder.on.png" alt="" class="icon"/>';
else
$on='<img src="/style/icons/user/girl.user.on.png" alt="" class="icon"/>';
}
if ($ank['group_access']==8) //Администратор
{
if ($ank['pol']==1) $on='<img src="/style/icons/user/man.admin.on.png" alt="" class="icon"/>';
else
$on='<img src="/style/icons/user/girl.admin.on.png" alt="" class="icon"/>';
}
if ($ank['group_access']==9) //Главный администратор
{
if ($ank['pol']==1) $on='<img src="/style/icons/user/man.admin.on.png" alt="" class="icon"/>';
else
$on='<img src="/style/icons/user/girl.admin.on.png" alt="" class="icon"/>';
}
if ($ank['group_access']==15) //Создатель
{
if ($ank['pol']==1) $on='<img src="/style/icons/user/man.boss.on.png" alt="" class="icon"/>';
else
$on='<img src="/style/icons/user/girl.boss.on.png" alt="" class="icon"/>';
}
echo "".$on."";
}
else
{
$ank=mysql_fetch_array(mysql_query("SELECT * FROM `user` WHERE `id` = $user LIMIT 1"));
if ($ank['group_access']==0)
{
if ($ank['pol']==1) $off='<img src="/style/icons/user/man.user.off.png" alt="" class="icon"/>';
else
$off='<img src="/style/icons/user/girl.user.off.png" alt="" class="icon"/>';
}
if ($ank['group_access']==1)
{
if ($ank['pol']==1) $off='<img src="/style/icons/user/man.user.off.png" alt="" class="icon"/>';
else
$off='<img src="/style/icons/user/girl.user.off.png" alt="" class="icon"/>';
}
if ($ank['group_access']==2)
{
if ($ank['pol']==1) $off='<img src="/style/icons/user/man.user.off.png" alt="" class="icon"/>';
else
$off='<img src="/style/icons/user/girl.user.off.png" alt="" class="icon"/>';
}
if ($ank['group_access']==3)
{
if ($ank['pol']==1) $off='<img src="/style/icons/user/man.user.off.png" alt="" class="icon"/>';
else
$off='<img src="/style/icons/user/girl.user.off.png" alt="" class="icon"/>';
}
if ($ank['group_access']==4)
{
if ($ank['pol']==1) $off='<img src="/style/icons/user/man.user.off.png" alt="" class="icon"/>';
else
$off='<img src="/style/icons/user/girl.user.off.png" alt="" class="icon"/>';
}
if ($ank['group_access']==5)
{
if ($ank['pol']==1) $off='<img src="/style/icons/user/man.user.off.png" alt="" class="icon"/>';
else
$off='<img src="/style/icons/user/girl.user.off.png" alt="" class="icon"/>';
}
if ($ank['group_access']==6)
{
if ($ank['pol']==1) $off='<img src="/style/icons/user/man.user.off.png" alt="" class="icon"/>';
else
$off='<img src="/style/icons/user/girl.user.off.png" alt="" class="icon"/>';
}
if ($ank['group_access']==7)
{
if ($ank['pol']==1) $off='<img src="/style/icons/user/man.user.off.png" alt="" class="icon"/>';
else
$off='<img src="/style/icons/user/girl.user.off.png" alt="" class="icon"/>';
}
if ($ank['group_access']==8)
{
if ($ank['pol']==1) $off='<img src="/style/icons/user/man.user.off.png" alt="" class="icon"/>';
else
$off='<img src="/style/icons/user/girl.user.off.png" alt="" class="icon"/>';
}
if ($ank['group_access']==9)
{
if ($ank['pol']==1) $off='<img src="/style/icons/user/man.user.off.png" alt="" class="icon"/>';
else
$off='<img src="/style/icons/user/girl.user.off.png" alt="" class="icon"/>';
}
if ($ank['group_access']==15)
{
if ($ank['pol']==1) $off='<img src="/style/icons/user/man.user.off.png" alt="" class="icon"/>';
else
$off='<img src="/style/icons/user/girl.user.off.png" alt="" class="icon"/>';
}
echo''.$off.'';
}
}
?>