<!--<?php print <<<EOT
-->
<div class="hd">
	<span class="fr">獲得約 {$total} 條結果，用時{$totaltime}秒</span>
<!--
EOT;
if(in_array($type,array("thread","special"))){
	$siderInner = $_COOKIE['searchtoggle']!=='0' ? '隱藏側邊欄' : '顯示側邊欄';
print <<<EOT
-->
			<a href="javascript:;" onclick="toggleSidebar()" title="側欄開關">&laquo; <span id="siderInner">{$siderInner}</span></a>
<!--
EOT;
} else {
print <<<EOT
-->
			<a href="searcher.php?type=thread">搜索</a> &gt; $typeTitle
<!--
EOT;
}
print <<<EOT
-->
</div>
<!--
EOT;
if($total){
print <<<EOT
--> 
<div class="main_min">
<div id="mainbox">
<!--
EOT;
if (($type == "thread" || $type == 'special') && $threads ) {
$mainTmpStyle = $_COOKIE['searchtoggle']!=='0' ? 'main cc' : 'main cc sideClose';
print <<<EOT
-->
<div class="$mainTmpStyle" id="sidebar">
	<div class="grid_3 cc mb20">
		<div class="md">
<!--
EOT;
require printEOT('searcher_threadleftside');
print <<<EOT
-->
		</div>
		<div class="cm">
			<div class="cw cc">
<!-- 
EOT;
if($admincheck || $superedit || $superdelete ){
print <<<EOT
-->		
				<form action="mawhole.php?" method="post" id="search" name="SEARCH">
				 <input type="hidden" value="$verifyhash" name="verify">
				<input type="hidden" name="action" value="" id="action" />
				<input type="hidden" name="fid" value="$fid" />
<!-- 
EOT;
}
print <<<EOT
--> 
				<div class="dlA">		
<!--
EOT;
if ($adverts) {print <<<EOT
-->
<!--
EOT;
	foreach ($adverts as $advert) {
	print <<<EOT
-->
				<div class="promotion">
					$advert
				</div>
<!--
EOT;
	}}print <<<EOT
-->	

<!-- 
EOT;
$isGM = S::inArray($windid, $manager);
foreach($threads as $thread){
print <<<EOT
-->
					<dl id="search_{$thread[tid]}">
						<dt>
<!-- 
EOT;
if($admincheck || $superedit ){
print <<<EOT
-->                   	
	                	<input type="checkbox" value="$thread[tid]" name="tidarray[]"> 
<!-- 
EOT;
}
$threadUrl = ($threadrange == 3) ? "job.php?action=topost&tid=".$thread[tid]."&pid=".$thread[pid] : "read.php?tid=".$thread[tid];
print <<<EOT
-->                	
	                	<a href="{$threadUrl}" target="_blank" class="tlink">$thread[subject]</a>
<!-- 
EOT;
if($admincheck || $superedit ){
print <<<EOT
-->                     
						- <a href="post.php?action=modify&fid={$thread[fid]}&tid={$thread[tid]}&pid=tpc&article=0" target="_blank" class="s2">編輯</a>
<!-- 
EOT;
}
print <<<EOT
-->
						</dt>
<!--
EOT;
if($thread[imgTotal]){
$imgStype = $thread[imgTotal] > 1 ? '<div class="imgs"><img src="images/blank.gif" /></div>' : '';
print <<<EOT
-->
            <dd class="fr"><div class="fl"><div class="img cp"><a href="javascript:;" onclick="showImg({$thread[tid]},{$thread[firstImgId]});"><img style="background:url({$thread[firstImgUrl]}) center center no-repeat;" src="images/blank.gif" /></a></div></div>{$imgStype}</dd>
<!-- 
EOT;
}
print <<<EOT
-->
						<dd>
<!--
EOT;
if ($threadrange != 3) {
print <<<EOT
-->
							<div class="num">{$thread[replies]}條回復,{$thread[hits]}次瀏覽</div>
<!--
EOT;
}
print <<<EOT
-->
							<div class="text">$thread[content]</div>
							<div class="author"><cite>$thread[postdate] -</cite><!--
EOT;
if(!$isGM && $thread['anonymous'] == 1){print <<<EOT
-->
匿名
<!--
EOT;
}else{print <<<EOT
-->
						作者: <a href="{$db_userurl}$thread[authorid]">$thread[author]</a>
<!-- 
EOT;
}
print <<<EOT
-->
						 - <a href="thread.php?fid={$thread[fid]}">{$thread[name]}</a></div>						
						</dd>
					</dl>
<!-- 
EOT;
}
print <<<EOT
-->
				</div>
<!-- 
EOT;
if($admincheck || $superdelete || $superedit ){
print <<<EOT
-->
	            	<div class="manage cc">
	                <label><input name="" type="checkbox" value="" onclick="CheckAll(this.form)" >全選</label>
<!--
EOT;
if($admincheck && $fid ){
print <<<EOT
-->
									<span class="bt2"><span><button type="button" onclick="searchSubmit('headtopic');">置頂</button></span></span>
									<span class="bt2"><span><button type="button" onclick="searchSubmit('digest');">精華</button></span></span>
									<span class="bt2"><span><button type="button" onclick="searchSubmit('lock');">鎖定</button></span></span>
									<span class="bt2"><span><button type="button" onclick="searchSubmit('pushtopic');">提前</button></span></span>
									<span class="bt2"><span><button type="button" onclick="searchSubmit('downtopic');">壓帖</button></span></span>
									<span class="bt2"><span><button type="button" onclick="searchSubmit('edit');">加亮</button></span></span>
									<span class="bt2"><span><button type="button" onclick="searchSubmit('type');">分類主題</button></span></span>
									<span class="bt2"><span><button type="button" onclick="searchSubmit('move');">移動</button></span></span>
									<span class="bt2"><span><button type="button" onclick="searchSubmit('copy');">復制</button></span></span>
									<span class="bt2"><span><button type="button" onclick="searchSubmit('del');">刪除</button></span></span>
<!--
EOT;
}if( $superdelete && !$fid ){
print <<<EOT
-->
									<span class="bt2"><span><button type="button" onclick="searchSubmit('delall');">刪除</button></span></span>
<!-- 
EOT;
}
print <<<EOT
-->                 
	                </div>
	            </form>
<!-- 
EOT;
}
print <<<EOT
-->  
				<div class="cc mb20">
					$pager
				</div>		
<!--
EOT;
require printEOT('searcher_searchinput');
print <<<EOT
-->
			<!--end-->
			</div>
		</div>
		<div class="sd">
			<div class="sidebar">
<!--
EOT;
list($htmlAdvert,$arrayAdvert) = pwAdvert('Site.Search.Thread.Right','');
if($htmlAdvert){print <<<EOT
-->
<div style="height:200px;width:200px;">
<div class="tac mb5">$htmlAdvert</div>
</div>
<!--
EOT;
}print <<<EOT
-->
					<div>{$rightSearchResult}</div>				
<!--
EOT;
if($hotwords){
print <<<EOT
-->     
				<div class="boxA">
					<h2><a>熱門搜索</a></h2>
					<ul>
<!-- 
EOT;
foreach($hotwords as $hotword){
print <<<EOT
-->
						<li><a href="searcher.php?keyword={$hotword}&type=thread">$hotword</a></li>
<!-- 
EOT;
}
print <<<EOT
--> 
					</ul>
				</div>
<!-- 
EOT;
}
print <<<EOT
-->
			</div>
		</div>
	</div>
</div>
<script type="text/javascript">
var searchSubmit = function(type){
	if(!type) return false;
	getObj("action").value = type;
	var form = getObj("search");
	var ischeck = false;
	var del = [];
	var threadIds = '';
	var count = 0;
	for (var i = 0; i < form.elements.length; i++) {
		var e = form.elements[i];
		if (e.type == 'checkbox' && e.checked == true ) {
			var v = e.value;
			ischeck = true;
			threadIds += v+"|";
			del.push(v);
			count += 1;
		}
	}
	if(!ischeck){
		showDialog('error',"請選擇操作的帖子");
		return false;
	}
	if(type == "delall"){
		showDialog("confirm","確定要刪除帖子嗎?",0,function(){
			var data = "&fid=all&step=2&verify={$verifyhash}&tidarray="+threadIds;
			ajax.send("mawhole.php?action=delall&ajax=1",data,function(){
				for(i=0;i<del.length;i++){
					var t = document.getElementById("search_"+del[i]);
					if(t){
						t.innerHTML="";
					}
				}
				if(count >= 10){
					location.href = 'searcher.php?keyword={$keyword}&type=thread';
				}else{
					showDialog('success',ajax.request.responseText,1);
				}
			});
		});
		return false;
	}
	setTimeout(function(){
		form.submit();
	},0);
}

</script>	
<!--
EOT;
} elseif ($type == "user" && $users) {
print <<<EOT
-->
	<div class="user_main cc">
<!-- 
EOT;
foreach($users as $user){
print <<<EOT
-->  
	<dl class="cc">
		<dt><a href="{$db_userurl}$user[uid]" target="_blank"><img src="{$user[face]}"></a></dt>
		<dd class="one">
			<div class="name"><a href="{$db_userurl}$user[uid]" target="_blank">$user[username]</a></div>
			<ul>
				<li>性別︰$user[gender]</li>
				<li>星座︰$user[constellation]</li>
				<li>來自︰$user[location]</li>
				<li>簽名︰$user[introduce]</li>
			</ul>
		</dd>
		<dd class="two">
			<ul>
				<li><a href="u.php?a=info&uid={$user[uid]}" target="_blank">查看個人資料</a></li>
				<li><a href="javascript:;" onclick="return Attention.add(this,'{$user['uid']}',0)" class="s7 follow">加關注</a></li>
				<li><a href="message.php?type=post&username={$user[username]}" target="_blank">發消息</a></li>
				<li><a href="{$db_userurl}{$user[uid]}" target="_blank">去TA家</a></li>
			</ul>
		</dd>
	</dl>
<!-- 
EOT;
}
print <<<EOT
-->
</div>
<div style="padding:10px 0 0 10px;" class="cc">
 $pager
</div>
<div class="p10 cc" style="width:555px;margin-left:auto;margin-right:auto;">
<!--
EOT;
require printEOT('searcher_searchinput');
print <<<EOT
-->
</div>
<!--
EOT;
} elseif ($type == "diary" && $diarys) {
print <<<EOT
-->
<div class="main cc sideClose">
	<div class="grid_3 cc mb20">
		<div class="cm">
			<div class="cw cc">
				<div class="dlA">
<!-- 
EOT;
foreach($diarys as $diary){
$diary[dtid] = $diary[dtid] == 0 ? '-1' : $diary[dtid];
print <<<EOT
-->
					<dl>
						<dt><a href="apps.php?q=diary&uid={$diary[uid]}&a=detail&did={$diary[did]}" class="tlink" target="_blank">$diary[subject]</a></dt>
						<dd>
							<div class="num">$diary[c_num]條回復 - $diary[r_num]次瀏覽</div>
							<div class="text">$diary[content]</div>
							<div class="author"><cite>$diary[postdate] -</cite>作者︰<a href="{$db_userurl}{$diary[uid]}" target="_blank" class="mr20">$diary[username]</a></div>
						</dd>
					</dl>
<!-- 
EOT;
}
print <<<EOT
-->  			
				</div>
				<div class="cc mb20">$pager</div>
<!--
EOT;
require printEOT('searcher_searchinput');
print <<<EOT
-->
			</div>
		</div>
		<div class="sd">
			<div class="sidebar">
<!--
EOT;
list($htmlAdvert,$arrayAdvert) = pwAdvert('Site.Search.Diary.Right','');
if($htmlAdvert){print <<<EOT
-->
<div style="height:200px;width:200px;">
<div class="tac mb5">$htmlAdvert</div>
</div>
<!--
EOT;
}print <<<EOT
-->
                
	<div class="boxA">
		<h2><a href="searcher.php?type=diary&keyword={$keyword}&step=2&diaryrange=$diaryrange">全部時間</a></h2>
		<ul>	
<!-- 
EOT;
if ($timesFilterList) {
    $filterDateUrl = "searcher.php?type=diary&keyword={$keyword}&step=2&diaryrange=$diaryrange&";
    foreach ($timesFilterList as $key=>$value) {
print <<<EOT
-->
            <li id="posttime_{$value['starttime']}"><a href="{$filterDateUrl}diarystarttime={$value[starttime]}&diaryendtime={$value[endtime]}&">$value[title]</a></li>
<!--
EOT;
    }
}
print <<<EOT
-->
            
            
		</ul>
		<script>setCurrent('posttime_{$diarystarttime}','','current');</script>
<!--
EOT;
if($hotwords){
print <<<EOT
-->     
					
		<h2><a>熱門搜索</a></h2>
		<ul>
<!-- 
EOT;
foreach($hotwords as $hotword){
print <<<EOT
-->
		<li><a href="searcher.php?keyword={$hotword}&type=diary">$hotword</a></li>
<!-- 
EOT;
}
print <<<EOT
--> 
							
		</ul>
				
<!-- 
EOT;
}
print <<<EOT
-->
		
	</div>
			</div>
		</div>
	</div>
</div>
<!--
EOT;
} elseif ($type == "group" && $groups) {
print <<<EOT
-->
	<div class="forum_main cc">
<!--
EOT;
foreach($groups as $group){
print <<<EOT
-->
		<dl class="cc" style="height:85px;">
			<dt><a href="apps.php?q=group&cyid={$group[id]}" target="_blank"><img class="img" width="60" height="60" src="$group[cnimg]"></a></dt>
			<dd>
				<div class="name"><a href="apps.php?q=group&cyid={$group[id]}" target="_blank" class="f16 b">$group[cname]</a></div>
				<div class="seahr"></div>
				<div class="text">$group[descrip]</div>
				<div class="info">分類︰$group[sname]，成員︰$group[members]，積分︰$group[credit]，更新︰$group[createtime]</div>
			</dd>
		</dl>
<!--
EOT;
}
print <<<EOT
-->
	</div>
	<div style="padding:10px 0 20px 20px;" class="cc">
	$pager
	</div>
	<div class="p10 cc" style="width:555px;margin-left:auto;margin-right:auto;">
<!--
EOT;
require printEOT('searcher_searchinput');
print <<<EOT
-->
	</div>
<!--
EOT;
} elseif ($type == 'forum' && $forums) {
print <<<EOT
-->
<div class="forum_main cc main_min">
<!-- 
EOT;
foreach($forums as $forum){
print <<<EOT
-->
	<dl class="cc">
		<dt><a href="thread.php?fid={$forum[fid]}" target="_blank"><img src="$forum[logo]"></a></dt>
		<dd>
			<div class="name cc"><a href="thread.php?fid={$forum[fid]}" class="f14 b" target="_blank">$forum[name]</a>
			<span id="favorforum{$forum[fid]}">
<!--
EOT;
if ($forum['favor']) {print <<<EOT
-->
			<a href="javascript:favorforum($forum[fid]);" class="keepon" title="將本版塊移出我的書簽">取消收藏</a>
<!--
EOT;
} else {print <<<EOT
-->
			<a href="javascript:favorforum($forum[fid]);" class="keep" title="將本版塊添加到我的書簽">收藏本版</a>
<!--
EOT;
}

$forum[descrip_sub] = substrs($forum[descrip],120);
$forum[descrip_title] = strip_tags($forum[descrip]);
print <<<EOT
-->
</span>
			</div>
			<div title="$forum[descrip_title]">$forum[descrip_sub]</div>
			<div>
<!--
EOT;
if ($forum['admin']) {print <<<EOT
-->
			版主︰{$forum['admin']}
<!--
EOT;
}print <<<EOT
-->
			</div>
		</dd>
	</dl>
<!-- 
EOT;
}
print <<<EOT
--> 


	<div class="c"></div>
</div>
	<div style="padding:10px 0 20px 20px;" class="cc">
	$pager
	</div>
	<div class="p10 cc" style="width:555px;margin-left:auto;margin-right:auto;">
<!--
EOT;
require printEOT('searcher_searchinput');
print <<<EOT
-->
	</div>
<script>
function favorforum(fid) {
	ajax.send('pw_ajax.php?action=shortcut&fid='+fid,'',function(){
		ajax.guide();
		var rText = ajax.request.responseText.split('	');
		if (typeof(rText[1]) != 'undefined' && rText[1] == 'successok') {
			getObj('favorforum'+fid).innerHTML = "<a title=\"將本版塊移出我的書簽\" onclick=\"javascript:favorforum("+fid+");\" class=\"keepon\">取消收藏</a>";
		} else if (typeof(rText[1]) != 'undefined' && rText[1] == 'successno') {
getObj('favorforum'+fid).innerHTML = "<a title=\"將本版塊添加到我的書簽\" onclick=\"javascript:favorforum("+fid+");\" style=\"cursor:pointer;\" class=\"keep\">收藏本版</a>";
		
		}
	});
}
</script>
<!--
EOT;
} elseif ($type && $lists) {
	require printEOT('searcher_'.$type);
}
} else {
	require printEOT('searcher_none');
print <<<EOT
-->
<!--
EOT;
}
print <<<EOT
-->
</div>
</div>
<!--
EOT;
?>-->