<?

list($msec, $sec) = explode( chr(32), microtime() );

$online = mysql_num_rows( mysql_query('SELECT * FROM `users` WHERE `online` > \''.( time() - (60 * 20) ).'\'') );

if($user)
{

?>
<div class='max-line'></div>
<div class='list'>
  <li><a href='/user/'><img src='/images/icon/user.png' alt='*'/> Мой герой</a></li>
<?php

  if($clan) echo '<li><a href=\'/clan/\'><img src=\'/images/icon/clan.png\' alt=\'*\'/> Мой клан</a></li>';
  
?>
  <li class='no_b'><a href='/'><img src='/images/icon/arrow.png' alt=''/> На главную</a></li>
</div>
<div class='max-line'></div>
<div class='f'>
  <span style='float: right;'><?=($user['save'] == 1 ? '<a href=\'/settings/\'>Настройки</a><br>':'<a href=\'/save/\'>Сохранить</a>')?></span><?=$user['login']?><br>
  <div align='center'><br><img src='/images/icon/level.png' alt='*'/> <?=$user['level']?> | <img src='/images/icon/gold.png' alt='*'/> <?=n_f($user['g'])?> | <img src='/images/icon/silver.png' alt='*'/> <?=n_f($user['s'])?></div>
</div>
<br/>
<div align='center'>
<?php

  $chatmessages = 0;

    $countchatmessages     = mysql_num_rows(mysql_query('SELECT * FROM `chat` WHERE `clan` = \'0\' AND `to` = \''.$user['id'].'\' AND `read` = \'0\''));
  if($chat > 0)       $chatmessages += $chat;
  
  if($clan)
  {
  
    $countclanchatmessages = mysql_num_rows(mysql_query('SELECT * FROM `chat` WHERE `clan` = \''.$clan['id'].'\' AND `to` = \''.$user['id'].'\' AND `read` = \'0\''));
    if($clanchat > 0) $chatmessages += $clanchat;

  }

?>
  <a href='/forum/sub/9/'>Новости</a> | <a href='/chat/'>Чат <?=($chatmessages > 0 ? '<font color=\'#30c030\'>(+)</font>':'')?></a> | <a href='/forum/'>Форум</a><br/><br/><a href='/common/'>Общее</a>
  <div class='separator'></div>
  <small><font color='#909090'><?=round((($sec+$msec)-$gtime),3)?> сек | <?=date('H:i:s')?> |</font> <a href='/online/'>Онлайн: <?=n_f($online)?></a></font></small><br/>
<?php

  if($user['access'] > 0) echo '<br/><a href=\'/adm/\'>Панель управления</a>';

?>
</div><br/>
<?php

}
else
{

?>
<br/>
<div align='center'>
  <small><font color='#909090'><?=round((($sec+$msec)-$gtime),3)?> сек | <?=date('H:i:s')?> | Онлайн: <?=n_f(mysql_result(mysql_query('SELECT COUNT(*) FROM `users`'),0))?> / <?=n_f($online)?></font></small>
</div><br><br>
<?php

}

?>

<?



?>


<?php

ob_end_flush();

?>