<%template _header%>
<div id="foruminfo">
	<div class="userinfo">
		<h2><a href="{config.forumurl}">{config.forumtitle}</a> <strong>搜索</strong></h2>
	</div>
</div>
<%if page_err==0%>
<%if {searchpost}%>
<%template _msgbox%>
<%else%>

<%if searchid==-1%>
<div id="options_item">
	<div id="postoptions">
		<table cellpadding="0" cellspacing="0" border="0">
		<tbody>
		<tr class="list">
			<th class="formlabel">选择分表:</th>
			<td class="formbody">
				<select name="posttableid" id="posttableid">
				<%loop table tablelist%>
					<option value="{table[id]}">{table[description]}<%if {strtoint({table[_id]})}==1%>(当前使用)<%/if%></option>
				<%/loop%>
				</select>
			</td>
		</tr>
		</tbody>
		<tbody>
		<tr class="list">
			<th class="formlabel">时间:</th>
			<td class="formbody">
				<select name="searchtime" id="searchtime">
				  <option value="0" selected="selected">全部时间</option>
				  <option value="-1">1天前</option>
				  <option value="-2">2天前</option>
				  <option value="-3">3天前</option>
				  <option value="-7">1周前</option>
				  <option value="-30">1个月前</option>
				  <option value="-90">3个月前</option>
				  <option value="-180">半年前</option>
				  <option value="-365">1年前</option>
				</select>
				  <input type="radio" name="searchtimetype" value="1" />
				之前
				<input name="searchtimetype" type="radio" value="0" checked />
				之后
			</td>
		</tr>
		</tbody>
		<tbody>
		<tr class="list">
			<th class="formlabel">结果排序:</th>
			<td class="formbody">
				<select name="resultorder" id="resultorder">
				  <option value="0" selected="selected">最后回复时间</option>
				  <option value="1">发表时间</option>
				  <option value="2">回复数量</option>
				  <option value="3">查看次数</option>
				</select>
				<input type="radio" name="resultordertype" value="1" />
				升序
				<input name="resultordertype" type="radio" value="0" checked />
				降序
			</td>
		</tr>
		</tbody>
		<tbody>
		<tr class="list">
			<th class="formlabel">搜索范围:</th>
			<td class="formbody">
				<select name="searchforumid" size="12" style="width:450px" multiple="multiple" id="searchforumid">
				 <option selected value="">---------- 所有版块(默认) ----------</option>
					<!--模版中所有版块的下拉框中一定要加入value=""否则会提示没有选择版块-->
					{forumlist}
				 </select>
				 <p>(按Ctrl或Shift键可以多选,不选择)</p>
			</td>
		</tr>
		</tbody>
		</table>
	</div>
	<div id="spacepostoptions">
		<table cellpadding="0" cellspacing="0" border="0">
		<tbody>
		<tr class="list">
			<th class="formlabel">时间:</th>
			<td class="formbody">
				<select name="searchtime" id="searchtime">
				  <option value="0" selected="selected">全部时间</option>
				  <option value="-1">1天前</option>
				  <option value="-2">2天前</option>
				  <option value="-3">3天前</option>
				  <option value="-7">1周前</option>
				  <option value="-30">1个月前</option>
				  <option value="-90">3个月前</option>
				  <option value="-180">半年前</option>
				  <option value="-365">1年前</option>
				</select>
				  <input type="radio" name="searchtimetype" value="1" />
				之前
				<input name="searchtimetype" type="radio" value="0" checked />
				之后
			</td>
		</tr>
		</tbody>
		<tbody>
		<tr class="list">
			<th class="formlabel">结果排序:</th>
			<td class="formbody">
				<select name="resultorder" id="resultorder">
				  <option value="0" selected="selected">发表时间</option>
				  <option value="1">回复数量</option>
				  <option value="2">查看次数</option>
				</select>
				<input type="radio" name="resultordertype" value="1" />
				升序
				<input name="resultordertype" type="radio" value="0" checked />
				降序
			</td>
		</tr>
		</tbody>
		</table>
	</div>
	<div id="albumoptions">
		<table cellpadding="0" cellspacing="0" border="0">
		<tbody>
		<tr class="list">
			<th class="formlabel">时间:</th>
			<td class="formbody">
				<select name="searchtime" id="searchtime">
				  <option value="0" selected="selected">全部时间</option>
				  <option value="-1">1天前</option>
				  <option value="-2">2天前</option>
				  <option value="-3">3天前</option>
				  <option value="-7">1周前</option>
				  <option value="-30">1个月前</option>
				  <option value="-90">3个月前</option>
				  <option value="-180">半年前</option>
				  <option value="-365">1年前</option>
				</select>
				  <input type="radio" name="searchtimetype" value="1" />
				之前
				<input name="searchtimetype" type="radio" value="0" checked />
				之后
			</td>
		</tr>
		</tbody>
		<tbody>
		<tr class="list">
			<th class="formlabel">结果排序:</th>
			<td class="formbody">
				<select name="resultorder" id="resultorder">
				  <option value="0" selected="selected">创建时间</option>
				</select>
				<input type="radio" name="resultordertype" value="1" />
				升序
				<input name="resultordertype" type="radio" value="0" checked />
				降序
			</td>
		</tr>
		</tbody>
		</table>
	</div>
