<?php
#------------------------------------------------------#
#               本程序为zChain.net提供                 #
#                zChain论坛(ZBB)v2.00                  #
#------------------------------------------------------#
# INPUT: None

require "bin/config.php";
require "bin/common.php";

require_once('core/class_forum_base.php');
CForumBase::setFileBase("$filepath");
require_once('core/base_array_file.php');
require_once('core/class_activity.php');

$oAct=new CActivity;
$oAct->load();
$size=$oAct->itemCount();

page_header('当前在线人员',"$imgurl/bei.gif");
print "<CENTER>";
$posText=getRootText()." >> 当前在线人员";
menu_bar($posText,'');

print <<<EOT
<br>
<table cellspacing=1 width=90% class="forumLine">
<tr align=center>
 <td colspan=5 class=rowCat>当 前 在 线 人 员 名 单</td>
</tr>
<tr align=center>
 <td width=20% class=rowCaption>IP地址</td>
 <td width=15% class=rowCaption>姓名</td>
 <td width=15% class=rowCaption>活动时间</td>
 <td width=20% class=rowCaption>访问论坛</td>
 <td width=30% class=rowCaption>访问主题</td>
</tr>
EOT;

for($i=0; $i<$size; $i++){
 $oAct->moveTo($i);

 $rtime=strftime("%H:%M:%S",$oAct->timestamp);
 if($sv_user==$admname){
  $ipinfo=explode('.',$oAct->ip);
  $rip="$ipinfo[0].$ipinfo[1].$ipinfo[2].*";
 }else{
  $rip=$oAct->ip;
 }
 if($oAct->user){
  $rname="<a href=viewuser.php?user=$oAct->user>$oAct->user</a>";
 }else{
  $rname="访 客";
 }
 if($oAct->bid > 0){
  $blink="<a href=viewboard.php?bid=$oAct->bid>$oAct->bid</a>";
 }else{
  $blink="N/A";
 }
 if($oAct->tid > 0){
  $tlink="<a href=viewtopic.php?bid=$oAct->bid&tid=$oAct->tid>$oAct->tid</a>";
 }else{
  $tlink="N/A";
 }

 print <<<EOT
<tr align=center>
<td width=20% class=row1>$rip</td>
<td width=15% class=row1>$rname</td>
<td width=15% class=row1>$rtime</td>
<td width=20% class=row1>$blink</td>
<td width=30% class=row1>$tlink</td>
</tr>
EOT;

}

print <<<EOT
</table><BR><BR>
<a href=javascript:history.back()>
<img src=$imgurl/back.gif border=0></a>
</CENTER>
EOT;

page_footer();

?>