<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>搜索微博 - Powered By X微博</title>
<link href="<?php echo W_BASE_URL;?>css/base.css" rel="stylesheet" type="text/css" />
<link href="<?php echo W_BASE_URL;?>css/skin_default/skin.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="<?php echo W_BASE_URL;?>js/jquery.min.js"></script>
<script>
function search(keyword, type) {
		var keyword = $.trim(keyword);
		var m = 'search.user';
		if (keyword == '' || keyword == '请在这里输入朋友的昵称') {
			return;
		}
		type = type || 'user';
		if (type == 'user') {
			m = 'search.user';
		} else {
			m = 'search';
		}
		window.location.href = '?m=' + m + '&k=' + encodeURIComponent(keyword);
}
$(function() {
	$('#keyword').focus(function(){
		if (this.value == '请在这里输入朋友的昵称') {
				this.value = '';
		}
	}).blur(function() {
		if ($.trim(this.value) == '') {
			this.value = '请在这里输入朋友的昵称';
			$('#search_btn').addClass('disabled');
		}
	}).keyup(function(e){
			if(e.keyCode == 13) {
				search($('#keyword').val(), 'weibo');
			}
			if (this.value == '' || this.value == '请在这里输入朋友的昵称') {
				$('#search_btn').addClass('general-btn-disabled');
			} else {
				$('#search_btn').removeClass('general-btn-disabled');
			}
	})

})
</script>
</head>
<body>
	<div id="wrapper">
    	<!-- header -->
		<?php include APP::tplFile('header');?>
		<!-- end header -->	
        <div id="container">
        	<div class="sidebar">
            	<div class="top10">
                	<div class="sidebar-head">人气关注榜 Top10</div>
                    <ul>
                    	<?php for ($i=0,$count=count($top_followers); $i< $count; $i++) {?>
                    	<li>
							<div class="ranking skin-bg"><?php echo $i+1;?></div>
							<span><?php echo number_format($top_followers[$i]['followers_count']);?></span>
							<a href="<?php echo URL('ta', 'id=' . $top_followers[$i]['uid']);?>"><?php echo $top_followers[$i]['screen_name'];?></a>
                        </li>
                        <?php }?>
                    </ul>
                </div>
                
                          
            </div>
            <div class="main">
            	<div class="title-box">
            		<div class="title-tab">
                    	<span class="post-btn" id="sendBtn"><a href="#">我要发微博</a></span>
                    	<span class="tab-current"><span>找微博</span></span>
						<a class="tab-link" href="<?php echo URL('search.user');?>"><span>找用户</span></a>
                    </div>
                    <div class="search">
                    	<input type="text" class="onfocus" id="keyword" value="<?php echo V('g:k','请在这里输入朋友的昵称');?>" />
						<a class="general-btn <?php if (V('g:k','') == '')echo 'disabled';?>" id="search_btn" href="javascript:search($('#keyword').val(), 'weibo');"><span>搜索</span></a>
                    </div>
                </div>
				<div class="search-default">
					<?php if (!V('g:k')) {?>
					<p>请在上方输入框中填写要搜索的微博内容/话题关键字</p>
					<?php }?>
                </div>
				<?php if (isset($list) && empty($list)) {?>
				<div class="search-default">
					<p>还没有人说过<span><?php echo htmlspecialchars(V('g:k',''));?></span>呢，想说几句吗?</p>
                </div>
				<?php } else {?>
					<?php include APP::tplFile('feed_list');?>
				<?php }?>
            </div>
        </div>
        <!-- footer -->
		<?php include APP::tplFile('footer');?>
        <!-- end footer -->
    </div>

    <div class="pop-window post-window fixed-window hidden">
        <div class="pop-t"></div>
        <div class="pop-content">
            <h4 class="pop-title x-bg"><a class="close-btn icon-bg" href="#"></a>爱说就说吧</h4>
            <div class="post-box">
                <div class="key-tips out140 icon-bg">您还可以输入<span>140</span>字</div>
                <div class="post-textarea skin-bg"><textarea></textarea></div>
                <div class="add-area">
                    <a class="face-icon icon-bg" href="javascript:;">表情</a>
                    <span class="hidden">fdsafadsf.gif<a class="close-btn icon-bg" href="#"></a></span>
                    <a class="pic-icon icon-bg" href="javascript:;">照片</a>
                    <a class="video-icon icon-bg" href="javascript:;">视频</a>
                    <a class="music-icon icon-bg" href="javascript:;">音乐</a>
                    <a class="topic-icon icon-bg" href="javascript:;">话题</a>
                </div>
                <div class="share-btn skin-bg"></div>
                <form class="upload-pic"><input type="file" value="" /></form>
                <div class="post-tips">请输入要发布的微博内容</div>
                <div class="post-success all-bg"></div>
             </div>
        </div>
        <div class="pop-b"></div>
        <div class="pop-tl all-bg"></div>
        <div class="pop-tr all-bg"></div>
        <div class="pop-bl all-bg"></div>
        <div class="pop-br all-bg"></div>
    </div>
    <div class="shade-div hidden"></div>
<script type="text/javascript" src="<?php echo W_BASE_URL;?>js/common.js"></script>
<script type="text/javascript" src="<?php echo W_BASE_URL;?>js/ui.js"></script>
<script type="text/javascript">
$(function(){
	setTimeout(function(){
		XWB.notifyChecker.start();
	}, 3000);
	XWB.publishBox.init($('#sendBtn'));
	XWB.bindSearch($('#search'), $('#searchSubmit'));
	XWB.setList($('#feed-list').highlight([$('#keyword').val()]));
	XWB.linkRender();
	XWB.comment.init();
})
</script>
</body>
</html>
