<!--<?php print <<<EOT
-->
<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>
	</div>
</div>

$db_searchinfo
<form name="sF" action="search.php?#submit" method="post" onSubmit="this.submit.disabled=true;">
<input type="hidden" name="step" value="2" />
<div class="t" style="margin-top:8px;"><table width="100%" cellspacing="0" cellpadding="0">
<tr><td class="h" colspan="2">搜索目标</td></tr>
<tr class="tr2"><td colspan="2">&nbsp;</td></tr>
<tr class="tr3 f_one"><th width="50%">关键词:
<br /><input class="input" type="text" name="keyword" value="$skeyword" size="30" />
<br /><input type="radio" name="method" value="OR" $checked_or />部分匹配
<input type="radio" name="method" value="AND" $checked_and/>完全匹配(2个字节以上,多关键词用'|'或空格分开)</th>
<th>按用户名搜索:<br />
<input class="input" type="text" name="pwuser" size="15" value="$pwuser" /><br />用户名中可使用通配符 *，如 可用 admi* 匹配 admin
</th></tr>
<div><tr class="tr3 s5 f_one"><td colspan="2" style="border:0">搜索帖子范围</td></tr>
<tr class="tr3 f_one"><th colspan="2">
<!--
EOT;
if($_G[allowsearch]==2 && ($p_table || $t_table)){print <<<EOT
-->
<input type="radio" name="sch_area" value="0" onclick="gettable(this.value);" $checked_0 />主题标题
<input type="radio" name="sch_area" value="1" onclick="gettable(this.value);" $checked_1/>主题标题与主题内容
<span id="ttable" style="display:none;">$t_table</span>
<input type="radio" name="sch_area" value="2" onclick="gettable(this.value);" $checked_2/>回复标题与回复内容
<span id="ptable" style="display:none;">$p_table</span>
<script language="JavaScript">
var sch_area = '$sch_area';
function gettable(value){
	var ttable = document.getElementById("ttable");
	var ptable = document.getElementById("ptable");
	if (value==2) {
		ptable.style.display = '';
		ttable.style.display = 'none';
	} else if (value==1) {
		ttable.style.display = '';
		ptable.style.display = 'none';
	} else {
		ptable.style.display = 'none';
		ttable.style.display = 'none';
	}
}
if (sch_area == 1 || sch_area == 2) {
	gettable(sch_area);
}
</script>
<!--
EOT;
}else{print <<<EOT
-->
<input type="radio" name="sch_area" value="0" checked />主题标题
<input type="radio" name="sch_area" value="1" $disable />主题标题与主题内容
<input type="radio" name="sch_area" value="2" $disable />回复标题与回复内容
<!--
EOT;
}print <<<EOT
-->
<input type="checkbox" name="digest" value="1" $checked_disget/>精华帖标志
</th>
</td></tr>
<tr class="tr3 s5 f_one"><td colspan="2" style="border:0">相关搜索选项</td></tr>
<tr class="tr3 f_one"><th>搜索版块分类：<br />
<select name="f_fid" >
<option value="all">全部版块分类</option>
$forumcache
<!--
EOT;
if($forumadd){print <<<EOT
-->
<option value=''>>> 隐藏版块</option>
$forumadd
<!--
EOT;
}print <<<EOT
-->
</select>
</th>
<th valign="top">发表主题时间：<br />
<select name="sch_time">
<!--
EOT;
if($_G['schtime'] == 'all'){print <<<EOT
-->
<option value="all" $time_all>所有主题帖</option>
<!--
EOT;
}print <<<EOT
-->
<option value="newatc" $time_newatc>最新主题帖</option>
<!--
EOT;
$schtimedb = array(
'86400' => "<option value=\"86400\" $time_86400>1天内的主题</option>",
'172800' => "<option value=\"172800\" $time_172800>2天内的主题</option>",
'604800' => "<option value=\"604800\" $time_604800>1星期内的主题</option>",
'2592000' => "<option value=\"2592000\" $time_2592000>1个月内的主题</option>",
'5184000' => "<option value=\"5184000\" $time_5184000>2个月内的主题</option>",
'7776000' => "<option value=\"7776000\" $time_7776000>3个月内的主题</option>",
'15552000' => "<option value=\"15552000\" $time_15552000>6个月内的主题</option>",
'31536000' => "<option value=\"31536000\" $time_31536000>1年内的主题</option>"
);
foreach($schtimedb as $key => $value){
if ($_G['schtime'] == 'all' || $key <= $_G['schtime']) {print <<<EOT
-->
$value
<!--
EOT;
}}print <<<EOT
-->
</select>
</th></tr>
<tr class="tr3 s5 f_one"><td colspan="2" style="border:0">结果排序:</td></tr>
<tr class="tr3 f_one"><th colspan="2">
<select name="orderway">
<option value="lastpost" $order_lastpost>最后回复时间</option>
<option value="replies" $order_replies>回复</option>
<option value="hits" $order_hits>人气</option>
</select>
<input type="radio" name="asc" value="ASC" $asc_ASC />升序
<input type="radio" name="asc" value="DESC" $asc_DESC />降序
</th></tr>
<tr><td style="height:8px;"></td></tr>
</table></div>
<div style="margin-bottom:25px;text-align:center;">
<input class="btn" type="submit" name="submit" value="提 交" />
<input class="btn" type="reset" value="重 置" /></div></form>
<script language="JavaScript">
window.onunload = function(){document.sF.submit.disabled = false;}
</script>
<!--
EOT;
if ($step == 2){print <<<EOT
-->
<div class="t3">$pages</div>
<!--
EOT;
if($admincheck){print <<<EOT
-->
<form action="mawhole.php" method="post">
<input type="hidden" name="fid" value="$seekfid" />
<!--
EOT;
}print <<<EOT
-->
<div class="t">
<table width="100%" cellspacing="0" cellpadding="0">
<tr><td colspan="7" class="h">主题列表</td></tr>
<tr class="tr2 tac">
<td width="5%">状态</td>
<td width="*">标题</td>
<td width="15%">论坛</td>
<td width="13%">作者</td>
<td width="6%">回复</td>
<td width="6%">人气</td>
<td width="20%">最后发表</td>
</tr>
<!--
EOT;
foreach($schdb as $sch){print <<<EOT
-->
<tr class="tr3 tac"><td class="y-style"><img src="$imgpath/$stylepath/thread/$sch[status].gif" border="0"></td>
<th class="y-style" class="tal">
<!--
EOT;
if($admincheck){print <<<EOT
-->
<input type="checkbox" name="tidarray[]" value="$sch[tid]" />
<!--
EOT;
}if($sch['topped']){print <<<EOT
-->
<img src="$imgpath/$stylepath/file/headtopic_$sch[topped].gif" alt="置顶帖标志" />
<!--
EOT;
}print <<<EOT
-->
&nbsp;<a href="read.php?tid=$sch[tid]$htmlurl" target="_blank">$sch[subject]</a>
<!--
EOT;
if($sch[digest]){print <<<EOT
-->
<img src="$imgpath/$stylepath/file/digest_$sch[digest].gif" alt="精华帖标志" />
<!--
EOT;
}print <<<EOT
-->
</th>
<td class="y-style">
<a href="thread.php?fid=$sch[fid]">$sch[forumname]</a></td>
<td class="smalltxt y-style"><a href="u.php?action=show&uid=$sch[authorid]">$sch[author]</a><br />$sch[postdate]</td>
<td class="y-style">$sch[replies]</td>
<td class="y-style">$sch[hits]</td>
<td class="y-style">
<a href="read.php?tid=$sch[tid]&page=e#a" target="_blank">
$sch[lastpost]</a>
<br />by: $sch[lastposter]
</tr>
<!--
EOT;
}print <<<EOT
-->
<tr><td style="height:8px;"></td></tr>
</table></div>
<!--
EOT;
if($admincheck){print <<<EOT
-->
<table cellpadding="1" cellspacing="1" align="center" width="$tablewidth">
<tr align="center"><td>
管理选项:
<!--
EOT;
if($isGM || $pwSystem[topped]){print <<<EOT
-->
<input name="action" type="radio" value="headtopic" />置顶
<!--
EOT;
}if($isGM || $pwSystem[typeadmin]){print <<<EOT
-->
<input name="action" type="radio" value="digest" />精华
<input name="action" type="radio" value="lock" />锁定
<input name="action" type="radio" value="edit" />加亮
<input name="action" type="radio" value="pushtopic" />提前
<input name="action" type="radio" value="downtopic" />压帖
<!--
EOT;
}if($isGM || $pwSystem[tpccheck]){print <<<EOT
-->
		<input name="action" type="radio" value="type" />主题分类
<!--
EOT;
}if($isGM || $pwSystem[moveatc]){print <<<EOT
-->
		<input name="action" type="radio" value="move" />移动
<!--
EOT;
}if($isGM || $pwSystem[copyatc]){print <<<EOT
-->
		<input name="action" type="radio" value="copy" />复制
<!--
EOT;
}if($isGM || $pwSystem[delatc]){print <<<EOT
-->
		<input name="action" type="radio" value="del" checked />删除
<!--
EOT;
}print <<<EOT
-->
<br /><br />
<input class="btn" type="button" name="chkall" value="全 选" onclick="CheckAll(this.form)" />
<input class="btn" type="reset" name="Reset" value="重 置" />
<input class="btn" type="submit" name="hello" value="提 交" />
</td></tr></table></form>
<!--
EOT;
}print <<<EOT
-->
<div class="fr">共搜索到了{$total}条信息[ {$db_perpage} 条/页]</div>
$pages
<script language="JavaScript">
function CheckAll(form){
	for (var i=0;i<form.elements.length-12;i++){
		var e = form.elements[i];
		e.checked == true ? e.checked = false : e.checked = true;
	}
}
</script>
<!--
EOT;
}?>-->
