<?php include _include(APP_PATH.'view/htm/header.inc.htm');?>

<!--{hook search_start.htm}-->

<div class="row">
<!--{hook zsb.htm}-->
	<div class="col-lg-9 main">

<form action="<?php echo url('search');?>" id="form">
<div class="card">				
					<div class="input-group mb-3-3">
						<input type="text" class="form-control" placeholder="<?php echo lang('keyword');?>" name="keyword" value="<?php echo $keyword_decode;?>">
						<div class="input-group-append">
							<button class="btn btn-primary" type="submit" id="submit"><span class="icon iconfont">&#xe7b5;</span></button>
						</div>
					</div>
				
					<?php if($search_type == 'like' || $search_type == 'fulltext') { ?>

						<?php if($search_range == 0 || $search_range == 1) { ?>
						
						<input class="form-check-input-5" type="radio" name="range" value="1" <?php echo $range == '1' ? 'checked' : '';?>>
						
						<?php } ?>
					<?php } ?>

					</div>
				</form>






		<?php if($keyword) { ?>

		<?php if($range == 1) { ?>

		<?php if($threadlist) { ?>
		
		<div class="card">
			<div class="card-x card-thread">
				<ul class="nav card-header-tabs">
					<li class="nav-item">
						<h5><span class="g-1"></span><span class="g-2">搜索结果</span></h5>
					</li>
					<!--{hook search_thread_list_nav_item_after.htm}-->
				</ul>
			</div>
			<div class="card-body">
				<ul class="list-unstyled threadlist mb-0">
					<!--{hook search_threadlist_before.htm}-->
					<?php include _include(APP_PATH.'view/htm/thread_list.inc.htm');?>
					<!--{hook search_threadlist_after.htm}-->
				</ul>
			</div>
		</div>
		
		<?php } else { ?>
		
		<div class="card">
			<div class="card-thread">
				无结果
			</div>
		</div>
		
		<?php } ?>
		
		<?php include _include(APP_PATH.'view/htm/thread_list_mod.inc.htm');?>
		
		<!--{hook search_page_before.htm}-->
		<?php if($pagination) { ?>
		<nav><ul class="pagination justify-content-center"><?php echo $pagination; ?></ul></nav>
		<?php } ?>
		<!--{hook search_page_end.htm}-->

		<?php } elseif($range == 0) { ?>

		<div class="card">
			<div class="card-body">
				<div class="card-title">
					<div class="media">
						<div>
							<?php echo lang('post_list');?>
						</div>
						<div class="media-body text-right">
							<!--{hook search_post_list_title_right.htm}-->
						</div>
					</div>
				</div>
				<ul class="list-unstyled postlist">
						<!--{hook search_postlist_before.htm}-->
						<?php include _include(APP_PATH.'view/htm/post_list.inc.htm'); ?>
						<!--{hook search_postlist_before.htm}-->
				</ul>
			</div>
		</div>

		<?php } ?>
		<?php } ?>
	</div>
<div class="col-lg-3 aside">
	
		<!--{hook index_site_brief_before.htm}-->
		<div class="card card-site-info border-1">
			<!--{hook index_site_brief_start.htm}-->
			<div class="m-3">
				<h5><span class="g-1"></span><span class="g-2">网站数据</span></h5>
				<div class="g-3">
				<span class="g-4">
				<span class="icon iconfont icon1">&#xe7b2;</span>
				<span class="g-5">
				讨论 <?php echo $runtime['threads'];?>
				</span>
				</span>
				
				<span class="g-4">
				<span class="icon iconfont icon1">&#xe773;</span>
				<span class="g-5">
				成员 <?php echo $runtime['users'];?>
				</span>
				</span>
				
				<span class="g-4">
				<span class="icon iconfont icon1">&#xe702;</span>
				<span class="g-5">
				在线 <?php echo $runtime['onlines'];?>
				</span>
				</span>
				</div>
			</div>
			</div>
			<!--{hook index_site_brief_end.htm}-->
		</div>
		
		
		</div>
		</div>
	</div>

</div>

<!--{hook search_end.htm}-->

<?php include _include(APP_PATH.'view/htm/footer.inc.htm');?>

<script>
var jform = $('#form');
var jsubmit = $('#submit');
var jrange = jform.find('input[name="range"]');
var jkeyword = jform.find('input[name="keyword"]');
jform.on('submit', function() {
	var range = jrange.checked();
	var keyword = jkeyword.val();
	window.location = xn.url('search-' + xn.urlencode(keyword) + '-' + range);
	return false;
});



$('li[data-active="fid-<?php echo $fid;?>"]').addClass('active');
</script>



<!--{hook search_js.htm}-->