</div>
<form id="postpm" name="postpm" method="post" onsubmit="if(this.chkAuthor.checked)$('type').value='author';return true;" action="">
<div class="ntforumbox">
	<div class="titlebar">
		<h3>搜索</h3>
	</div>
	<div class="forumform">
	<table cellpadding="0" cellspacing="0" border="0">
		<tbody>
		<tr class="list">
			<th class="formlabel">关键词:</th>
			<td class="formbody">
			<input name="keyword" type="text" class="colorblue" id="keyword" onfocus="this.className='colorfocus';" onblur="this.className='colorblue';" size="45" />&nbsp;&nbsp; 多个关键词间用英文空格分开
			</td>
		</tr>
		</tbody>
		<tbody>
		<tr class="list">
			<th class="formlabel">作者:</th>
			<td class="formbody">
				<input name="poster" type="text" id="poster" size="45" class="colorblue" onfocus="this.className='colorfocus';" onblur="this.className='colorblue';" />
			&nbsp;&nbsp;<input type="checkbox" value="1" id="chkAuthor" name="chkAuthor" onclick="checkauthoroption(this);" />
			搜索该作者所有帖子,相册和空间日志
			</td>
		</tr>
		</tbody>
		<tbody>
		<tr class="list">
			<td class="navformcommend" colspan="2" id="divsearchoption">搜索选项</td>
		</tr>
		</tbody>
		<tbody>
		<tr class="list" id="divsearchtype">
			<th class="formlabel">搜索类型:</th>
			<td class="formbody">
			    <input type="hidden" name="type" value="post" id="type" />
				<input name="keywordtype" type="radio" value="0" checked onclick="changeoption('post');" />
				帖子标题搜索
				<input type="radio" name="keywordtype" value="1" onclick="changeoption('post');" />
				内容搜索
				<input type="radio" name="keywordtype" value="2" onclick="changeoption('spacepost');" />
				日志标题搜索
				<input type="radio" name="keywordtype" value="3" onclick="changeoption('album');"/>
				相册标题搜索
			</td>
		</tr>
		</tbody>
		<tbody>
		<tr>
			<td colspan="2"><div id="options"></div><script type="text/javascript" src="templates/{templatepath}/search.js"></script></td>
		</tr>
		</tbody>
		<tbody>
		<tr class="list">
			<td class="formarea"  colspan="2">
				 <input name="submit" type="submit" class="sbutton" id="submit" value="执行搜索" />
			</td>
		</tr>
		</tbody>
		</table>
	</div>
</div>
</form>
</div>
<%template _copyright%>
<%template _footer%>

