<? 
function online($user=NULL) 
{ 
global $set,$time; 
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `ban` WHERE `id_user` = '$user' AND `time` > '$time'"), 0)!=0) 
return '<img src="/sys/img/0_off.gif" alt=""/>'; 
elseif (mysql_result(mysql_query("SELECT COUNT(*) FROM `user` WHERE `id` = '$user' AND `date_last` > '".(time()-300)."' LIMIT 1"),0)==1) 
{ 

if ($set['show_away']==0)$on='On'; 
else 
{ 
$ank=mysql_fetch_array(mysql_query("SELECT `date_last` FROM `user` WHERE `id` = '$user' LIMIT 1")); 
if ((time()-$ank['date_last'])==0) 
$on='online'; 
else 
$on='away: '.(time()-$ank['date_last']).' сек'; 

} 
//////////////////////////// 
$adm = mysql_fetch_array(mysql_query("SELECT `pol`,`level`,`balls`,`rating` from `user` where `id`='$user' limit 1;")); 
if ($adm['level']==3 ){echo "<img src='/sys/img/admin_man.gif' alt=''/>"; 
}else 
if ($adm['level']==4 ){echo "<img src='/sys/img/admin_man.gif' alt=''/>"; 
}else 
if ($adm['level']==0 ){ 
if ($adm['pol']==1){echo "<img src='/sys/img/1_on.gif' alt=''/>"; 
}else 
if ($adm['pol']==0){echo "<img src='/sys/img/0_on.gif' alt=''/>"; 
}}else 
if ($adm['level']==1 ){ 
if ($adm['pol']==1){echo "<img src='/sys/img/mod_man_on.gif' alt=''/>"; 
}else 
if ($adm['pol']==0){echo "<img src='/sys/img/mod_woman_on.gif' alt=''/>";} 
}else 
if ($adm['level']==2 ){ 
if ($adm['pol']==0){echo "<img src='/sys/img/mod_woman_on.gif' alt=''/>"; 
}else 
if ($adm['pol']==1){echo "<img src='/sys/img/mod_man_on.gif' alt=''/>";} 
}else 
if ($adm['pol']==1){
if ($adm['level']==3 ){echo "<img src='/sys/img/admin_sign.gif' alt=''/>"; 
}
}
if ($adm['pol']==0){
if ($adm['level']==3 ){echo "<img src='/sys/img/admin_sign.gif' alt=''/>"; 
}}
/////////////////////////////////////// 
} 

else{ 
$adm = mysql_fetch_array(mysql_query("SELECT `pol`,`level`,`balls`,`rating` from `user` where `id`='$user' limit 1;")); 


if ($adm['level']==4 ){ 
if ($adm['pol']==0){echo "<img src='/sys/img/admin_woman.gif' alt=''/>"; 
}else 
if ($adm['pol']==1){echo "<img src='/sys/img/admin_man.gif' alt=''/>";} 
}else


if ($adm['level']==3 ){ 
if ($adm['pol']==0){echo "<img src='/sys/img/admin_woman.gif' alt=''/>"; 
}else 
if ($adm['pol']==1){echo "<img src='/sys/img/admin_man.gif' alt=''/>";} 
}else

if ($adm['level']==2 ){ 
if ($adm['pol']==0){echo "<img src='/sys/img/admin_woman.gif' alt=''/>"; 
}else 
if ($adm['pol']==1){echo "<img src='/sys/img/admin_man.gif' alt=''/>";} 
}else


if ($adm['pol']==0 ){echo "<img src='/sys/img/0_off.gif' alt=''/>"; 
}else 
if ($adm['pol']==1){echo "<img src='/sys/img/1_off.gif' alt=''/>"; 
} 
} 
} 
?>