<?

function online($user=NULL)

{

global $set,$time;



if (mysql_result(mysql_query("SELECT COUNT(*) FROM `user` WHERE `id` = '$user' AND `date_last` > '".(time()-2500)."' LIMIT 1"),0)==1)

{

$ank=mysql_fetch_array(mysql_query("SELECT * FROM `user` WHERE `id` = $user LIMIT 1"));


if ($ank['status_vip']>=1)echo "<img src='/vipi.gif'<br />"; 
if ($ank['status']==0)

{

if ($ank['pol']==1) $on='<img src="/img/online/man_on.gif" alt="" class="icon"/>';

else 

$on='<img src="/img/online/woman_on.gif" alt="" class="icon"/>';

}

else if ($ank['status']==1) $on='<img src="/img/online/gotov_boltat.png" alt="" class="icon"/>';

else if ($ank['status']==2) $on='<img src="/img/online/zaniat.png" alt="" class="icon"/>';

else if ($ank['status']==3) $on='<img src="/img/online/boleu.png" alt="" class="icon"/>';

else if ($ank['status']==4) $on='<img src="/img/online/depressia.png" alt="" class="icon"/>';

else if ($ank['status']==5) $on='<img src="/img/online/dumau.png" alt="" class="icon"/>';

else if ($ank['status']==6) $on='<img src="/img/online/kuru.png" alt="" class="icon"/>';

else if ($ank['status']==7) $on='<img src="/img/online/kushau.png" alt="" class="icon"/>';

else if ($ank['status']==8) $on='<img src="/img/online/love.png" alt="" class="icon"/>';

else if ($ank['status']==9) $on='<img src="/img/online/tv.png" alt="" class="icon"/>';

else if ($ank['status']==10) $on='<img src="/img/online/music.png" alt="" class="icon"/>';

else if ($ank['status']==11) $on='<img src="/img/online/vanna.png" alt="" class="icon"/>';

else if ($ank['status']==12) $on='<img src="/img/online/tualet.png" alt="" class="icon"/>';

else if ($ank['status']==13) $on='<img src="/img/online/sex.png" alt="" class="icon"/>';

else if ($ank['status']==14) $on='<img src="/img/online/igrau.png" alt="" class="icon"/>';

else if ($ank['status']==15) $on='<img src="/img/online/pivo.png" alt="" class="icon"/>';

else if ($ank['status']==16) $on='<img src="/img/online/sonni.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 $ank['aa2'] > 30 ? '<img src="/img/online/man_off.gif" alt="" class="icon"/><img src="/korona.gif" alt="korona" class="icon" />' : '<img src="/img/online/man_off.gif" alt="" class="icon"/>';

else 

return $ank['aa2'] > 30 ? '<img src="/img/online/woman_off.gif" alt="" class="icon"/><img src="/korona.gif" alt="korona" class="icon" />' : '<img src="/img/online/woman_off.gif" alt="" class="icon"/>';

}


if ($ank['aa2'] > 10){
    echo "<img src='/korona.gif' alt='korona' class='icon' />";
}
}

?>