<?exit?>
{template site_header}
<script type="text/javascript" src="{S_URL}/include/js/city.js"></script>
<div id="navigation" class="simplepage">
	<p>您的位置：
		<a href="{S_URL}/">$_SCONFIG[sitename]</a>
		&gt;&gt; $title
	</p>
	<h1>搜索</h1>
</div>

<!--{if empty($iarr)}-->
<div id="search" class="block">
	<h3 id="searchtabs" class="tabs">
		<a id="subjecttab" href="javascript:setTab('search','subject')" class="tab curtab">标题</a>
		<a id="authortab" href="javascript:setTab('search','author')" class="tab">作者</a>
		<a id="messagestrtab" href="javascript:setTab('search','messagestr')" class="tab">内容</a>
		<a id="usertab" href="javascript:setTab('search','user')" class="tab">用户</a>
		<a id="grouptab" href="javascript:setTab('search','group')" class="tab">圈子</a>
		<a id="bbs" href="{B_URL}/search.php" class="tab" target="_blank">论坛</a>
	</h3>
	<!--标题搜索-->
	<div id="subject" class="tabcontent">
		<form action="{S_URL}/batch.search.php" method="post">
			<label for="searchkey">标题</label><input type="text" name="searchkey" id="searchkey" />&nbsp;
			<select name="type">
				<option value="">全部</option>
				<!--{loop $channels['types'] $value}-->
					<option value="$value[nameid]">$value[name]</option>
				<!--{/loop}-->
			</select>&nbsp;<button type="submit" name="subjectsearch" value="true">搜索</button>
		</form>
	</div>
	<!--作者搜索-->
	<div id="author" class="tabcontent" style="display: none;">
		<form action="{S_URL}/batch.search.php" method="post">
			<label for="searchkey1">作者</label><input type="text" name="searchkey" id="searchkey1" />&nbsp;
			<select name="type">
				<option value="">全部</option>
				<!--{loop $channels['types'] $value}-->
					<option value="$value[nameid]">$value[name]</option>
				<!--{/loop}-->
			</select>&nbsp;<button type="submit" name="authorsearch" value="true">搜索</button>
		</form>
	</div>
	<!--全文检索-->
	<div id="messagestr" class="tabcontent" style="display: none;">
		<form action="{S_URL}/batch.search.php" method="post">
			<label for="searchkey2">内容</label><input type="text" name="searchkey" id="searchkey2" />&nbsp;
			<select name="type">
			<!--{loop $channels['types'] $value}-->
				<option value="$value[nameid]">$value[name]</option>
			<!--{/loop}-->
			</select>&nbsp;<button type="submit" name="messagesearch" value="true">搜索</button>
		</form>
	</div>
	<!--人检索-->
	<div id="user" class="tabcontent" style="display: none;">
		<form id="searchuserform" action="{S_URL}/batch.search.php" method="post">
			<label for="spacename">博客名称</label><input type="text" name="spacename" id="spacename" />&nbsp;
			<div id="more" style="display:none;">
				<div>
					<label for="username">用户名</label><input type="text" name="username" id="username" />
				</div>
				<div>
					<label for="province">所在地</label>
					<script language="javascript" type="text/javascript">showprovince('province', 'city', '');</script>
					<script language="javascript" type="text/javascript">showcity('city', '');</script>
				</div>
				$requiredtext
				$requiredselect
				
			</div>
			<button type="submit" name="usersearch" value="true">搜索</button>
			<script language="javascript" type="text/javascript">
			<!--
				function setUserClass() {
					var userDiv = getbyid('searchuserform');
					if ( userDiv.className == '' ) {
						userDiv.className = 'open';
					} else {
						userDiv.className = '';
					}
				}
				function setText(obj) {
					if (obj.innerHTML=='[高级搜索]') {
						obj.innerHTML='[关闭高级搜索]';
					} else {
						obj.innerHTML='[高级搜索]';
					}
					
				}
			//-->
			</script>
			<span onclick="display('more');setUserClass();setText(this);" style="cursor: pointer;">[高级搜索]</span>
		</form>
	</div>
	<!--圈子检索-->
	<div id="group" class="tabcontent" style="display: none;">
		<form action="{S_URL}/batch.search.php" method="post">
			<label for="searchkey2">圈子名</label><input type="text" name="searchkey" id="searchkey2" />&nbsp;
			<button type="submit" name="groupsearch" value="true">搜索</button>
		</form>
	</div>
</div>
<!--{else}-->
<div class="block topblock">
	<a href="{S_URL}/batch.search.php" class="more">重新搜索</a>
	<h3>
		<strong>搜索结果</strong>
	</h3>
	<ul class="msgtitlelist">
		<!--{loop $iarr $value}-->
			<!--{if !empty($usersearch)}-->
				<li><a href="$value[url]" target="_blank">[{$value[username]}]$value[spacename]</a></li>
			<!--{elseif !empty($groupsearch)}-->
				<li><a href="$value[url]" target="_blank">$value[groupname]</a> (<a href="{S_URL}/?$value[uid]" target="_blank">$value[username]</a>, #date("Y-n-d H:i:s", $value["dateline"])#)</li>
			<!--{else}-->
				<li>[{$lang[$value[type]]}] <a href="$value[url]" target="_blank">$value[subject]</a> (<a href="{S_URL}/?$value[uid]" target="_blank">$value[username]</a>, #date("Y-n-d H:i:s", $value["dateline"])#)</li>
			<!--{/if}-->
		<!--{/loop}-->
	</ul>
</div>
<div class="pagediv">
	$multipage
</div>
<!--{/if}-->

{template site_footer}