<?php
class user { 
public static function nick($user = 0, $url = 1,  
$on = 0, $medal = 0){ 
$nick = null;$online = null;$icon_medal = null; 
$ank = mysql_fetch_assoc(mysql_query('SELECT `nick`, `date_last` FROM `user` WHERE `id` = "'.$user.'" LIMIT 1')); 
// --- Вывод ника  
if ($user == 0) {  
  $ank = array('id' => '0', 'nick' => 'Cистема', 'pol' => '1', 'rating' => '0', 'browser' => 'wap', 'date_last' => time());
} elseif (!$ank) {  
  $ank = array('id' => '0', 'nick' => '[Удален]', 'pol' => '1', 'rating' => '0', 'browser' => 'wap', 'date_last' => time());
} 
if ($url == true) { 
  $nick='</span><a href="/id'.$user.'"> '.text($ank['nick']).'</a>'; 
}else{$nick = text($ank['nick']);} 
// --- Вывод значка онлайн 
if ($user!=0 && $ank['date_last']>time()-600 && $on==true){ 
  $online = ' <img src="/kernel/icons/online_web.gif" alt="Online" />'; } 
return $reSES_ = $nick . $online; 
    }  
}