<%else%>
<%if {type}=="album"%>
<div class="forumpages">
	<div class="forumpagesnumbers">
	<table border="0" cellpadding="0" cellspacing="0">
		<tr>
			<td class="forumallpages"><strong>{pageid}</strong>&nbsp;&nbsp;/&nbsp;&nbsp;{pagecount}页</td>
			<td style="width:10px;">&nbsp;</td>
			<td class="forumallpages">{pagenumbers}</td>
			<td class="forumallpages3">跳转<input name="gopage" type="text" id="gopage" onKeyDown="if(event.keyCode==13) {
window.location='search.aspx?searchid={searchid}&page='+this.value;}"  size="4" maxlength="9"  class="colorblue2"/>页</td>
		</tr>
	</table>
	</div>
	<div class="pagesothers">共搜索到{topiccount}个符合条件的相册</div>
</div>
<div class="ntforumbox" >
	<div class="titlebar">
		<h3>搜索结果</h3>
	</div>
	<table cellpadding="0" cellspacing="0" border="0" width="100%">
	<thead>
		<tr>
		<th>标题</th>
		<th>所属分类</th>
		<th>作者</th>
		<th>图片数</th>
		</tr>
	</thead>
	<%loop album albumlist%>
	<tbody>
		<tr class="list" onmouseover="this.className='liston'" onmouseout="this.className='list'">
			<th class="forumlisttitle searchtitle">
					<a href="showalbum.aspx?albumid={album[albumid]}" target="_blank">{album[title]}</a>
			</th>
			<td>
					<a href="showalbumlist.aspx?cate={album[albumcateid]}" target="_parent">{album[categorytitle]}</a>
			</td>
			<td class="listitem">
					<h3>
					<%if {strtoint({album[userid]})}==-1%>
						游客
					<%else%>
						<a href="showalbumlist.aspx?uid={album[userid]}" target="_parent">{album[username]}</a>
					<%/if%></h3>
					<em><%datetostr({album[createdatetime]},"yyyy.MM.dd HH:mm")%></em>
			</td>
			<td>{album[imgcount]}</td>
		</tr>
	</tbody>
	<%/loop%>
	</table>
</div>
<div class="forumpages">
	<div class="forumpagesnumbers">
		<table border="0" cellpadding="0" cellspacing="0">
			<tr>
				<td class="forumallpages"><strong>{pageid}</strong>&nbsp;&nbsp;/&nbsp;&nbsp;{pagecount}页</td>
				<td style="width:10px;">&nbsp;</td>
				<td class="forumallpages">{pagenumbers}</td>
				<td class="forumallpages3">跳转<input name="gopage" type="text" id="gopage" onKeyDown="if(event.keyCode==13) {
window.location='search.aspx?searchid={searchid}&page='+this.value;}"  size="4" maxlength="9"  class="colorblue2"/>页</td>
			</tr>
		</table>
	</div>
	<div class="pagesothers">共搜索到{topiccount}个符合条件的相册</div>
</div>
<%/if%>
<%if {type}=="spacepost"%>
<div class="forumpages">
	<div class="forumpagesnumbers">
		<table border="0" cellpadding="0" cellspacing="0">
			<tr>
				<td class="forumallpages"><strong>{pageid}</strong>&nbsp;&nbsp;/&nbsp;&nbsp;{pagecount}页</td>
				<td style="width:10px;">&nbsp;</td>
				<td class="forumallpages">{pagenumbers}</td>
				<td class="forumallpages3">跳转<input name="gopage" type="text" id="gopage" onKeyDown="if(event.keyCode==13) {
window.location='search.aspx?searchid={searchid}&page='+this.value;}"  size="4" maxlength="9"  class="colorblue2"/>页</td>
			</tr>
		</table>
	</div>
	<div class="pagesothers">共搜索到{topiccount}篇符合条件的日志</div>
</div>

