function online user null user int abs user data mysql_fetch_object my

1
2
3
4
5
6
7
8
9
function online ($user = null){
$user = (int) abs($user);
$data = mysql_fetch_object(mysql_query("SELECT `id`,`plem`,`online` FROM `user` WHERE `id`='".$user."'"));
?>
<img src="/images/icon/race/<?=($data->plem == 'ogn' ? 0 : 1);?>.png" style ="<?=($data->online > (time()-3600) ? 'opacity:0.2;' : null);?>"/>
<?
}