<?php 

require '../system/start.php'; 
require '../system/functions.php'; 
reg();
$str['mesto'] = 'Пользователи Online'; 
$str['block'] = $set['site'].' / Пользователи'; 
include '../style/'.$style.'/head.php'; 
switch($act) 
{ default: $users = mysql_query("select * from `users` where `time` > '".(time()-300)."' order by `id` limit ".$page.",".$set['str'].""); 
$total = mysql_result(mysql_query("select count(*) from `users` where `time` > '".(time()-300)."'"),0); 
echo '<div class="mess">Зарегистрированых: '.$total.'</div>'; 
if($total > 0) 
{ 
while($row = mysql_fetch_assoc($users)) 
{ 
 $i++; 
 if($i%2) 
 { 
  echo '<div class="forum1"><div class="row4">'; 
 } else 
 { 
  echo '<div class="forum2"><div class="row4">'; 
 } 
 if(empty($row['foto'])) 
 { 
  echo '<img src="../style/'.$style.'/'.$row['gender'].'.png"  width="60" height="60" align="left" alt="" style="margin-right:4px;border-right:1px solid #99ccff"/>'; 
    } 
    elseif(!empty($row['foto'])) 
 { 
  echo '<img src="../files/avatars/'.$row['foto'].'"  width="60" height="60" align="left" alt="" style="margin-right:4px;border-right:1px solid #99ccff"/>'; 
    } 

                     		if ($row['gender'] == 1)
			$pol = '<img class="ico" src="../style/'.$style.'/ico/m.png" alt="" />';
		              if ($row['gender'] == 2)
			$pol = '<img class="ico" src="../style/'.$style.'/ico/w.png" alt="" />';

echo $pol.'<a href="../p/'.$row['login'].'">'.$row['login'].'</a>'; 
echo status($row['id']);
echo '<br/>';


 echo '<div class="ftext">';
if($user['id'] != $row['id']):
echo  '<a href="../pages/mail.php?act=send&amp;login='.$row['login'].'"><img align="right" class="ico" src="../style/'.$style.'/ico/mess.png" alt="" /></a>';
endif;

echo ' Имя: '.$row['name'].'<br/> 
 Последний вход: '.clock($row['time']).'<br/> 
 Местонахождение: '.$row['where'].'<br/> 

 </div> 
 <div class="clear"></div> 
 </div> ';
if ($status['text'])
echo'<div class="status"><b><!-- clear --></b>


'.text($row['greeting']); 
echo'</div>';
echo ' </div>'; 
} 
} 
echo '<div class="on2"> 
<img class="ico" src="../style/'.$style.'/ico/online.gif" alt="" /> <a href="online.php?act=guest">Гости онлайн</a> 
</div>'; 
if($total > $set['str']) 
{ 
 pages($page, $total, 'online.php?', $set['str']); 
} 
break; 
case 'guest': 
$users = mysql_query("select * from `online` limit ".$page.",".$set['str'].""); 
$total = mysql_result(mysql_query("select count(*) from `online`"),0); 
if($total > 0) 
{ 
while($row = mysql_fetch_assoc($users)) 
{ 
 $i++; 
 if($i%2) 
 { 
  echo '<div class="forum1">'; 
 } else 
 { 
  echo '<div class="forum2">'; 
 } 
 echo ' 
 <strong>Браузер</strong>: '.$row['ua'].'<br /> 
 <strong>IP</strong>: '.$row['ip'].'<br /> 
 <strong>Переходов</strong>: '.$row['pereh'].'<br /> 
 <strong>Последнее посещение</strong>: '.clock($row['time']).'<br /> 
 <strong>Местонахождение</strong>: '.$row['where'].'<br /> 
 </div>'; 
} 
} 
else 
{  echo '<div class="mess">Гостей на сайте нет!</div>'; 
} 
echo '<div class="on2"> 
<img class="ico" src="../style/'.$style.'/ico/online.gif" alt="" /> <a href="online.php">Пользователи онлайн</a> 
</div>'; 
if($total > $set['str']) 
{ 
 pages($page, $total, 'online.php?act=guest&amp;', $set['str']); 
} 
break; 
} 
include '../style/'.$style.'/foot.php'; 
?>


