<!--<?php print <<<EOT
-->
<style type="text/css">
.trbor td{border-bottom:0px;}
</style>
<div class="bdbA">
	<div id="breadcrumbs">
		<a class="crumbs-item gray3" href="$db_bfn" title="$db_bbsname">$db_bbsname</a><span class="crumbs-item current"><i> </i><strong>統計信息</strong></span>
<!--
EOT;
if($cachetime){print <<<EOT
-->
<span class="fr gray3">下次更新時間:$cachetime</span>
</td>
<!--
EOT;
}print <<<EOT
-->
	</div>
</div>

<div class="t5" style="margin-top:8px;">
<table width="100%" cellspacing="0" cellpadding="0">
<tr class="tr4 tac">
<td><a href="sort.php">基本統計信息</a></td>
<td><a href="sort.php?action=ipstate">到訪IP統計</a></td>
<td><a href="sort.php?action=team">管理團隊</a></td>
<td><a href="sort.php?action=admin">管理統計</a></td>
<td><a href="sort.php?action=online">在線統計</a></td>
<td><a href="sort.php?action=member">會員排行</a></td>
<td><a href="sort.php?action=forum">版塊排行</a></td>
<td style="border-right:0px;"><a href="sort.php?action=article">帖子排行</a></td>
</tr></table></div>
<!--
EOT;
if(empty($action)){print <<<EOT
-->
<div class="t"><table width="100%" align="center" cellspacing="0" cellpadding="0">
<tr><td class="h" colspan="3"><b>基本統計信息</b></td></tr>
<tr class="tr3 f_one trbor">
<td width="33%" valign="top">
<div style="padding-left:8%;text-align:left; line-height:150%"><b>會員統計</b><br /><br />
會員總數:$bbsinfo[totalmember]<br /><br />
最新注冊會員:<a href="u.php?action=show&username=$bbsinfo[newmember]" target="_blank">$bbsinfo[newmember]</a></div>
</td>

<td width="33%" valign="top">
<div style="padding-left:10%;text-align:left; line-height:150%"><b>帖子統計</b><br />
主題數:$topic<br />
帖子數:$article<br />
今 日:$tposts<br />
昨 日:$bbsinfo[yposts]<br />
最高日:$bbsinfo[hposts]</div></td>

<td width="33%" valign="top">
<div style="padding-left:8%;text-align:left; line-height:150%"><b>在線統計</b><br />
在線總數:$usertotal<br />
會員數:$userinbbs<br />
游客數:$guestinbbs<br />
最高在線:$bbsinfo[higholnum]<br />
發生在:$bbsinfo[higholtime]</div></td></tr></table></div>
<!--
EOT;
}elseif($action=='ipstate'){print <<<EOT
-->
<div class="t">
<table width="100%" align="center" cellspacing="0" cellpadding="0">
<tr><td class="h" colspan="2"><b>到訪IP統計</b></td></tr>
<!--
EOT;
if($type=='month'){print <<<EOT
-->
<tr class="tr2"><th colspan="2"><b>月到訪IP統計</b>
<a href="sort.php?action=ipstate&year=$p_year">< </a> $c_year <a href="sort.php?action=ipstate&year=$n_year">></a>
</th></tr>
<!--
EOT;
foreach($m_ipdb as $key => $ip){
$percent=round($ip[nums]/$summip*100,1);
$imgwidth=floor(500*$ip[nums]/($summip+1));
print <<<EOT
-->
<tr class="tr3 f_one"><th width="15%">$ip[month] 
<a href="sort.php?action=ipstate&type=day&month=$ip[_month]">查看</a></th>
<th><img src="$imgpath/post/vote/bar1.gif" width="$imgwidth" height="10" /> $ip[nums]($percent%)</th></tr>
<!--
EOT;
}}elseif($type=='day'){print <<<EOT
-->
<tr class="tr2"><th colspan="2">
<a href="sort.php?action=ipstate&year=$Y"><b>月到訪IP統計</b></a>
<b>日到訪IP統計</b>
<a href="sort.php?action=ipstate&type=day&month=$p_month">< </a> $c_month 
<a href="sort.php?action=ipstate&type=day&month=$n_month">></a>
</th></tr>
<!--
EOT;
foreach($d_ipdb as $key => $ip){
$percent=round($ip[nums]/$sumip*100,1);
$imgwidth=floor(500*$ip[nums]/($sumip+1));
print <<<EOT
-->
<tr class="tr3 f_one"><th width="15%">$ip[day]</th>
<th><img src="$imgpath/post/vote/bar1.gif" width="$imgwidth" height="10" /> $ip[nums]($percent%)</th></tr>
<!--
EOT;
}}print <<<EOT
-->
<tr class="f_one"><td style="height:8px;" colspan="2"></td></tr>
</table></div>
<!--
EOT;
}elseif($action=='online'){print <<<EOT
-->
<div class="t">
<table width="100%" align="center" cellspacing="0" cellpadding="0">
<tr><td class="h" colspan="10"><b>在線統計</b></td></tr>
<tr class="tr2 tac">
<td>用戶名</td>
<td>IP</td>
<td>級別</td>
<td>當前動作</td>
<td>最後活動時間</td>
<td>所在版塊</td>
<td>所在主題</td>
</tr>
<!--
EOT;
$f_class='f_one';
foreach($threaddb as $thread){
if($thread){
$f_class=$f_class=='f_one' ? 'f_two' : 'f_one';
print <<<EOT
-->
<tr class="tr3 tac $f_class">
<td>
<b>
<!--
EOT;
if($thread[9]=='<>' && $groupid==3){
print <<<EOT
-->
<a href="u.php?action=show&uid=$thread[uid]" target="_blank">$thread[username](隱身)</a>
<!--
EOT;
}elseif($thread[9]=='<>' && $groupid!=3){
print <<<EOT
-->
隱身會員
<!--
EOT;
}else{
print <<<EOT
-->
<a href="u.php?action=show&uid=$thread[uid]" target="_blank">$thread[username]</a>
<!--
EOT;
}print <<<EOT
-->
</b></td>
<td>$thread[ip]</td>
<td>$thread[group]</td>
<td>$thread[action]</td>
<td>$thread[lasttime]</td>
<td>$thread[forum]<br /></td>
<td>
<!--
EOT;
if($thread[atc]){print <<<EOT
-->
<a href="read.php?tid=$thread[atc]">進入主題</a>
<!--
EOT;
}print <<<EOT
-->
<br /></td>
</tr>
<!--
EOT;
}}
print <<<EOT
-->
<tr class="f_one"><td style="height:8px;" colspan="7"></td></tr>
</table></div>
{$pages}共{$count}人在線
<!--
EOT;
}elseif($action=='team'){print <<<EOT
-->
<div class="t">
<table width="100%" align="center" cellspacing="0" cellpadding="0">
<tr><td class="h" colspan="11"><b>管理團隊</b></td></tr>
<tr class="tr2 tac">
<td>用戶名</td>
<td>系統頭餃</td>
<td>會員頭餃</td>
<td>最後發表</td>
<td>離開天數</td>
<td>發帖</td>
<td>本月發帖</td>
<td>{$db_rvrcname}</td>
<td>$db_moneyname</td>
<td>在線時間</td>
<td>本月在線</td>
</tr>
<!--
EOT;
foreach($teamdb as $key => $team){
print <<<EOT
-->
<tr class="tr3 tac f_one">
<td><a href="u.php?action=show&uid=$team[uid]" target="_blank">$team[username]</a></td>
<td>$team[systitle]</td>
<td>$team[memtitle]</td>
<td>$team[lastpost]</td>
<td>$team[leavedays]</td>
<td>$team[postnum]</td>
<td>$team[monthpost]</td>
<td>$team[rvrc]</td>
<td>$team[money]</td>
<td>$team[onlinetime]</td>
<td>$team[monoltime]</td>
</tr>
<!--
EOT;
}print <<<EOT
-->
<tr class="f_one"><td style="height:8px;" colspan="11"></td></tr>
</table></div>
<div class="t"><table width="100%" align="center" cellspacing="0" cellpadding="0">
<tr><td class="h" colspan="12"><b>版主統計</b></td></tr>
<tr class="tr2 tac">
	<td>版塊名稱</td>
	<td>版主</td>
	<td>系統頭餃</td>
	<td>會員頭餃</td>
	<td>最後發表</td>
	<td>離開天數</td>
	<td>本月主題數</td>
	<td>本月發帖</td>
	<td>被點擊數</td>
	<td>本月在線</td>
</tr>
<!--
EOT;
foreach($forum as $key => $value){
if($value['cms']=='0' && $forumdb[$key]){
$i=count($forumdb[$key]);
print <<<EOT
-->
<tr class="tr3 tac f_one">
	<td rowspan="$i"><a href="thread.php?fid=$key" target="_blank">$value[name]</a></td>
<!--
EOT;
$j=0; 
foreach($forumdb[$key] as $uid=>$member){
$j++;
if($j>1){
print <<<EOT
-->
<tr class="tr3 tac f_one">
<!--
EOT;
}
print <<<EOT
-->
	<td><a href="u.php?action=show&uid=$uid" target="_blank">$member[username]</a></td>
	<td>$member[systitle]</td>
	<td>$member[memtitle]</td>
	<td>$member[lastpost]</td>
	<td>$member[leavedays]</td>
	<td>$member[post]</td>
	<td>$member[monthpost]<br /></td>
	<td>$member[hits]<br /></td>
	<td>$member[monoltime]</td>
</tr>
<!--
EOT;
}}}print <<<EOT
-->
<tr class="f_one"><td style="height:8px;" colspan="10"></td></tr>
</table></div>
<!--
EOT;
} elseif($action=='admin'){ print <<<EOT
-->
<div class="t">
<table width="100%" align="center" cellspacing="0" cellpadding="0">
<tr><td class="h" colspan="16"><b>管理統計</b></td></tr>
<tr class="tr2 tac">
	<td>用戶名</td>
	<td><a href="$baseurl">系統頭餃</a></td>
	<td><a href="$baseurl&type=highlight">加亮</a>$sort_a[highlight]</td>
	<td><a href="$baseurl&type=delete">刪除</a>$sort_a[delete]</td>
	<td><a href="$baseurl&type=credit">評分</a>$sort_a[credit]</td>
	<td><a href="$baseurl&type=topped">置頂</a>$sort_a[topped]</td>
	<td><a href="$baseurl&type=edit">編輯</a>$sort_a[edit]</td>
	<td><a href="$baseurl&type=digest">精華</a>$sort_a[digest]</td>
	<td><a href="$baseurl&type=copy">復制</a>$sort_a[copy]</td>
	<td><a href="$baseurl&type=move">移動</a>$sort_a[move]</td>
	<td><a href="$baseurl&type=locked">鎖定</a>$sort_a[locked]</td>
	<td><a href="$baseurl&type=push">提前</a>$sort_a[push]</td>
	<td><a href="$baseurl&type=unite">合並</a>$sort_a[unite]</td>
	<td><a href="$baseurl&type=shield">屏蔽</a>$sort_a[shield]</td>
	<td><a href="$baseurl&type=remind">提示</a>$sort_a[remind]</td>
	<td><a href="$baseurl&type=total">總計$sort_a[total]</a></td>
</tr>
<!--
EOT;
$f_class='f_one';
foreach($admindb as $key => $admin){
$f_class=$f_class=='f_one' ? 'f_two' : 'f_one';
print <<<EOT
-->
<tr class="tr3 tac $f_class">
	<td><a href="u.php?action=show&uid=$admin[uid]" target="_blank">$key</a></td>
	<td>{$ltitle[$admin[gid]]}<br /></td>
	<td>$admin[highlight]<br /></td>
	<td>$admin[delete]<br /></td>
	<td>$admin[credit]<br /></td>
	<td>$admin[topped]<br /></td>
	<td>$admin[edit]<br /></td>
	<td>$admin[digest]<br /></td>
	<td>$admin[copy]<br /></td>
	<td>$admin[move]<br /></td>
	<td>$admin[locked]<br /></td>
	<td>$admin[push]<br /></td>
	<td>$admin[unite]<br /></td>
	<td>$admin[shield]<br /></td>
	<td>$admin[remind]<br /></td>
	<td>$admin[total]<br /></td>
</tr>
<!--
EOT;
}print <<<EOT
-->
<tr class="f_one"><td style="height:8px;" colspan="16"></td></tr>
</table></div>
<div style="text-align:right;margin-bottom:25px;">月份:
<!--
EOT;
foreach($month_a as $key=>$value){print <<<EOT
-->
$value
<!--
EOT;
}if($month!=$thismonth && $groupid=='3'){print <<<EOT
-->
&nbsp;<a href="sort.php?action=delsort&month=$month&verify=$verifyhash"><b>刪除該月記錄</b></a>
<!--
EOT;
}print <<<EOT
-->
&nbsp;&nbsp;</div>
<!--
EOT;
} else{print <<<EOT
-->
<div class="t">
<table width="100%" align="center" cellspacing="0" cellpadding="3">
<tr><td colspan="3" class="h"><b>論壇排行榜</b></td></tr>
<tr>
<!--
EOT;
$cid=0;
foreach($_SORTDB as $key=>$_SORT){
$type=!is_numeric($key) ? getLangInfo('other','sort_'.$key) : $_CREDITDB[$key][0];
$cid++;
print <<<EOT
-->
<td valign="top" width="33%">
<div class="t3" style="padding:1px;border:1px solid $tablecolor;width:98%;margin:0px auto 5px">
<table width="100%" cellspacing="0" cellpadding="0" align="center">
<tr class="tr2 tac"><td colspan="3"> &nbsp; {$type}排行榜</td></tr>
<!--
EOT;
$id=0;
foreach($_SORT as $id=>$sort){
$id++;
$class=$id%2==0 ? "f_two" : "f_one";
print <<<EOT
-->
<tr class="tr3 $class">
<td style="border-right:0;width:30px;" class="tac">$id</td>
<td style="border-right:0">
<a href="$show_url=$sort[0]" target="_blank">$sort[1]</a>
</td>
<!--
EOT;
if($key!='digest'){print <<<EOT
-->
<td style="border-right:0;width:70px;" class="tar">$sort[2]</td>
<!--
EOT;
}print <<<EOT
-->
</tr>
<!--
EOT;
}if($id<$cachenum){
for($i=$id;$i<$cachenum;$i++){
$id++;
$class=$id%2==0 ? "f_two" : "f_one";
print <<<EOT
-->
<tr class="tr3 $class">
<td style="border-right:0;" class="tac">$id</td>
<td style="border-right:0;"></td>
<!--
EOT;
if($key!='digest'){print <<<EOT
-->
<td style="border-right:0;" class="tar"></td>
<!--
EOT;
}print <<<EOT
-->
</tr>
<!--
EOT;
}}print <<<EOT
-->
</table></div></td>
<!--
EOT;
if($cid%3==0){print <<<EOT
-->
</tr><tr>
<!--
EOT;
}}print <<<EOT
-->
</table></div>
<!--
EOT;
}?>-->