<div class="ntforumbox" >
	<div class="titlebar">
		<h3>搜索结果</h3>
	</div>
	<table cellpadding="0" cellspacing="0" border="0" width="100%">
		<thead>
			<tr>
			<th>标题</th>
			<th>作者</th>
			<th>回复/查看</th>
			</tr>
		</thead>
		<%loop spacepost spacepostlist%>
		<tbody>
			<tr class="list" onmouseover="this.className='liston'" onmouseout="this.className='list'">
				<th class="forumlisttitle searchtitle">
					<a href="{spaceurl}space/viewspacepost.aspx?postid={spacepost[postid]}" target="_blank">{spacepost[title]}</a>
				</th>
				<td class="listitem">
					<h3>
					<%if {strtoint({spacepost[uid]})}==-1%>
						游客
					<%else%>
						<a href="{spaceurl}space/?uid={spacepost[uid]}" target="_parent">{spacepost[author]}</a>
					<%/if%></h3>
					<em><%datetostr({spacepost[postdatetime]},"yyyy.MM.dd HH:mm")%></em>
				</td>
				<td><em>{spacepost[commentcount]}</em> / {spacepost[views]}</td>
		  	</tr>
		</tbody>
		<%/loop%>
	</table>
</div>
<div class="forumpages">
	<div class="forumpagesnumbers">
		<table border="0" cellpadding="0" cellspacing="0">
			<tr>
				<td class="forumallpages"><strong>{pageid}</strong>&nbsp;&nbsp;/&nbsp;&nbsp;{pagecount}页</td>
				<td style="width:10px;">&nbsp;</td>
				<td class="forumallpages">{pagenumbers}</td>
				<td class="forumallpages3">跳转<input name="gopage" type="text" id="gopage" onKeyDown="if(event.keyCode==13) {
	window.location='search.aspx?searchid={searchid}&page='+this.value;}"  size="4" maxlength="9"  class="colorblue2"/>页</td>
			</tr>
		</table>
	</div>
	<div class="pagesothers">共搜索到{topiccount}篇符合条件的日志</div>
</div>
<%/if%>

<%if {type}==""%>
<div class="forumpages">
	<div class="forumpagesnumbers">
		<table border="0" cellpadding="0" cellspacing="0">
			<tr>
				<td class="forumallpages"><strong>{pageid}</strong>&nbsp;&nbsp;/&nbsp;&nbsp;{pagecount}页</td>
				<td style="width:10px;">&nbsp;</td>
				<td class="forumallpages">{pagenumbers}</td>
				<td class="forumallpages3">跳转<input name="gopage" type="text" id="gopage" onKeyDown="if(event.keyCode==13) {
	window.location='search.aspx?searchid={searchid}&page='+this.value;}"  size="4" maxlength="9"  class="colorblue2"/>页</td>
			</tr>
		</table>
	</div>
	<div class="pagesothers">共搜索到{topiccount}个符合条件的帖子</div>
</div>
<div class="ntforumbox" >
	<div class="titlebar">
		<h3>搜索结果</h3>
	</div>
	<table cellpadding="0" cellspacing="0" border="0" width="100%">
		<thead>
		<tr>
			<th>标题</th>
			<th>所在版块</th>
			<th>作者</th>
			<th>回复/查看</th>
			<th>最后回复</th>
		</tr>
		</thead>
		<%loop topic topiclist%>
		<tbody>
			<tr class="list" onmouseover="this.className='liston'" onmouseout="this.className='list'">
				<td class="forumlisttitle searchtitle">
				    <%set {aspxrewriteurl} = this.ShowTopicAspxRewrite({topic[tid]},0)%>
					<a href="{aspxrewriteurl}" target="_blank">{topic[title]}</a></td>
				<td>
				    <%set {aspxrewriteurl} = this.ShowForumAspxRewrite({topic[fid]},0)%>
					<a href="{aspxrewriteurl}" target="_parent">{topic[forumname]}</a>
				</td>
				<td class="listitem">
					<h3>
					<%if {strtoint({topic[posterid]})}==-1%>
						游客
					<%else%>
					    <%set {aspxrewriteurl} = this.UserInfoAspxRewrite({topic[posterid]})%>
						<a href="{aspxrewriteurl}" target="_parent">{topic[poster]}</a>
					<%/if%></h3>
					<em><%datetostr({topic[postdatetime]},"yyyy.MM.dd HH:mm")%></em>
				</td>
				<td><em>{topic[replies]}</em> / {topic[views]}</td>
				<td  class="listitem listlast">
					<%if {strtoint({topic[replies]})}>0%>
						<h4>
							{topic[lastposter]}
						<a href="showtopic.aspx?topicid={topic[tid]}&page=end" target="_blank"><img src="templates/{templatepath}/images/writer2.gif" alt="发布人"/></a>
						</h4>
						<em><%datetostr({topic[lastpost]},"yyyy.MM.dd HH:mm")%></em>
					<%else%>从未
					<%/if%>
				</td>
			</tr>
		</tbody>
		<%/loop%>
	</table>
