<!--<?php print <<<EOT
-->
<style type="text/css">
.trbor td{border-bottom:0px;}
.tr2 td{padding:6px 5px;color:#333;border-top:1px solid $tdcolor;border-bottom:1px solid $tdcolor;}
.lh_18{line-height:18px;height:18px;overflow:hidden;}
</style>

<div id="breadCrumb">
<!--
EOT;
if($cachetime){print <<<EOT
-->
<span class="fr mr5">下次更新时间:$cachetime</span>
<!--
EOT;
}print <<<EOT
-->
<img src="$imgpath/$stylepath/thread/home.gif" class="breadHome" /><em class="breadEm"></em><a href="$db_bfn" title="$db_bbsname">$db_bbsname</a><em>&gt;</em><a href="sort.php">统计信息</a>
</div>
<div id="pw_content" class="cc">
<div class="hB mb10">
	<ul class="tabB cc">
<!--
EOT;
${'tmpSort_'.($action ? $action : 'default')} = "class='current'";print <<<EOT
-->
		<li $tmpSort_default ><a href="sort.php">基本统计信息</a></li>
		<li $tmpSort_ipstate ><a href="sort.php?action=ipstate">到访IP统计</a></li>
		<li $tmpSort_team ><a href="sort.php?action=team">管理团队</a></li>
		<li $tmpSort_admin ><a href="sort.php?action=admin">管理统计</a></li>
		<li $tmpSort_online ><a href="sort.php?action=online">在线统计</a></li>
		<li $tmpSort_member ><a href="sort.php?action=member">会员排行</a></li>
		<li $tmpSort_forum ><a href="sort.php?action=forum">版块排行</a></li>
		<li $tmpSort_favor ><a href="sort.php?action=favor">收藏排行Top50</a></li>
		<li $tmpSort_article ><a href="sort.php?action=article">帖子排行</a></li>
	</ul>
</div>
<div class="pd15">
<!--
EOT;
if(empty($action)){print <<<EOT
-->
<div class="t"><table width="100%" cellspacing="0" cellpadding="0">
<tr class="tr3 trbor vt">
<td width="33%">
<p class="mb10"><b>会员统计</b></p>
<p class="mb5">会员总数:$bbsinfo[totalmember]</p>
<p>最新注册会员:<a href="u.php?username=$bbsinfo[newmember]" target="_blank">$bbsinfo[newmember]</a></p>
</td>

<td width="33%" valign="top">
<p class="mb10"><b>帖子统计</b></p>
<p class="mb5">主题数:$topic</p>
<p class="mb5">帖子数:$article</p>
<p class="mb5">今 日:$tposts</p>
<p class="mb5">昨 日:$bbsinfo[yposts]</p>
<p class="mb5">最高日:$bbsinfo[hposts]</p>
</td>

<td width="33%" valign="top">
<p class="mb10"><b>在线统计</b></p>
<p class="mb5">在线总数:$usertotal</p>
<p class="mb5">会员数:$userinbbs</p>
<p class="mb5">游客数:$guestinbbs</p>
<p class="mb5">最高在线:$bbsinfo[higholnum]</p>
<p class="mb5">发生在:$bbsinfo[higholtime]</p></td></tr></table></div>
<!--
EOT;
}elseif($action=='ipstate'){print <<<EOT
-->
<div class="t">
<table width="100%" align="center" cellspacing="0" cellpadding="0">
<!--
EOT;
if($type=='month'){print <<<EOT
-->
<tr class="tr2"><td colspan="2"><b class="mr20">月到访IP统计</b>
<a href="sort.php?action=ipstate&year=$p_year" class="mr10 s4 b">&lt;</a><span class="mr10">{$c_year}</span><a href="sort.php?action=ipstate&year=$n_year" class="s4 b">&gt;</a>
</td></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="90">$ip[month]
<a href="sort.php?action=ipstate&type=day&month=$ip[_month]" class="s4">[查看]</a></th>
<th><img src="$imgpath/post/vote/tab-two.gif" width="$imgwidth" height="10" /> $ip[nums]($percent%)</th></tr>
<!--
EOT;
}}elseif($type=='day'){print <<<EOT
-->
<tr class="tr2"><td colspan="2">
<a href="sort.php?action=ipstate&year=$Y" class="s4 b">月到访IP统计</a>&nbsp;&gt;&nbsp;<b class="mr20">日到访IP统计</b>
<a href="sort.php?action=ipstate&type=day&month=$p_month" class="mr10 s4 b">&lt;</a><span class="mr10">{$c_month}</span><a href="sort.php?action=ipstate&type=day&month=$n_month" class="s4 b">&gt;</a>
</td></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="90">$ip[day]</th>
<th><img src="$imgpath/post/vote/tab-two.gif" width="$imgwidth" height="10" /> $ip[nums]($percent%)</th></tr>
<!--
EOT;
}}print <<<EOT
-->
</table></div>
<!--
EOT;
}elseif($action=='online'){print <<<EOT
-->
<div class="t">
<table width="100%" align="center" cellspacing="0" cellpadding="0">
<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="{$db_userurl}$thread[uid]" target="_blank">$thread[username](隐身)</a>
<!--
EOT;
}elseif($thread[9]=='<>' && $groupid!=3){
print <<<EOT
-->
隐身会员
<!--
EOT;
}else{
print <<<EOT
-->
<a href="{$db_userurl}$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>{$pages}共{$count}人在线</div>

<!--
EOT;
}elseif($action=='team'){print <<<EOT
-->
<div class="t">
<table width="100%" align="center" cellspacing="0" cellpadding="0">
<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="{$db_userurl}$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['ifcms']=='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="{$db_userurl}$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=='favor'){ print <<<EOT
-->
<div class="t">
<table width="100%" align="center" cellspacing="0" cellpadding="0">
<tr class="tr2 tac">
	<td>文章</td>
	<td>作者</td>
	<td>版块</td>
	<td>发表时间</td>
	<td>收藏次数</td>
	<td>回复/人气</td>
</tr>
<!--
EOT;
$f_class='f_one';
foreach($_SORTDB as $key => $value){
$f_class = $f_class=='f_one' ? 'f_two' : 'f_one';
print <<<EOT
-->
<tr class="tr3 tac $f_class">
	<td><a href="$value[url]" target="_blank">$value[title]</a></td>
	<td><a href="{$db_userurl}{$value[addition][authorid]}" target="_blank">{$value[addition][author]}</a></td>
	<td><a href="thread.php?fid=$value[fid]" target="_blank">$value[forum]</a></td>
	<td>$value[posttime]</td>
	<td>$value[value]</td>
	<td>{$value[addition][replies]}/{$value[addition][hits]}</td>
</tr>
<!--
EOT;
}print <<<EOT
-->
<tr class="f_one"><td style="height:8px;" colspan="16"></td></tr>
</table></div>
<!--
EOT;
}elseif($action=='admin'){ print <<<EOT
-->
<div class="mb10 cc tar">
	<form action="$baseurl&" method="post">
	<input type="hidden" name="step" value="2">
	搜索：<select name="postStartDate" class="input mr5" > 
			<option value="">请选择时间</option>
<!--
EOT;
foreach($dateSelect as $key=>$value){
$startSelected = ($key == $startDate) ? 'selected="selected"' : '';
print <<<EOT
-->
			<option value="$value" $startSelected >$value</option>
<!--
EOT;
}print <<<EOT
-->
		</select>
	<span class="mr5">至</span>
	<select name="postEndDate" class="input mr5" > 
		<option value="">请选择时间</option>
<!--
EOT;
foreach($dateSelect as $key=>$value){
$endSelected = ($key == $endDate) ? 'selected="selected"' : '';
print <<<EOT
-->
<option value="$value" $endSelected >$value</option>
<!--
EOT;
}print <<<EOT
-->
	</select><input name="adminName" value="$adminName" type="text" size="28" class="input mr5" /><span class="bt2"><span><button type="submit">提 交</button></span></span>
	</form>
</div>
<div class="t">
<table width="100%" cellspacing="0" cellpadding="0" style="table-layout:fixed;">
<tr class="tr2">
	<td width="80" style="padding-left:10px;">用户名</td>
	<td width="100"><a href="$baseurl$urlAdd" class="link_down"><span>系统头衔</span></a></td>
	<td class="tac"><a href="$baseurl&type=highlight$urlAdd" $sort_a[highlight]><span>加亮</span></a></td>
	<td class="tac"><a href="$baseurl&type=delete$urlAdd" $sort_a[delete]><span>删除</span></a></td>
	<td class="tac"><a href="$baseurl&type=credit$urlAdd" $sort_a[credit]><span>评分</span></a></td>
	<td class="tac"><a href="$baseurl&type=topped$urlAdd" {$sort_a[topped]}><span>置顶</span></a></td>
	<td class="tac"><a href="$baseurl&type=edit$urlAdd" {$sort_a[edit]}><span>编辑</span></a></td>
	<td class="tac"><a href="$baseurl&type=digest$urlAdd" {$sort_a[digest]}><span>精华</span></a></td>
	<td class="tac"><a href="$baseurl&type=copy$urlAdd" {$sort_a[copy]}><span>复制</span></a></td>
	<td class="tac"><a href="$baseurl&type=move$urlAdd" {$sort_a[move]}><span>移动</span></a></td>
    <td class="tac"><a href="$baseurl&type=down$urlAdd" {$sort_a[down]}><span>压帖</span></a></td>
    <td class="tac"><a href="$baseurl&type=banuser$urlAdd" {$sort_a[banuser]}><span>禁言</span></a></td>
	<td class="tac"><a href="$baseurl&type=locked$urlAdd" {$sort_a[locked]}><span>锁定</span></a></td>
	<td class="tac"><a href="$baseurl&type=push$urlAdd" {$sort_a[push]}><span>提前</span></a></td>
	<td class="tac"><a href="$baseurl&type=unite$urlAdd" {$sort_a[unite]}><span>合并</span></a></td>
	<td class="tac"><a href="$baseurl&type=shield$urlAdd" {$sort_a[shield]}><span>屏蔽</span></a></td>
	<td class="tac"><a href="$baseurl&type=remind$urlAdd" {$sort_a[remind]}><span>提醒</span></a></td>
    <td class="tac" width="60"><a href="$baseurl&type=recycle$urlAdd" {$sort_a[recycle]}><span>还原帖子</span></a></td>
    <td class="tac" width="60"><a href="$baseurl&type=deluser$urlAdd" {$sort_a[deluser]}><span>删除用户</span></a></td>
	<td class="tac" width="60"><a href="$baseurl&type=total$urlAdd" {$sort_a[total]}><span>总计</span></a></td>
</tr>
<!--
EOT;
$f_class='f_one';
foreach($admindb as $key => $admin){
$f_class=$f_class=='f_one' ? 'f_one' : 'f_two';
$highlight = $admin[highlight] ? $admin[highlight] : 0;
$delete = $admin[delete] ? $admin[delete] : 0;
$credit = $admin[credit] ? $admin[credit] : 0;
$topped = $admin[topped] ? $admin[topped] : 0;
$edit = $admin[edit] ? $admin[edit] : 0;
$digest = $admin[digest] ? $admin[digest] : 0;
$copy = $admin[copy] ? $admin[copy] : 0;
$move = $admin[move] ? $admin[move] : 0;
$down = $admin[down] ? $admin[down] : 0;
$banuser = $admin[banuser] ? $admin[banuser] : 0;
$locked = $admin[locked] ? $admin[locked] : 0;
$push = $admin[push] ? $admin[push] : 0;
$unite = $admin[unite] ? $admin[unite] : 0;
$shield = $admin[shield] ? $admin[shield] : 0;
$remind = $admin[remind] ? $admin[remind] : 0;
$recycle = $admin[recycle] ? $admin[recycle] : 0;
$deluser = $admin[deluser] ? $admin[deluser] : 0;
$total = $admin[total] ? $admin[total] : 0;
print <<<EOT
-->
<tr class="tr3 $f_class">
	<td style="padding-left:10px;"><a href="{$db_userurl}$admin[uid]" target="_blank">$key</a></td>
	<td>{$ltitle[$admin[gid]]}</td>
	<td class="tac">$highlight</td>
	<td class="tac">$delete</td>
	<td class="tac">$credit</td>
	<td class="tac">$topped</td>
	<td class="tac">$edit</td>
	<td class="tac">$digest</td>
	<td class="tac">$copy</td>
	<td class="tac">$move</td>
    <td class="tac">$down</td>
    <td class="tac">$banuser</td>
	<td class="tac">$locked</td>
	<td class="tac">$push</td>
	<td class="tac">$unite</td>
	<td class="tac">$shield</td>
	<td class="tac">$remind</td>
    <td class="tac">$recycle</td>
    <td class="tac">$deluser</td>
	<td class="tac">$total</td>
</tr>
<!--
EOT;
}print <<<EOT
-->
</table></div>
<!--
EOT;
} else{print <<<EOT
-->
<div class="t">
<table width="100%" align="center" cellspacing="0" cellpadding="3">
<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:5px auto">
<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="width:30px;" class="tac s6">$id</td>
<td>
<p class="lh_18"><a href="$show_url=$sort[0]" target="_blank" class="s4">$sort[1]</a></p>
</td>
<!--
EOT;
if($key!='digest'){print <<<EOT
-->
<td style="width:70px;" class="tac">$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 class="tac s6">$id</td>
<td></td>
<!--
EOT;
if($key!='digest'){print <<<EOT
-->
<td></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;
}print <<<EOT
-->
</div>
</div>
<!--
EOT;
?>-->
