<!--<?php
include_once PrintEot('left');
print <<<EOT
-->
<!-- <h2 class="h1 mb10"><a href="$admin_file?adminjob=app&admintype=appslist">返回基礎應用列表</a></h2>-->
<div class="admin_info mb10">
  <h3 class="h1"><b>提示信息</b></h3>
  <div class="legend">
    <ul>
      <ol><li>刪除符合條件的帖子用于清理站點冗余數據,此操作不可恢復,請謹慎使用！</li><li>用戶組成員根據用戶組權限設置取得相應批量刪除權限</li><li>版主擁有所管轄的版塊（分類）發布的批量刪除的權限<br /><span class="s1">功能說明</span>:<br/>使用<font color=blue>刪除主題</font>功能可刪除某個會員發表的所有主題(包括回復)<br />使用<font color=blue>刪除回復</font>功能可刪除某個會員發表的所有回復</li></ol>
    </ul>
  </div>
</div>
<!--
EOT;
if(empty($action)){
print <<<EOT
-->
<div class="nav3 mb10">
	<ul class="cc">
		<li class="current"><a href="$basename">帖子管理</a></li>
		<li><a href="$basename&action=replylist">回復管理</a></li>
	</ul>
</div>
<script type="text/javascript" src="js/date.js"></script>

<form action="$basename&" method=post>
  <h2 class="h1">帖子搜索</h2>
  <div class="admin_table mb10">
	<table cellpadding="0" cellspacing="0" width="100%">
<!--
EOT;
	if($db_sphinx['isopen'] == 1){
print <<<EOT
-->

    <tr class="tr1 vt">
      <td class="td1">使用全文索引搜索</td>
      <td class="td2"><input type="checkbox" name="sphinx" id="sphinxopen" value="1" $sphinxChecked />開啟&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;sphinx開啟之後才會顯示該功能,使用全文索引將加快搜索速度.關鍵字如果為空將使用普通搜索方式
      </td>
    </tr>
    <tr class="tr1 vt">
      <td class="td1">全文索引搜索帖子搜索範圍</td>
      <td class="td2">
        <div class="list_A">
            <ul class="cc">
                <li><input type="radio" name="sphinxRange" value="1" $threadChecked />主題標題</li>
                <li><input type="radio" name="sphinxRange" value="2" $threadMsgChecked />主題標題與主題內容</li>
            </ul>
        </div>
      </td>
    </tr>
<!--
EOT;
	}
print <<<EOT
-->
    <tr class="tr1 vt">
      <td class="td1">關鍵字</td>
      <td class="td2"><input type="text" class="input input_wa mr20" name="keyword" value="$keyword">可使用通配符 "*"，多個關鍵字用英文半角逗號","分隔</td>
    </tr>
    <tr class="tr1 vt">
      <td class="td1">所屬版塊</td>
      <td class="td2"><select name="fid"  class="select_wa mr20 fl">
          <option value='-1'>所有版塊</option>$forumcache</select>
         <input type="checkbox" name="ifkeep" value="1" {$ifkeep_Y}>
        保留精華置頂
        </td>
    </tr>
<!--
EOT;
if(!$db_merge_tmsgs && $threadTableSelections){
print <<<EOT
-->
    <tr class="tr1 vt">
      <td class="td1">分表數據庫</td>
      <td class="td2">$threadTableSelections</td>
    </tr>
<!--
EOT;
}print <<<EOT
-->
    <tr class="tr1 vt">
      <td class="td1">用戶名</td>
      <td class="td2"><input type="text" class="input input_wa mr20" name="author" value="$author">可使用通配符 "*"，多個用戶名用英文半角逗號","分隔</td>
    </tr>
    <tr class="tr1 vt">
      <td class="td1">UID</td>
      <td class="td2"><input type="text" class="input input_wa mr20" name="authorid" value="$authorid">多個UID用英文半角逗號","分隔</td>
    </tr>
    <tr class="tr1 vt">
      <td class="td1">主題發表時間</td>
      <td class="td2">
        <div class="input_img fl"><i onclick="this.nextSibling.onclick()" class="input_time" title="選擇時間">選擇時間</i><input type="text" name="pstarttime" id="pstarttime" value="$pStartString" onClick="javascript:ShowCalendar(this.id)" /></div><span class="p_lr_10 fl">至</span><div class="input_img fl mr20"><i class="input_time" onclick="this.nextSibling.onclick()" title="選擇時間">選擇時間</i><input type="text" name="pendtime" id="pendtime" value="$pEndString" onClick="javascript:ShowCalendar(this.id)" /></div>可只用單個條件
      </td>
    </tr>

    <tbody id="advanceSearchBody" style="display:$searchDisplay;">
    <tr class="tr1 vt" id="condition_0">
      <td class="td1">主題最後被回復時間</td>
      <td class="td2">
      <div class="input_img fl"><i onclick="this.nextSibling.onclick()" class="input_time" title="選擇時間">選擇時間</i><input type="text" name="lstarttime" id="lstarttime" value="$lStartString" onClick="javascript:ShowCalendar(this.id)" /></div><span class="p_lr_10 fl">至</span><div class="input_img fl mr20"><i class="input_time " onclick="this.nextSibling.onclick()" title="選擇時間">選擇時間</i><input type="text" name="lendtime" id="lendtime" value="$lEndString" onClick="javascript:ShowCalendar(this.id)" /></div>可只用單個條件
      </td>
    </tr>
    <tr class="tr1 vt">
      <td class="td1">指定 tid 範圍</td>
      <td class="td2">
      <input type="text" class="input input_wa" name="tstart" value="$tstart"><span class="p_lr_10">-</span><input type="text" class="input input_wa mr20" name="tend" value="$tend"> 可只用單個條件
      </td>
    </tr>
    <tr class="tr1 vt">
      <td class="td1">瀏覽人數小于</td>
      <td class="td2"><input type="text" class="input input_wa mr20" maxlength=14 name="hits" value="$hits"><!-- 的主題 --></td>
    </tr>
    <tr class="tr1 vt">
      <td class="td1">回復人數小于</td>
      <td class="td2"><input type="text" class="input input_wa mr20" maxlength=14 name="replies" value="$replies"><!-- 的主題 --></td>
    </tr>
    <tr class="tr1 vt">
      <td class="td1">內容大于[字節]</td>
      <td class="td2"><input type="text" class="input input_wa mr20" name="tcounts" value="$tcounts"></td>
    </tr>
    <tr class="tr1 vt">
      <td class="td1">內容少于[字節]</td>
      <td class="td2"><input type="text" class="input input_wa mr20" name="counts" value="$counts"></td>
    </tr>
    <tr class="tr1 vt">
      <td class="td1">根據用戶IP查找</td>
      <td class="td2"><input type="text" class="input input_wa mr20" name="userip" value="$userip">可使用通配符 "*"</td>
    </tr>
    </tbody>

    <tr class="tr3">
      <td class="td1"><div id="info1">每頁顯示行數</div></td>
      <td class="td2">
        <input type="text" class="input input_wa mr20" name="lines" value="$lines">
        <!--
      <input type="checkbox" name="direct" value=1 onclick="deldirect(this.form,'info1','每頁顯示行數');">
    直接刪除(直接刪除符合條件的項目)
     -->
        </td>
    </tr>
  </table>
  </div>
	<div class="mb10 tac">
		<span class="mr10"><span class="btn"><span><button type="submit">提 交</button></span></span></span>
		<a href="javascript:;" id="advanceSearchButton">高級搜索<input type="hidden" id="searchDisplay" name="searchDisplay" value="$searchDisplay"></a>
	</div>
</form>
<script type="text/javascript">
getObj('advanceSearchButton').onclick = function() {
	displayElementConflict('advanceSearchBody','advanceSearchButton');
	if(getObj('searchDisplay')){
		getObj('searchDisplay').value = getObj('advanceSearchBody').style.display;
	}
};
function displayElementConflict(elementId,buttonId,isDisplay) {
	if (undefined == isDisplay && typeof buttonId === 'string') {
		getObj(elementId).style.display = getObj(elementId).style.display == 'none' ? '' : 'none';
		getObj(buttonId).innerHTML = getObj(elementId).style.display == ''? '簡單搜索' : '高級搜索';
	} else {
		getObj(elementId).style.display = isDisplay ? '' : 'none';
	}
}
if (null != getObj('sphinxopen')) {
	getObj('sphinxopen').onclick = function() {
		var isSphinxOpen = getObj('sphinxopen').checked == 1;
		displayElement('advanceSearchButton', !isSphinxOpen);
		if (isSphinxOpen) {
			displayElement('advanceSearchBody', false);
			getObj('searchDisplay').value = getObj('advanceSearchBody').style.display;
		}
	}
	var isSphinxOpen = getObj('sphinxopen').checked == 1;
	displayElement('advanceSearchButton', !isSphinxOpen);
}
</script>

<form action="$basename&action=deltpc" method="post" name="del_tpc_form"  id="del_tpc_form">
  <input type="hidden" name="ttable" value="$ttable">
  <input type="hidden" name="fid" value="$fid">
  <input type="hidden" name="ifkeep" value="$ifkeep">
  <input type="hidden" name="pstarttime" value="$pstarttime">
  <input type="hidden" name="pendtime" value="$pendtime">
  <input type="hidden" name="lstarttime" value="$lstarttime">
  <input type="hidden" name="lendtime" value="$lendtime">
  <input type="hidden" name="tstart" value="$tstart">
  <input type="hidden" name="tend" value="$tend">
  <input type="hidden" name="hits" value="$hits">
  <input type="hidden" name="replies" value="$replies">
  <input type="hidden" name="author" value="$author">
   <input type="hidden" name="authorid" value="$authorid">
  <input type="hidden" name="keyword" value="$keyword">
  <input type="hidden" name="userip" value="$userip">
  <input type="hidden" name="lines" value="$lines">
  <input type="hidden" name="tcounts" value="$tcounts">
  <input type="hidden" name="counts" value="$counts">
  <input type="hidden" name="page" value="$page">
  <input type="hidden" name="sphinx" value="$sphinx">
  <input type="hidden" name="sphinxRange" value="$sphinxRange">
  <input type="hidden" name="step" value="2">
    <h3 class="h1">帖子列表</h3>
    <div class="admin_table mb10">
		<table cellpadding="0" cellspacing="0" width="100%">
          <tr class="tr2 vt td_bgB">
            <td width="24"><span onclick="CheckAll(document.del_tpc_form)" class="cp">全選</span></td>
            <td>標題</td>
            <td width="70">作者</td>
            <td width="100">發表時間</td>
            <td width="95">IP</td>
            <td width="80">版塊</td>
            <td width="24">回復</td>
            <td width="24">人氣</td>
          </tr>
<!--
EOT;
if (empty($topicdb)) {print <<<EOT
-->
<tr><td class="p10" colspan="8"><div class="admin_tips">啊哦，沒有你要的信息！</div></td></tr>
<!--
EOT;
}else{
	foreach($topicdb as $key=>$topic){
		if(!$topic[subject])continue;
print <<<EOT
-->
          <tr class="tr1 vt">
            <td class="td2"><input type="checkbox" name="delid[$topic[tid]]" value="$topic[fid]"></td>
            <td class="td2"><p class="lh_18"><a href="read.php?fid=$topic[fid]&tid=$topic[tid]" target="_blank" title="$topic[subject]">$topic[subject]</a></p></td>
            <td class="td2"><a href="{$db_userurl}$topic[authorid]" target=_blank>$topic[author]</a></td>
            <td class="td2">$topic[postdate]</td>
            <td class="td2">$topic[userip]</td>
            <td class="td2"><p class="lh_18"><a href="thread.php?fid=$topic[fid]" target="_blank">$topic[forumname]</a></p></td>
            <td class="td2">$topic[replies]</td>
            <td class="td2">$topic[hits]</td>
          </tr>
<!--
EOT;
}}
print <<<EOT
-->
        </table>
    </div>
  <div class="cc mb10">$pages</div>
  <div class="mb10 tac">
	<div class="mb5">扣除積分︰<input type="radio" name="delcredit" value="1" /> 是 <input type="radio" name="delcredit" value="0" checked /> 否</div>
	<span class="bt"><span><button type="button" onclick="CheckAll(document.del_tpc_form)">全 選</button></span></span>
	<span class="btn"><span><button type="submit">刪 除</button></span></span>
   </div>
</form>
<!-- for get to post  -->
<form action="$basename&action=" method="post" name="superdel_tpc"  id="superdel_tpc">
  <input type="hidden" name="ttable" value="$ttable">
  <input type="hidden" name="fid" value="$fid">
  <input type="hidden" name="ifkeep" value="$ifkeep">
  <input type="hidden" name="pstarttime" value="$pstarttime">
  <input type="hidden" name="pendtime" value="$pendtime">
  <input type="hidden" name="lstarttime" value="$lstarttime">
  <input type="hidden" name="lendtime" value="$lendtime">
  <input type="hidden" name="tstart" value="$tstart">
  <input type="hidden" name="tend" value="$tend">
  <input type="hidden" name="hits" value="$hits">
  <input type="hidden" name="replies" value="$replies">
  <input type="hidden" name="author" value="$author">
  <input type="hidden" name="authorid" value="$authorid">
  <input type="hidden" name="keyword" value="$keyword">
  <input type="hidden" name="userip" value="$userip">
  <input type="hidden" name="lines" value="$lines">
  <input type="hidden" name="tcounts" value="$tcounts">
  <input type="hidden" name="counts" value="$counts">
  <input type="hidden" name="page" value="$page">
  <input type="hidden" name="sphinx" value="$sphinx">
  <input type="hidden" name="sphinxRange" value="$sphinxRange">
  <input type="hidden" name="step" value="2">
</form>
<!--
EOT;
} elseif($action=='replylist') {
print <<<EOT
-->

<div class="nav3 mb10">
	<ul class="cc">
		<li><a href="$basename">帖子管理</a></li>
		<li class="current"><a href="$basename&action=replylist">回復管理</a></li>
	</ul>
</div>
<script type="text/javascript" src="js/date.js"></script>

<form action="$basename&action=replylist" method=post>
  <h2 class="h1">搜索回復</h2>
  <div class="admin_table mb10">
	<table cellpadding="0" cellspacing="0" width="100%">
<!--
EOT;
	if($db_sphinx['isopen'] == 1){
print <<<EOT
-->
    <tr class="tr1 vt">
      <td class="td1">使用全文索引搜索</td>
      <td class="td2"><input type="checkbox" name="sphinx" value="1" $sphinxChecked id="sphinxpostopen"/>開啟 sphinx開啟之後才會顯示該功能,使用全文索引將加快搜索速度.關鍵字如果為空將使用普通搜索方式</td>
    </tr>

<!--
EOT;
	}
print <<<EOT
-->
    <tr class="tr1 vt">
      <td class="td1">關鍵字</td>
      <td class="td2"><input type="text" class="input input_wa mr20" name="keyword" value="$keyword">可使用通配符 "*"</td>
    </tr>
    <tr class="tr1 vt">
      <td class="td1">所屬版塊</td>
      <td class="td2"><select name="fid" class="select_wa">
          <option value='-1'>所有版塊</option>$forumcache</select></td>
    </tr>
<!--
EOT;
if(!$db_merge_posts && $postTableSelections){
print <<<EOT
-->
    <tr class="tr1 vt">
      <td class="td1">分表數據庫</td>
      <td class="td2">$postTableSelections</td>
    </tr>
<!--
EOT;
}print <<<EOT
-->
    <tr class="tr1 vt">
      <td class="td1">用戶名</td>
      <td class="td2">
        <input type="text" class="input input_wa mr20" name="author" value="$author">可使用通配符 "*"，多個用戶名用英文半角逗號","分隔
      </td>
    </tr>
     <tr class="tr1 vt">
      <td class="td1">uid</td>
      <td class="td2">
        <input type="text" class="input input_wa mr20" name="authorid" value="$authorid">可使用通配符 "*"，多個uid用英文半角逗號","分隔
      </td>
    </tr>

    <tbody id="advanceSearchBody" style="display:$searchDisplay;">
    <tr class="tr1 vt">
      <td class="td1">所屬主題ID</td>
      <td class="td2"><input type="text" class="input input_wa mr20" name="tid" value="$tid">
        <!-- <span class="s1">用于刪除指定主題的所有回復。多個主題ID用英文半角逗號","分隔</span> -->
      </td>
    </tr>
    <tr class="tr1 vt">
      <td class="td1">指定 pid 範圍</td>
      <td class="td2"><input type="text" class="input input_wa" name="pstart" value="$pstart">
        -
        <input type="text" class="input input_wa mr20" name="pend" value="$pend">
      </td>
    </tr>
    <tr class="tr1 vt">
      <td class="td1">內容大于[字節]</td>
      <td class="td2"><input type="text" class="input input_wa mr20" name="tcounts" value="$tcounts"></td>
    </tr>
    <tr class="tr1 vt">
      <td class="td1">內容少于[字節]</td>
      <td class="td2"><input type="text" class="input input_wa mr20" name="counts" value="$counts"></td>
    </tr>
    <tr class="tr1 vt">
      <td class="td1">根據用戶IP查找</td>
      <td class="td2"><input type="text" class="input input_wa mr20" name="userip" value="$userip">可使用通配符 "*"</td>
    </tr>
    </tbody>
    <tr class="tr1 vt">
      <td class="td1">每頁顯示行數</td>
      <td class="td2">
        <input type="text" class="input input_wa mr20" name="nums" value="$nums">
        <!--
        <input type="checkbox" name="direct" value=1 onclick="deldirect(this.form,'info2','每批處理的個數');">
        直接刪除(直接刪除符合條件的項目)</td> -->

    </tr>
  </table>
  </div>
  	<div class="mb10 tac">
    <span class="mr10"><span class="btn"><span><button type="submit">提 交</button></span></span></span>
    <a href="javascript:;" id="advanceSearchButton">高級搜索<input type="hidden" id="searchDisplay" name="searchDisplay" value="$searchDisplay"></a>
    </div>
</form>
<script type="text/javascript">

getObj('advanceSearchButton').onclick = function() {
	displayElementConflict('advanceSearchBody','advanceSearchButton');
	if(getObj('searchDisplay')){
		getObj('searchDisplay').value = getObj('advanceSearchBody').style.display;
	}
};
function displayElementConflict(elementId,buttonId,isDisplay) {
	if (undefined == isDisplay && typeof buttonId === 'string') {
		getObj(elementId).style.display = getObj(elementId).style.display == 'none' ? '' : 'none';
		getObj(buttonId).innerHTML = getObj(elementId).style.display == ''? '簡單搜索' : '高級搜索';
	} else {
		getObj(elementId).style.display = isDisplay ? '' : 'none';
	}
}
function displayElement(elementId, isDisplay) {
	if (undefined == isDisplay) {
		getObj(elementId).style.display = getObj(elementId).style.display == 'none' ? '' : 'none';
		getObj('advanceSearchButton').innerHTML=getObj(elementId).style.display == ''?'簡單搜索' : '高級搜索';
	} else {
		getObj(elementId).style.display = isDisplay ? '' : 'none';
	}
}

if (null != getObj('sphinxpostopen')) {
	getObj('sphinxpostopen').onclick = function() {
		var isSphinxOpen = getObj('sphinxpostopen').checked == 1;
		displayElement('advanceSearchButton', !isSphinxOpen);
		if (isSphinxOpen) {
			displayElement('advanceSearchBody', false);
			getObj('searchDisplay').value = getObj('advanceSearchBody').style.display;
		}
	}
	var isSphinxOpen = getObj('sphinxpostopen').checked == 1;
	displayElement('advanceSearchButton', !isSphinxOpen);
}
</script>

<form action="$basename&action=delrpl" name="del_rpl_form" method="post" id="del_rpl_form">
  <input type="hidden" name="step" value="2">
  <input type="hidden" name="ptable" value="$ptable">
  <input type="hidden" name="fid" value="$fid">
  <input type="hidden" name="tid" value="$tid">
  <input type="hidden" name="pstart" value="$pstart">
  <input type="hidden" name="pend" value="$pend">
  <input type="hidden" name="author" value="$author">
  <input type="hidden" name="authorid" value="$authorid">
  <input type="hidden" name="keyword" value="$keyword">
  <input type="hidden" name="userip" value="$userip">
  <input type="hidden" name="nums" value="$nums">
  <input type="hidden" name="tcounts" value="$tcounts">
  <input type="hidden" name="counts" value="$counts">
  <input type="hidden" name="page" value="$page">
  <input type="hidden" name="sphinx" value="$sphinx">
  <input type="hidden" name="sphinxRange" value="$sphinxRange">
  <h3 class="h1">回復列表</h3>
  <div class="admin_table mb10">
    <table cellpadding="0" cellspacing="0" width="100%">
    <tr class="tr2 vt td_bgB">
      <td width="24"><span onclick="CheckAll(document.del_rpl_form)" class="cp">全選</span></td>
      <td>作者</td>
      <td>IP</td>
      <td>發表時間</td>
      <td>版塊</td>
      <td>內容</td>
    </tr>
<!--
EOT;
if (empty($postdb)) {print <<<EOT
-->
<tr><td class="p10" colspan="6"><div class="admin_tips">啊哦，沒有你要的信息！</div></td></tr>
<!--
EOT;
}else{
	foreach($postdb as $key=>$post){
		if(!$post[content]) {continue;}
		$post['content'] = htmlspecialchars($post['content']);
print <<<EOT
-->
    <tr class="tr1 vt">
      <td class="td2"><input type="checkbox" name="delid[]" value="$post[pid]"></td>
      <td class="td2"><a href="{$db_userurl}$post[authorid]" target=_blank>$post[author]</a></td>
      <td class="td2">$post[userip]</td>
      <td class="td2">$post[postdate]</td>
      <td class="td2"><a href="thread.php?fid=$post[fid]" target="_blank">$post[forumname]</a></td>
      <td class="td2"><a href="$basename&action=view&tid=$post[tid]&pid=$post[pid]" target=_blank>$post[content]</a></td>

    </tr>
<!--
EOT;
}}
print <<<EOT
-->
  </table>
  </div>
  <div class="cc mb10">$pages</div>
  <div class="mb10 tac">
	<div class="mb5">扣除積分︰<input type="radio" name="delcredit" value="1" /> 是 <input type="radio" name="delcredit" value="0" checked /> 否</div>
	<span class="bt"><span><button type="button" onclick="CheckAll(document.del_rpl_form)">全 選</button></span></span>
      <span class="btn"><span><button type="submit">刪 除</button></span></span>
  </div>
</form>
<!-- for get to post  -->
<form action="$basename&action=replylist" name="superdel_rpl" method="post" id="superdel_rpl">
  <input type="hidden" name="step" value="2">
  <input type="hidden" name="ptable" value="$ptable">
  <input type="hidden" name="fid" value="$fid">
  <input type="hidden" name="tid" value="$tid">
  <input type="hidden" name="pstart" value="$pstart">
  <input type="hidden" name="pend" value="$pend">
  <input type="hidden" name="author" value="$author">
   <input type="hidden" name="authorid" value="$authorid">
  <input type="hidden" name="keyword" value="$keyword">
  <input type="hidden" name="userip" value="$userip">
  <input type="hidden" name="nums" value="$nums">
  <input type="hidden" name="tcounts" value="$tcounts">
  <input type="hidden" name="counts" value="$counts">
  <input type="hidden" name="page" value="$page">
  <input type="hidden" name="sphinx" value="$sphinx">
  <input type="hidden" name="sphinxRange" value="$sphinxRange">
</form>
<!--
EOT;
}
include_once PrintEot('adminbottom');
?>-->
<script type="text/javascript">
function deldirect(form,tar,msg){
	if (form.direct.checked == true) {
		document.getElementById(tar).innerHTML = '<b><font color=blue>刪除個數</font></b>';
	} else {
		document.getElementById(tar).innerHTML = msg;
	}
}
</script>