</div>
<div class="forumpages">
	<div class="forumpagesnumbers">
		<table border="0" cellpadding="0" cellspacing="0">
			<tr>
				<td class="forumallpages"><strong>{pageid}</strong>&nbsp;&nbsp;/&nbsp;&nbsp;{pagecount}页</td>
				<td style="width:10px;">&nbsp;</td>
				<td class="forumallpages">{pagenumbers}</td>
				<td class="forumallpages3">跳转<input name="gopage" type="text" id="gopage" onKeyDown="if(event.keyCode==13) {
window.location='search.aspx?searchid={searchid}&page='+this.value;}"  size="4" maxlength="9"  class="colorblue2"/>页</td>
			</tr>
		</table>
	</div>
	<div class="pagesothers">共搜索到{topiccount}个符合条件的帖子</div>
</div>
<%/if%>
<%if {type}=="author"%>
<div class="ntforumbox" >
	<div class="titlebar">
		<h3>帖子搜索结果(共{topiccount}个)</h3>
	</div>
	<table cellpadding="0" cellspacing="0" border="0" width="100%">
		<thead>
		<tr>
			<th>标题</th>
			<th>所在版块</th>
			<th>作者</th>
			<th>回复/查看</th>
			<th>最后回复</th>
		</tr>
		</thead>
		<%loop topic topiclist%>
		<tbody>
			<tr class="list" onmouseover="this.className='liston'" onmouseout="this.className='list'">
				<th class="forumlisttitle searchtitle">
				    <%set {aspxrewriteurl} = this.ShowForumAspxRewrite({topic[tid]},0)%>
					<a href="{aspxrewriteurl}" target="_blank">{topic[title]}</a>
				</th>
				<td>
				    <%set {aspxrewriteurl} = this.ShowForumAspxRewrite({topic[fid]},0)%>
					<a href="{aspxrewriteurl}" target="_parent">{topic[forumname]}</a>
				</td>
				<td class="listitem">
					<h3>
					<%if {strtoint({topic[posterid]})}==-1%>
						游客
					<%else%>
					    <%set {aspxrewriteurl} = this.UserInfoAspxRewrite({topic[posterid]})%>
						<a href="{aspxrewriteurl}" target="_parent">{topic[poster]}</a>
					<%/if%></h3>
					<em><%datetostr({topic[postdatetime]},"yyyy.MM.dd HH:mm")%></em>
				</td>
				<td><em>{topic[replies]}</em> / {topic[views]}</td>
				<td class="listitem listlast">
					<%if {strtoint({topic[replies]})}>0%>
						<h4>
							{topic[lastposter]}
						<a href="showtopic.aspx?topicid={topic[tid]}&page=end" target="_blank"><img src="templates/{templatepath}/images/writer2.gif" alt="发布人" /></a>
						</h4>
						<em><%datetostr({topic[lastpost]},"yyyy.MM.dd HH:mm")%></em>
					<%else%>
						<span style="line-height:36px;">从未</span>
					<%/if%>
				</td>
			</tr>
		</tbody>
		<%/loop%>
	</table>
