<?
function online($user=NULL)
{
global $set,$time;

if (mysql_result(mysql_query("SELECT COUNT(*) FROM `user` WHERE `id` = '$user' AND `date_last` > '".(time()-900)."' LIMIT 1"),0)==1)
{
$ank=mysql_fetch_array(mysql_query("SELECT * FROM `user` WHERE `id` = $user LIMIT 1"));
if ($ank['show_secret']==0)
{
if ($ank['status']==0)
{
if ($ank['pol']==1) $on='<img src="/style/user/boy_on.png" width="14" height="14" alt="" class="icon"/>';
else 
$on='<img src="/style/user/girl_on.png" width="14" height="14" alt="" class="icon"/>';
}
else if ($ank['status']==1) $on='<img src="/style/status/gotov_boltat.png" width="14" height="14" alt="" class="icon"/>';
else if ($ank['status']==2) $on='<img src="/style/status/zaniat.png" width="14" height="14" alt="" class="icon"/>';
else if ($ank['status']==3) $on='<img src="/style/status/boleu.png" width="14" height="14" alt="" class="icon"/>';
else if ($ank['status']==4) $on='<img src="/style/status/depressia.png" width="14" height="14" alt="" class="icon"/>';
else if ($ank['status']==5) $on='<img src="/style/status/dumau.png" width="14" height="14" alt="" class="icon"/>';
else if ($ank['status']==6) $on='<img src="/style/status/kuru.png" width="14" height="14" alt="" class="icon"/>';
else if ($ank['status']==7) $on='<img src="/style/status/kushau.png" width="14" height="14" alt="" class="icon"/>';
else if ($ank['status']==8) $on='<img src="/style/status/love.png" width="14" height="14" alt="" class="icon"/>';
else if ($ank['status']==9) $on='<img src="/style/status/tv.png" width="14" height="14" alt="" class="icon"/>';
else if ($ank['status']==10) $on='<img src="/style/status/music.png" width="14" height="14" alt="" class="icon"/>';
else if ($ank['status']==11) $on='<img src="/style/status/vanna.png" width="14" height="14" alt="" class="icon"/>';
else if ($ank['status']==12) $on='<img src="/style/status/tualet.png" width="14" height="14" alt="" class="icon"/>';
else if ($ank['status']==13) $on='<img src="/style/status/sex.png" width="14" height="14" alt="" class="icon"/>';
else if ($ank['status']==14) $on='<img src="/style/status/igrau.png" width="14" height="14" alt="" class="icon"/>';
else if ($ank['status']==15) $on='<img src="/style/status/pivo.png" width="14" height="14" alt="" class="icon"/>';
else if ($ank['status']==16) $on='<img src="/style/status/sonni.png" width="14" height="14" alt="" class="icon"/>';
else if ($ank['status']==17) $on='<img src="/style/status/1.png" width="14" height="14" alt="" class="icon"/>';
else if ($ank['status']==18) $on='<img src="/style/status/12.png" width="14" height="14" alt="" class="icon"/>';
else if ($ank['status']==19) $on='<img src="/style/status/13.png" width="14" height="14" alt="" class="icon"/>';
else if ($ank['status']==20) $on='<img src="/style/status/14.png" width="14" height="14" alt="" class="icon"/>';
else if ($ank['status']==21) $on='<img src="/style/status/18.png" width="14" height="14" alt="" class="icon"/>';
else if ($ank['status']==22) $on='<img src="/style/status/19.png" width="14" height="14" alt="" class="icon"/>';
else if ($ank['status']==23) $on='<img src="/style/status/31.png" width="14" height="14" alt="" class="icon"/>';
else if ($ank['status']==24) $on='<img src="/style/status/7.png" width="14" height="14" 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/boy_off.png" width="14" height="14" alt="" class="icon"/>';
else 
return '<img src="/style/user/girl_off.png" width="14" height="14" alt="" class="icon"/>';
}
if ($ank['ank_d_r'].$ank['ank_m_r']==date("jm")) echo ' <img src="/style/img/cake.png" /> ';

if ($ank['show_secret']==1)
{
if ($ank['pol']==1) return '<img src="/style/icons/sec.gif" alt="" class="icon"/>';
else 
return '<img src="/style/icons/sec.gif" alt="" class="icon"/>';
}
}

?>