<!--<?php print <<<EOT
-->
<div class="bdbA">
	<div id="breadcrumbs">
		<a class="crumbs-item gray3" href="$db_bfn" title="$db_bbsname">$db_bbsname</a>
<!--
EOT;
if($forum_name){ print <<<EOT
-->
		<a class="crumbs-item gray3" href="forumcp.php"><i> </i>版塊管理</a><span class="crumbs-item current"><i> </i><strong> <a href="thread.php?fid=$fid">$forum_name</a></strong></span>
<!--
EOT;
}else{
print <<<EOT
-->
		<span class="crumbs-item current"><i> </i><strong><a href="forumcp.php">版塊管理</a></strong></span>
<!--
EOT;
}
print <<<EOT
-->
	</div>
</div>
<style type="text/css">
.t{margin-top:8px;border:3px solid $forumcolortwo;}
.t .tabb{border:1px solid $tablecolor;}
.t .h{font-weight:normal}
.t .tr3{line-height:25px;}
.fen a:hover,.me a:hover{border:1px solid $tablecolor;text-decoration:none;}
.fen a{border:1px solid $tdcolor;line-height:25px;height:25px;display:block;text-align:center}
.fen{background:$bgcolor;margin:1em 0;float:left;}
.web01{width:100%;}
.web02{margin-right:10px;width:85px;margin-bottom:0;}
.web03{width:85px;}
.fen-h1{height:25px;line-height:25px;border-bottom:3px solid $tablecolor;padding:0 .5em;font-weight:700}
.fourm-two span{cursor:pointer;float:left;background:url(images/admin/setfourm/fourm-two.gif) 0 0 no-repeat;margin-left:7px;width:24px;height:24px;}
.fourm-two .edit{background-position:0 0;width:24px;height:24px;}
.fourm-two .del{background-position:0 -120px;width:24px;height:24px;}
.tr3 td,.tr3 th{border-bottom:1px dotted $tdcolor;padding:.3em .6em;}
.pages ul li{list-style:none;float:left;background:$bgcolor;}
</style>
<!--
EOT;
if(!$action){ print <<<EOT
-->
<div class="t f_one" style="margin-top:8px">
<table width="100%" cellspacing="0" cellpadding="0" class="tabb">
<tr><td class="h" colspan="$j_sum"><b>基本統計信息</b></td></tr>
<tr class="tr3">
<!--
EOT;
$i=0;
foreach($forumdb as $key=>$value){
$i++;
print <<<EOT
-->
<td style="padding:8px" valign="top" width="$j_wid">
<div style="text-align:left;margin-bottom:2px;line-height:150%;padding-left:5px;">
<span class="s8"><a href="thread.php?fid=$value[fid]">$value[name]</a></span><br />
<span class="gray">主 題 數︰</span> $value[topic]<br />
<span class="gray">文 章 數︰</span> $value[article]<br />
<div class="fr" style="margin-bottom:2px"><a href="forumcp.php?action=edit&fid=$value[fid]">
<b>=>版主特權</b></a></div><span class="gray">今日主題︰</span> $value[tpost]</div>
</td>
<!--
EOT;
if($i==4){
$i=0;
print <<<EOT
-->
</tr><tr class="tr3">
<!--
EOT;
}}if($j_sum==4 && $i<4){
for($j=$i;$j<4;$j++){print <<<EOT
-->
<td class="f_one" valign="top" width="$j_wid"><br /></td>
<!--
EOT;
}}print <<<EOT
-->
</tr></table></div>
<!--
EOT;
}elseif($action=='edit'){ print <<<EOT
-->
<div class="t f_one" style="margin-top:8px"><table width="100%" cellspacing="0" cellpadding="0" align="center" class="tabb">
<tr><td width="200" valign="top" class="f_two" style="border-right:1px solid $tablecolor;">
<div class="h">管理選項</div>
<div style="padding:10px;">

<div class="fen-h1">內部留言</div>
	<div class="fen web02"><a href="forumcp.php?action=edit&type=msg&fid=$fid">留言管理</a></div>
	<div class="fen web03"><a href="forumcp.php?action=edit&type=addmsg&fid=$fid">添加留言</a></div>
<div class="c"></div>

<div class="fen-h1">版塊編輯</div>
	<div class="fen web02"><a href="forumcp.php?action=edit&type=notice&fid=$fid">公告管理</a></div>
	<div class="fen web03"><a href="forumcp.php?action=edit&type=add&fid=$fid">發布公告</a></div>
	<div class="fen web01" style="margin-top:0;"><a href="forumcp.php?action=edit&type=f_type&fid=$fid">主題分類</a></div>
<div class="c"></div>

<div class="fen-h1">帖子管理</div>
	<div class="fen web02"><a href="forumcp.php?action=edit&type=report&fid=$fid">報告貼</a></div>
	<div class="fen web03"><a href="forumcp.php?action=edit&type=reward&fid=$fid">懸賞帖</a></div>
	<div class="fen web01" style="margin-top:0;"><a href="forumcp.php?action=edit&type=thread&fid=$fid">主題列表</a></div>
<div class="c"></div>
<!--
EOT;
if($isGM || pwRights($isBM,'viewcheck')){print <<<EOT
-->
<div class="fen-h1">帖子審核</div>
	<div class="fen web02"><a href="forumcp.php?action=edit&type=tcheck&fid=$fid">主題審核</a></div>
	<div class="fen web03"><a href="forumcp.php?action=edit&type=pcheck&fid=$fid">回復審核</a></div>
<div class="c"></div>
<!--
EOT;
}if($db_recycle){print <<<EOT
-->

<div class="fen-h1">回收站</div>
	<div class="fen web02"><a href="forumcp.php?action=edit&type=trecycle&fid=$fid">主題回收站</a></div>
	<div class="fen web03"><a href="forumcp.php?action=edit&type=precycle&fid=$fid">回復回收站</a></div>
<div class="c"></div>
<!--
EOT;
}if($forumset['commend']){print <<<EOT
-->

<div class="fen-h1">版主特權</div>

		<div class="fen web02"><a href="forumcp.php?action=edit&type=commend&fid=$fid">版主推薦列表</a></div>
		<div class="fen web03"><a href="forumcp.php?action=edit&type=adminset&fid=$fid">副版主任免</a></div>
<div class="c"></div>

<!--
EOT;
}elseif($forumset['commend']){print <<<EOT
-->

<div class="fen-h1">版主特權</div>

		<div class="fen web01"><a href="forumcp.php?action=edit&type=commend&fid=$fid">版主推薦列表</a></div>
<div class="c"></div>
<!--
EOT;
}elseif($first_admin){ print <<<EOT
-->
<div class="fen-h1">版主特權</div>

		<div class="fen web01"><a href="forumcp.php?action=edit&type=adminset&fid=$fid">副版主任免</a></div>
<div class="c"></div>
<!--
EOT;
}if(in_array($type,array('thread','tcheck','pcheck','trecycle','precycle'))){
$starttime && $starttime = get_date($starttime,'Y-n-j');
$endtime && $endtime = get_date($endtime,'Y-n-j');
print <<<EOT
-->
<script language="JavaScript" src="js/date.js"></script>
<form action="forumcp.php?action=edit&type=$type&fid=$fid" method="post">
<div class="fen-h1">搜索</div>

<input type="hidden" name="ptable" value="$ptable"/>
<p>用&nbsp;戶&nbsp;名&nbsp;︰<input class="input" type="text" name="username" size="15" value="$username" /></p>
<p>帖子類型︰
		<select name="t_type" style="width:105px;">
		<option value="0">全部帖子</option>
		<option value="digest" $t_type_digest>精華帖</option>
		<option value="active" $t_type_active>活動帖</option>
		<option value="reward" $t_type_reward>懸賞帖</option>
		<option value="sale" $t_type_sale>交易帖</option>
		</select>
<p>
<p>發表日期︰<input class="input" type="text" name="starttime" size="15" id="starttime" onClick="javascript:ShowCalendar(this.id)" value="$starttime"/><p>
<p style="padding-left:5em;"><input class="input" type="text" name="endtime" size="15" id="endtime" onClick="javascript:ShowCalendar(this.id)" value="$endtime"/></p>

<div class="tac"><input class="btn" type="submit" value="提 交" /></div>
</form>

<!--
EOT;
}print <<<EOT
-->
</div>
</td>
<td width="*" valign="top">


<!--
EOT;
if($type=='notice'){ print <<<EOT
-->
<form action="forumcp.php" method="post">
<input type="hidden" name="action" value="edit" />
<input type="hidden" name="type" value="n_order" />
<input type="hidden" name="verify" value="$verifyhash" />
<input type="hidden" name="fid" value="$fid" />

<table width="100%" cellspacing="0" cellpadding="0" align="center">
<tr><td class="h" colspan="9"><b>論壇公告編輯</b></td></tr>
<tr class="tr2" align="center">
<td width="5%">ID</td>
<td width="*">標題</td>
<td width="8%">順序</td>
<td width="8%">狀態</td>
<td width="10%">發布者</td>
<td width="13%">開始時間</td>
<td width="13%">結束時間</td>
<td width="30">編輯</td>
<td width="30">刪除</td>
</tr>
<!--
EOT;
$id=0;
foreach($annoucedb as $value){
$value[ifopen] = $value[ifopen] ? ($timestamp<$value[startdate] ? '未發布' : ($value[enddate] && $timestamp>$value[enddate] ? '已過期' : '已發布')) : '已關閉';
$id++;print <<<EOT
-->
<tr class="tr3" align="center">
<td>$id</td>
<td align="left">$value[subject]</td>
<td><input class="input" name="vieworder[$value[aid]]" value="$value[vieworder]" size="8"></td>
<td>$value[ifopen]</td>
<td>$value[author]</td>
<td>$value[starttime]</td>
<td>$value[endtime]</td>
<td><a href="forumcp.php?action=edit&type=edit&fid=$fid&aid=$value[aid]" class="fourm-two" title="編輯"><span class="edit"></span></a></td>
<td><a style="cursor:pointer;" onclick="return delnotice('$value[aid]')" class="fourm-two" title="刪除"><span class="del"></span></td></tr>
<!--
EOT;
}print <<<EOT
-->
<tr><td colspan="9" style="padding:5px;">$pages</td></tr>
<tr><td colspan="2"></td><td colspan="7" style="padding:5px;"><input class="btn" type="submit" name="add" value="提 交" /></td></tr>
</table>
</form>
<script language="JavaScript">
function delnotice(aid) {
	if (!aid || !confirm('確定要刪除此公告嗎？')) {
		return false;
	}
	location.href = 'forumcp.php?action=edit&type=n_del&fid=$fid&verify=$verifyhash&aid=' + aid;
	return true;
}
</script>
<!--
EOT;
}elseif(in_array($type,array('add','edit'))){print <<<EOT
-->
<form name="FORM" method="post" action="forumcp.php?">
<input type="hidden" name="verify" value="$verifyhash" />
<input type="hidden" name="action" value="$action">
<input type="hidden" name="type" value="$type">
<input type="hidden" name="fid" value="$fid">
<input type="hidden" name="aid" value="$aid">
<input type="hidden" name="step" value="2">

<table width="100%" cellspacing="0" cellpadding="0">
<tr><td class="h">&nbsp;</td><td colspan="2" class="h">更新公告信息</td></tr>
<tr class="tr3"><td width="130" class="tar gray">是否開啟︰</td>
<td colspan="2"><input type="radio" name="ifopen" value="1" $ifopen_Y> 開啟
<input type="radio" name="ifopen" value="0" $ifopen_N> 關閉</td></tr>
<tr class="tr3"><td class="tar gray">公告標題︰</td>
<td colspan="2"><input class="input" name="atc_title" value="$subject" size="35"></td></tr>
<tr class="tr3"><td class="tar gray">起始日期︰<br />結束日期︰</td>
<td width="120"><input class="input" name="startdate" value="$startdate" size="15" style="margin-bottom:8px;"><br /><input class="input" name="enddate" value="$enddate" size="15">
</td><td>格式︰(YYYY-MM-DD HH:II，如︰1983-12-20 00:00)。<br />起始時間︰公告開始發布的時間，留空則使用當前時間。<br />
結束時間︰公告結束發布的時間，留空則公告不結束。</td></tr>
<tr class="tr3"><td class="tar gray">顯示順序︰</td>
<th colspan="2"><input class="input" name="vieworder" value="$vieworder" size="35"></th></tr>
<tr class="tr3"><td valign="top" class="tar gray">公告內容︰<br />
<span class="s4">不支持 html 代碼</span></td>
<th colspan="2">
<!--
EOT;
include_once(R_P.'template/wind/editor.htm');print <<<EOT
-->
</th></tr>
<tr><td></td><td style="padding:5px;" colspan="2"><input class="btn" type="submit" name="add" value="提 交" /></td></tr>
</table>
</form>
<script language="JavaScript" src="js/wind_editor.js"></script>
<!--
EOT;
}elseif($type=='report'){ print <<<EOT
-->
<form action="forumcp.php" method="post">
<input type="hidden" name="verify" value="$verifyhash" />
<table width="100%" align="center" cellspacing="0" cellpadding="0">
<tr><td class="h" colspan="7"><b>會員報告帖處理</b></td></tr>
<tr class="tr2">
<td width="6%" class="tac">ID</td>
<td width="16%">論壇</td>
<td width="10%">帖子位置</td>
<td width="15%">反映用戶</td>
<td>&nbsp;原因︰</td>
<td width="10%">報告類型︰</td>
<td width="6%">刪除</td>
</tr>
<!--
EOT;
$id=0;
foreach($reportdb as $report){
$id++;
print <<<EOT
-->
<tr class="tr3">
<td class="tac">$id</td>
<td><a href="thread.php?fid=$report[fid]" target="_blank">$report[fname]</a></td>
<td><a href="read.php?tid=$report[tid]#$report[pid]" target="_blank">進入帖子</a></td>
<td>$report[username]</td>
<td>&nbsp;$report[reason]</td>
<!--
EOT;
if($report[type]==1){ print <<<EOT
-->
<td>&nbsp;優秀帖子</td>
<!--
EOT;
}else{ print <<<EOT
-->
<td>&nbsp;不良帖子</td>
<!--
EOT;
} print <<<EOT
-->
<td><input type="checkbox" name="selid[]" value="$report[id]" /></td></tr>
<!--
EOT;
}print <<<EOT
-->
<tr><td colspan="7" style="padding:5px;">$pages</td></tr>
<tr><td colspan="3"></td><td colspan="4" style="padding:5px;"><input class="bt" type="button" name="chkall" value="全 選" onclick="CheckAll(this.form)" />
<input class="btn" type="submit" name="add" value="提 交" /></td></tr>
</table>
<input type="hidden" name="action" value="del" />
<input type="hidden" name="fid" value="$fid" />
<input type="hidden" name="type" value="report" />
</form>
<!--
EOT;
}elseif($type=='f_type'){ print <<<EOT
-->
<form action="forumcp.php" method="post">
<input type="hidden" name="verify" value="$verifyhash" />

<table width="100%" align="center" cellspacing="0" cellpadding="0">
<tr><td class="h">&nbsp;</td><td class="h"><b>版塊主題分類</b></td></tr>
<tr class="tr3">
	<td width="200" class="tar gray">[添加主題類型]</td>
	<th>
		<input type="radio" value="1" $addtpctype_Y name="addtpctype" /> 是
		<input type="radio" value="0" $addtpctype_N name="addtpctype" /> 否 （主題列表頁面）
	</th>
</tr>
<tr class="tr3">
	<td class="tar gray">普通會員主題分類管理</td>
	<th>
		<input type="radio" value="2" $t_type_2 name="t_db[0]" /> 強制分類
		<input type="radio" value="1" $t_type_1 name="t_db[0]" /> 允許分類
		<input type="radio" value="0" $t_type_0 name="t_db[0]" /> 關閉分類
	</th>
</tr>
<!--
EOT;
foreach ($t_typedb as $key => $value){
if($key == 0) continue;
print <<<EOT
-->
<tr class="tr3">
	<td class="tar gray">分類 <font color="green"><b>$key</b></font> 名稱 </td>
	<th><input class="input" type="text" size="30" maxLength="25" value="$value" name="t_db[$key]" /></th>
</tr>
<!--
EOT;
}print <<<EOT
-->
<tbody id="tbody"></tbody>
<tr class="tar gray">
	<td class="tar"><a style="cursor:pointer;color:blue" onclick="addtype();">[添加主題類型]</a></td>
	<th></th>
</tr>
<tbody id="tmode" style="display:none"><tr class="tr3"><td class="tar gray">新增加的分類</td><td><input type="text" class="input" size="30" maxLength="25" value="" name="new_t_db[]" /></td></tr></tbody>
<script language="JavaScript">
function addtype(){
	var s = getObj('tmode').firstChild.cloneNode(true);
	getObj('tbody').appendChild(s);
}
</script>
<tr><td></td><td style="padding:5px;"><input class="btn" type="submit" name="add" value="提 交" /></td></tr>
</table>
<input type="hidden" name="action" value="edit" />
<input type="hidden" name="type" value="f_type" />
<input type="hidden" name="fid" value="$fid" />
<input type="hidden" name="step" value="3" />
</form>
<!--
EOT;
}elseif($type=='reward'){print <<<EOT
-->
<form action="forumcp.php" method="post">

<table width="100%" align="center" cellspacing="0" cellpadding="0">
<tr><td class="h" colspan="7"><b>懸賞帖到期處理</b></td></tr>
<tr class="tr2">
<td width="6%" class="tac">ID</td>
<td width="*">懸賞主題</td>
<td width="12%">懸賞作者</td>
<td width="12%">&nbsp;懸賞時間</td>
<td width="15%">論壇</td>
<td width="12%">最佳答案獎勵</td>
<td width="12%">熱心助人獎勵</td>
</tr>
<!--
EOT;
$i=($page-1)*$db_perpage;
foreach($threaddb as $key=>$thread){
$i++;
print <<<EOT
-->
<tr class="tr3">
<td class="tac">$i</td>
<td align="left"><a href="read.php?tid=$thread[tid]" target="_blank">$thread[subject]</a></td>
<td><a href="u.php?action=show&uid=$thread[authorid]" target="_blank">$thread[author]</a></td>
<td>$thread[postdate]</td>
<td><a href="thread.php?fid=$fid">{$forum[$fid][name]}</a></td>
<td>$thread[binfo]</td>
<td>$thread[ainfo]</td>
</tr>
<!--
EOT;
}print <<<EOT
-->
</table>
<div style="padding:5px">$pages</div>
<!--
EOT;
}elseif($type=='thread'){ print <<<EOT
-->
<form action="mawhole.php" method="post">

<table width="100%" align="center" cellspacing="0" cellpadding="0">
<tr><td class="h" colspan="7"><b></b></td></tr>
<tr class="tr2">
	<td width="6%"></td>
	<td class="tac">標題</td>
	<td width="15%">作者</td>
	<td width="20%">發表日期</td>
</tr>
<!--
EOT;
foreach($threaddb as $key=>$thread){print <<<EOT
-->
<tr class="tr3">
	<td class="tac"><input type="checkbox" name="tidarray[]" value="$thread[tid]" /></td>
	<th>
<!--
EOT;
if($thread[topped]){print <<<EOT
-->
<img src="$imgpath/$stylepath/file/headtopic_$thread[topped].gif" alt="置頂帖標志" />
<!--
EOT;
}print <<<EOT
-->
		<a href="read.php?tid=$thread[tid]" target="_blank">$thread[subject]</a>
<!--
EOT;
if($thread[digest]){ print <<<EOT
-->
<img src="$imgpath/$stylepath/file/digest_$thread[digest].gif" alt="精華帖標志" />
<!--
EOT;
}print <<<EOT
-->
		</th>
	<td><a href="u.php?action=show&uid=$thread[authorid]">$thread[author]</td>
	<td>$thread[postdate]</td>
</tr>
<!--
EOT;
}print <<<EOT
-->
</table>
<div style="padding:5px;">$pages</div>
<input type="hidden" name="action" value="del" />
<input type="hidden" name="fid" value="$fid" />
<div style="padding:5px;" class="tac">
<input class="bt" type="button" name="chkall" value="全 選" onclick="CheckAll(this.form)" />
<input class="btn" type="submit" name="hello" value="刪除所選項" /></div></form>
<!--
EOT;
}elseif($type=='tcheck'){print <<<EOT
-->
<form action="forumcp.php" method="post">
<input type="hidden" name="verify" value="$verifyhash" />
<table width="100%" align="center" cellspacing="0" cellpadding="0">
<tr><td class="h" colspan="7"><b>主題審核</b></td></tr>
<tr class="tr2">
	<td width="5%"></td>
	<td>標題</td>
	<td width="15%">作者</td>
	<td width="20%">發表日期</td>
</tr>
<!--
EOT;
foreach($threaddb as $key=>$thread){print <<<EOT
-->
<tr class="tr3">
	<td><input type="checkbox" name="selid[]" value="$thread[tid]" /></td>
	<th onmouseover="this.className='f_two'" onmouseout="this.className='f_one'" onclick="content('$thread[tid]');"><a href="read.php?tid=$thread[tid]" target="_blank">$thread[subject]</a></th>
	<td><a href="u.php?action=show&uid=$thread[authorid]">$thread[author]</td>
	<td>$thread[postdate]</td>
</tr>
<tr class="tr3" id="content_$thread[tid]" style="display:none;"><td colspan="4" style="padding:5px 10px">$thread[content]</td></tr>
<!--
EOT;
}print <<<EOT
-->
</table>
<div style="padding:5px;">$pages</div>
<input type="hidden" name="action" value="$action" />
<input type="hidden" name="type" value="$type" />
<input type="hidden" name="fid" value="$fid" />
<div style="text-align:center;padding:5px;line-height:30px;">
<input type="radio" name="step" value="3" checked /> 審核 <input type="radio" name="step" value="5" /> 刪除<br />
<input class="bt" type="button" name="chkall" value="全 選" onclick="CheckAll(this.form)" />
<input class="btn" type="submit" name="hello" value="提 交" /> </div></form>
<!--
EOT;
}elseif($type=='pcheck'){print <<<EOT
-->
<form action="forumcp.php" method="post">
<input type="hidden" name="verify" value="$verifyhash" />
<table width="100%" align="center" cellspacing="0" cellpadding="0">
<tr><td class="h" colspan="7">
<!--
EOT;
if($db_plist){print <<<EOT
-->
<select onchange="window.location=('forumcp.php?action=$action&type=$type&fid=$fid&ptable='+this.value);" class="fr" name="ptable">$p_table</select>
<!--
EOT;
}print <<<EOT
-->
<b>回復審核</b></td></tr>
<tr class="tr2">
	<td width="6%"></td>
	<td>標題</td>
	<td width="15%">作者</td>
	<td width="20%">發表日期</td>
</tr>
<!--
EOT;
foreach($postdb as $key=>$post){print <<<EOT
-->
<tr class="tr3">
	<td class="tac"><input type="checkbox" name="selid[]" value="$post[pid]" /></td>
	<th onmouseover="this.className='f_two'" onmouseout="this.className='f_one'" onclick="content('$post[pid]');"><a href="job.php?action=topost&tid=$post[tid]&pid=$post[pid]" target="_blank">$post[subject]</a></th>
	<td><a href="u.php?action=show&uid=$post[authorid]">$post[author]</td>
	<td>$post[postdate]</td>
</tr>
<tr class="tr3" id="content_$post[pid]" style="display:none;"><td colspan="4" style="padding:5px 10px">$post[content]</td></tr>
<!--
EOT;
}print <<<EOT
-->
</table>
<div style="padding:5px;">$pages</div>
<input type="hidden" name="action" value="$action" />
<input type="hidden" name="type" value="$type" />
<input type="hidden" name="fid" value="$fid" />
<div style="text-align:center;padding:5px;line-height:30px;">
<input type="radio" name="step" value="3" checked /> 審核 <input type="radio" name="step" value="5" /> 刪除<br />
<input class="bt" type="button" name="chkall" value="全 選" onclick="CheckAll(this.form)" />
<input class="btn" type="submit" name="hello" value="回復審核" /></div></form>
<!--
EOT;
}elseif($type=='commend'){print <<<EOT
-->
<form action="forumcp.php" method="post">
<input type="hidden" name="verify" value="$verifyhash" />
<table width="100%" align="center" cellspacing="0" cellpadding="0">
<tr><td class="h" colspan="7"><b>版主推薦列表</b></td></tr>
<tr class="tr2">
	<td width="5%" class="tac">ID</td>
	<td>標題</td>
	<td width="15%">作者</td>
	<td width="20%">發表日期</td>
	<td width="6%"></td>
</tr>
<!--
EOT;
$i=0;
foreach($commend as $key=>$thread){
$i++;
print <<<EOT
-->
<tr class="tr3">
	<td class="tac">$i</td>
	<th><a href="read.php?tid=$thread[tid]" target="_blank">$thread[subject]</a></th>
	<td><a href="u.php?action=show&uid=$thread[authorid]">$thread[author]</td>
	<td>$thread[postdate]</td>
	<td class="tac"><input type="checkbox" name="selid[]" value="$thread[tid]" /></td>
</tr>
<!--
EOT;
}print <<<EOT
-->
</table>
<input type="hidden" name="action" value="$action" />
<input type="hidden" name="type" value="$type" />
<input type="hidden" name="fid" value="$fid" />
<input type="hidden" name="step" value="2" />
<div style="text-align:center;padding:5px;">
<input class="bt" type="button" name="chkall" value="全 選" onclick="CheckAll(this.form)" />
<input class="btn" type="submit" name="hello" value="刪除所選項" /></div></form>
<!--
EOT;
}elseif($type=='adminset'){print <<<EOT
-->
<form action="forumcp.php?action=edit&type=$type" method="post">
<input type="hidden" name="verify" value="$verifyhash" />
<table width="100%" cellspacing="0" cellpadding="0" align="center">
	<tr><td colspan="2" class="h"><b>副版主任免</b></td></tr>
	<tr class="tr3">
		<td width="30%">第一版主</td>
		<td>$firstadmin</td>
	</tr>
	<tr class="tr3">
		<td width="30%">版主</td>
		<td><input class="input" type="text" name="forumadmin" value="$s_admin" size="40" /></td>
	</tr>
</table>
<input type="hidden" name="fid" value="$fid" />
<input type="hidden" name="step" value="3" />
<div class="tac" style="padding:5px;"><input class="btn" type="submit" name="hello" value="提 交" /></div></form>
<!--
EOT;
}elseif($type=='trecycle' && $db_recycle){print <<<EOT
-->
<form action="forumcp.php" method="post">
<input type="hidden" name="verify" value="$verifyhash" />
<table width="100%" align="center" cellspacing="0" cellpadding="0">
<tr><td class="h" colspan="5"><b>主題回收站</b></td></tr>
<tr class="tr2">
<!--
EOT;
if($forumset[recycle]){print <<<EOT
-->
	<td width="5%">選擇</td>
<!--
EOT;
}print <<<EOT
-->
	<td>標題</td>
	<td width="12%">作者</td>
	<td width="12%">管理員</td>
	<td width="15%">刪除日期</td>
</tr>
<!--
EOT;
foreach($recycledb as $key=>$thread){print <<<EOT
-->
<tr class="tr3">
<!--
EOT;
if($forumset[recycle]){print <<<EOT
-->
	<td><input type="checkbox" name="ids[]" value="$thread[tid]" /></td>
<!--
EOT;
}print <<<EOT
-->
	<th style="cursor:pointer" onclick="content('$thread[tid]');">$thread[subject]</th>
	<td><a href="u.php?action=show&uid=$thread[authorid]">$thread[author]</a></td>
	<td>$thread[admin]</td>
	<td>$thread[deltime]</td>
</tr>
<tr class="tr3" id="content_$thread[tid]" style="display:none;"><td colspan="5" style="background:$bgcolor" style="padding:5px 10px">$thread[content]</td></tr>
<!--
EOT;
}print <<<EOT
-->
</table>
<div style="padding:5px;">$pages</div>
<input type="hidden" name="action" value="$action" />
<input type="hidden" name="type" value="$type" />
<input type="hidden" name="fid" value="$fid" />
<div style="text-align:center;padding:5px;">
<!--
EOT;
if($forumset['recycle']){print <<<EOT
-->
<input class="bt" type="button" name="chkall" value="全 選" onclick="CheckAll(this.form)" />
<input class="btn" type="submit" name="hello" value="提 交" onclick="return Psubmit(this.form)"/>
<select name="step">
	<option value="0">選擇操作</option>
<!--
EOT;
}if($forumset[recycle] & 2){print <<<EOT
-->
	<option value="1">刪除帖子</option>
<!--
EOT;
}if($forumset[recycle] & 4){print <<<EOT
-->
	<option value="2">還原帖子</option>
<!--
EOT;
}if($forumset[recycle] & 8){print <<<EOT
-->
	<option value="3">清空帖子</option>
<!--
EOT;
}print <<<EOT
-->
</select>
</div></form>
<!--
EOT;
}elseif($type=='precycle' && $db_recycle){print <<<EOT
-->
<form action="forumcp.php" method="post" name="FORM">
<input type="hidden" name="verify" value="$verifyhash" />
<table width="100%" align="center" cellspacing="0" cellpadding="0">
<tr><td class="h" colspan="5">
<!--
EOT;
if($db_plist){print <<<EOT
-->
<select onchange="window.location=('forumcp.php?action=$action&type=$type&fid=$fid&ptable='+this.value);" class="fr" name="ptable">$p_table</select>
<!--
EOT;
}print <<<EOT
-->
<b>回復回收站</b></td></tr>
<tr class="tr2">
<!--
EOT;
if($forumset[recycle]){print <<<EOT
-->
	<td width="5%">選擇</td>
<!--
EOT;
}print <<<EOT
-->
	<td>標題</td>
	<td width="12%">作者</td>
	<td width="12%">管理員</td>
	<td width="15%">刪除日期</td>
</tr>
<!--
EOT;
foreach($recycledb as $key=>$posts){print <<<EOT
-->
<tr class="tr3">
<!--
EOT;
if($forumset[recycle]){print <<<EOT
-->
	<td><input type="checkbox" name="ids[]" value="$posts[pid]" /></td>
<!--
EOT;
}print <<<EOT
-->
	<th style="cursor:pointer" onmouseover="this.className='f_two'" onmouseout="this.className='f_one'" onclick="content('$posts[pid]');">$posts[subject](<a href="read.php?tid=$posts[tid]" target="_blank">查看主題帖</a>)</th>
	<td><a href="u.php?action=show&uid=$posts[authorid]">$posts[author]</a></td>
	<td>$posts[admin]</td>
	<td>$posts[deltime]</td>
</tr>
<tr class="tr3" id="content_$posts[pid]" style="display:none;"><td colspan="5" style="padding:5px 10px">$posts[content]</td></tr>
<!--
EOT;
}print <<<EOT
-->
</table>
<div style="padding:5px;">$pages</div>
<input type="hidden" name="action" value="$action" />
<input type="hidden" name="type" value="$type" />
<input type="hidden" name="fid" value="$fid" />
<div style="text-align:center;padding:5px;">
<!--
EOT;
if($forumset[recycle]){print <<<EOT
-->
<input class="bt" type="button" name="chkall" value="全 選" onclick="CheckAll(this.form)" />
<input class="btn" type="submit" name="hello" value="提 交" onclick="return Psubmit(this.form)"/>
<select name="step">
	<option value="0">選擇操作</option>

<!--
EOT;
}if($forumset[recycle] & 2){print <<<EOT
-->
	<option value="1">刪除回復</option>
<!--
EOT;
}if($forumset[recycle] & 4){print <<<EOT
-->
<option value="2">還原回復</option>
<!--
EOT;
}if($forumset[recycle] & 8){print <<<EOT
-->
<option value="3">清空回復</option>
<!--
EOT;
}print <<<EOT
-->
</select>
</div></form>
<!--
EOT;
}elseif($type=='addmsg'){
$adminsel = '<input type="checkbox" name="msgtype" value="1" checked>所有版主';
foreach ($adminname as $val) {
	if($val!=$windid && $val){
		$adminsel .= "<input type=\"checkbox\" name=\"toname[]\" value=\"$val\">$val";
	}
}
print <<<EOT
-->
<form name="FORM" method="post" action="forumcp.php?">
<input type="hidden" name="verify" value="$verifyhash" />
<input type="hidden" name="action" value="$action">
<input type="hidden" name="type" value="$type">
<input type="hidden" name="fid" value="$fid">
<input type="hidden" name="step" value="2">

<table width="100%" cellspacing="0" cellpadding="0">
<tr><td class="h">&nbsp;</td><td colspan="2" class="h">添加內部留言</td></tr>
<tr class="tr3"><td class="tar gray">留言對象</td>
<td colspan="2">$adminsel  （管理員及總版主不受限制）</td></tr>
<tr class="tr3"><td class="tar gray">有效期時間至</td>
<th colspan="2"><input class="input" name="savetime" value="30" size="4"> 天 （請輸入整數）</th></tr>
<tr class="tr3"><td valign="top" class="tar gray">留言內容</td>
<th colspan="2">
<textarea class="input" name="message" rows="5" cols="70"></textarea>
</th></tr>
<tr><td></td><td style="padding:5px;" colspan="2"><input class="btn" type="submit" name="add" value="提 交" /></td></tr>
</table>
</form>
<!--
EOT;
}elseif($type=='msg'){ print <<<EOT
-->
<form action="forumcp.php" method="post">
<input type="hidden" name="verify" value="$verifyhash" />
<table width="100%" align="center" cellspacing="0" cellpadding="0">
<tr><td class="h" colspan="5"><b>內部留言管理</b></td></tr>
<tr class="tr2">
	<td width="8%"></td>
	<td>留言人</td>
	<td>留言時間</td>
	<td>有效期時間至</td>
</tr>
<!--
EOT;
foreach($msgdb as $key=>$val){
print <<<EOT
-->
<tr class="tr3">
	<td><input type="checkbox" name="ids[]" value="$val[id]" $val[ifuse]/></td>
	<th style="cursor:pointer" onclick="content('$val[id]');">$val[username]</th>
	<td style="cursor:pointer" onclick="content('$val[id]');">$val[posttime]</td>
	<td>$val[savetime]</td>
</tr>
<tr class="tr3" id="content_$val[id]"><td colspan="5" style="background:$bgcolor" style="padding:5px 10px">$val[message]</td></tr>
<!--
EOT;
}print <<<EOT
-->
</table>
<div style="padding:5px;">$pages</div>
<input type="hidden" name="action" value="$action" />
<input type="hidden" name="type" value="$type" />
<input type="hidden" name="fid" value="$fid" />
<div style="text-align:center;padding:5px;">
<input class="bt" type="button" name="chkall" value="全 選" onclick="CheckAll(this.form)" />
<input class="btn" type="submit" name="demsg" value="提 交"/>
</div></form>
<!--
EOT;
}print <<<EOT
-->
</td></tr>
</table></div>
<script language="JavaScript">
function CheckAll(form){
	for(var i=0;i<form.elements.length-2;i++){
		var e = form.elements[i];
		if(e.type=='checkbox') e.checked = e.checked == true ? false : true;
	}
}
function content(id){
	var o = getObj('content_'+id);
	o.style.display = o.style.display == 'none' ? '' : 'none';
}
function Psubmit(form){
	switch(form.step.value){
		case '0':
			alert('請先選擇操作,再提交');
			break;
		case '1':
			return confirm('您確認要進行刪除操作嗎?');
			break;
		case '2':
			return confirm('您確認要進行還原操作嗎?');
			break;
		case '3':
			return confirm('您確認要對該版塊進行清除操作嗎?');
			break;
	}
	return false;
}
</script>
<!--
EOT;
}?>-->