<?
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/user/on_1.gif" alt="" class="icon"/>';
else
$on='<img src="/style/user/on_0.gif" alt="" class="icon"/>';
}
if ($ank['group_access']==1)
{
if ($ank['pol']==1) $on='<img src="/style/user/on_1.gif" alt="" class="icon"/>';
else
$on='<img src="/style/user/on_0.gif" alt="" class="icon"/>';
}if ($ank['group_access']==2)
{
if ($ank['pol']==1) $on='<img src="/style/user/mod_on_1.gif" alt="" class="icon"/>';
else
$on='<img src="/style/user/mod_on_0.gif" alt="" class="icon"/>';
}if ($ank['group_access']==3)
{
if ($ank['pol']==1) $on='<img src="/style/user/mod_on_1.gif" alt="" class="icon"/>';
else
$on='<img src="/style/user/mod_on_0.gif" alt="" class="icon"/>';
}if ($ank['group_access']==4)
{
if ($ank['pol']==1) $on='<img src="/style/user/mod_on_1.gif" alt="" class="icon"/>';
else
$on='<img src="/style/user/mod_on_0.gif" alt="" class="icon"/>';
}if ($ank['group_access']==5)
{
if ($ank['pol']==1) $on='<img src="/style/user/on_1.gif" alt="" class="icon"/>';
else
$on='<img src="/style/user/on_0.gif" alt="" class="icon"/>';
}if ($ank['group_access']==6)
{
if ($ank['pol']==1) $on='<img src="/style/user/mod_on_1.gif" alt="" class="icon"/>';
else
$on='<img src="/style/user/mod_on_0.gif" alt="" class="icon"/>';
}if ($ank['group_access']==7)
{
if ($ank['pol']==1) $on='<img src="/style/user/mod_on_1.gif" alt="" class="icon"/>';
else
$on='<img src="/style/user/mod_on_0.gif" alt="" class="icon"/>';
}if ($ank['group_access']==8)
{
if ($ank['pol']==1) $on='<img src="/style/user/admin_1.gif" alt="" class="icon"/>';
else
$on='<img src="/style/user/admin_0.gif" alt="" class="icon"/>';
}if ($ank['group_access']==9)
{
if ($ank['pol']==1) $on='<img src="/style/user/admin_1.gif" alt="" class="icon"/>';
else
$on='<img src="/style/user/admin_0.gif" alt="" class="icon"/>';
}
else if ($ank['group_access']==15) $on='<img src="/style/user/admin.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/user/off_1.gif" alt="" class="icon"/>';
else
$off='<img src="/style/user/off_0.gif" alt="" class="icon"/>';
}
if ($ank['group_access']==1)
{
if ($ank['pol']==1) $off='<img src="/style/user/off_1.gif" alt="" class="icon"/>';
else
$off='<img src="/style/user/off_0.gif" alt="" class="icon"/>';
}
if ($ank['group_access']==2)
{
if ($ank['pol']==1) $off='<img src="/style/user/off_1.gif" alt="" class="icon"/>';
else
$off='<img src="/style/user/off_0.gif" alt="" class="icon"/>';
}
if ($ank['group_access']==3)
{
if ($ank['pol']==1) $off='<img src="/style/user/off_1.gif" alt="" class="icon"/>';
else
$off='<img src="/style/user/off_0.gif" alt="" class="icon"/>';
}
if ($ank['group_access']==4)
{
if ($ank['pol']==1) $off='<img src="/style/user/off_1.gif" alt="" class="icon"/>';
else
$off='<img src="/style/user/off_0.gif" alt="" class="icon"/>';
}
if ($ank['group_access']==5)
{
if ($ank['pol']==1) $off='<img src="/style/user/mod_off_1.gif" alt="" class="icon"/>';
else
$off='<img src="/style/user/mod_off_0.gif" alt="" class="icon"/>';
}
if ($ank['group_access']==6)
{
if ($ank['pol']==1) $off='<img src="/style/user/mod_off_1.gif" alt="" class="icon"/>';
else
$off='<img src="/style/user/mod_off_0.gif" alt="" class="icon"/>';
}
if ($ank['group_access']==7)
{
if ($ank['pol']==1) $off='<img src="/style/user/mod_off_1.gif" alt="" class="icon"/>';
else
$off='<img src="/style/user/mod_off_0.gif" alt="" class="icon"/>';
}
if ($ank['group_access']==8)
{
if ($ank['pol']==1) $off='<img src="/style/user/admin_1.gif" alt="" class="icon"/>';
else
$off='<img src="/style/user/admin_0.gif" alt="" class="icon"/>';
}
if ($ank['group_access']==9)
{
if ($ank['pol']==1) $off='<img src="/style/user/mod_off_1.gif" alt="" class="icon"/>';
else
$off='<img src="/style/user/mod_off_0.gif" alt="" class="icon"/>';
}
if ($ank['group_access']==15)
{
if ($ank['pol']==1) $off='<img src="/style/user/admin.png" alt="" class="icon"/>';
}
echo''.$off.'';
}
}

?>