</div>
<div class="forumpages">
	<div class="forumpagesnumbers">
		<table border="0" cellpadding="0" cellspacing="0">
			<tr>
				<td class="forumallpages"><strong>{topicpageid}</strong>&nbsp;&nbsp;/&nbsp;&nbsp;{topicpagecount}页</td>
				<td style="width:10px;">&nbsp;</td>
				<td class="forumallpages">{topicpagenumbers}</td>
			</tr>
		</table>
	</div>
</div>

<div class="ntforumbox" >
	<div class="titlebar">
		<h3>日志搜索结果(共{blogcount}篇)</h3>
	</div>
	<table cellpadding="0" cellspacing="0" border="0" width="100%">
		<thead>
		<tr>
			<th>标题</th>
			<th>作者</th>
			<th>回复/查看</th>
		</tr>
		</thead>
		<%loop spacepost spacepostlist%>
		<tbody>
			<tr class="list" onmouseover="this.className='liston'" onmouseout="this.className='list'">
				<th class="forumlisttitle searchtitle">
						<a href="{spaceurl}space/viewspacepost.aspx?postid={spacepost[postid]}" target="_blank">{spacepost[title]}</a></th>
				<td class="listitem">
					<h3>
					<%if {strtoint({spacepost[uid]})}==-1%>
						游客
					<%else%>
						<a href="{spaceurl}space/?uid={spacepost[uid]}" target="_parent">{spacepost[author]}</a>
					<%/if%></h3>
					<em><%datetostr({spacepost[postdatetime]},"yyyy.MM.dd HH:mm")%></em>
				</td>
				<td><em>{spacepost[commentcount]}</em> / {spacepost[views]}</td>
			</tr>
		</tbody>
		<%/loop%>
	</table>
</div>
<div class="forumpages">
	<div class="forumpagesnumbers">
		<table border="0" cellpadding="0" cellspacing="0">
			<tr>
				<td class="forumallpages"><strong>{blogpageid}</strong>&nbsp;&nbsp;/&nbsp;&nbsp;{blogpagecount}页</td>
				<td style="width:10px;">&nbsp;</td>
				<td class="forumallpages">{blogpagenumbers}</td>
			</tr>
		</table>
	</div>
</div>
<div class="ntforumbox" >
	<div class="titlebar">
		<h3>相册搜索结果(共{albumcount}个)</h3>
	</div>
	<table cellpadding="0" cellspacing="0" border="0" width="100%">
		<thead>
		<tr>
			<th>标题</th>
			<th>所属分类</th>
			<th>作者</th>
			<th>图片数</th>
		</tr>
		</thead>
		<%loop album albumlist%>
		<tbody>
			<tr class="list" onmouseover="this.className='liston'" onmouseout="this.className='list'">
				<th class="forumlisttitle searchtitle">
					<a href="showalbum.aspx?albumid={album[albumid]}" target="_blank">{album[title]}</a>
				</th>
				<td>
					<a href="showalbumlist.aspx?cate={album[albumcateid]}" target="_parent">{album[categorytitle]}</a></td>
				<td class="listitem">
					<h3>
					<%if {strtoint({album[userid]})}==-1%>
						游客
					<%else%>
						<a href="showalbumlist.aspx?uid={album[userid]}" target="_parent">{album[username]}</a>
					<%/if%></h3>
					<em><%datetostr({album[createdatetime]},"yyyy.MM.dd HH:mm")%></em>
				</td>
				<td>{album[imgcount]}</td>
			</tr>
		</tbody>
		<%/loop%>
	</table>
</div>
<div class="forumpages">
	<div class="forumpagesnumbers">
		<table border="0" cellpadding="0" cellspacing="0">
			<tr>
				<td class="forumallpages"><strong>{albumpageid}</strong>&nbsp;&nbsp;/&nbsp;&nbsp;{albumpagecount}页</td>
				<td style="width:10px;">&nbsp;</td>
				<td class="forumallpages">{albumpagenumbers}</td>
			</tr>
		</table>
	</div>
</div>
<%/if%>
</div>
<%template _copyright%>
<%template _footer%>
<%/if%>
<%/if%>
<%else%>
<%template _errmsgbox%>
<%/if%>
