<?

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['status']==0)
{
$on='<img src="/style/on.png" alt="on" class="on"/>';echo $on;
}
else if ($ank['status']>=0)
{
echo'<img src="/status/icon/'.$ank['status'].'.gif" alt="on" class="on"/> ';}
}
else
{
$ank=mysql_fetch_array(mysql_query("SELECT * FROM `user` WHERE `id` = $user LIMIT 1"));

echo '<img src="/style/off.png" alt="" class="off"/>';

}

}
?>