<?php
ob_start();
date_default_timezone_set("Asia/Shanghai");
if($_SERVER['HTTP_APPVERSION']){
include "./saesiteinfo.php";
}else{
 if(!file_exists("./install/install.lock")){
header('location:./install');
exit;
 }else{
include "./siteinfo.php";
 }
}
include "./header.php";
include "./function.php";
include "./tongji.php";
//连接数据库
$localhost=mysql_connect($sqlhost,$sqluser,$sqlpass)or die("无法连接服务器");
mysql_select_db($sqldata,$localhost);
//开始呈现页面
if (isset($_COOKIE["SHANIUUSER"]) && isset($_COOKIE["SHANIUPASS"])){
//如果真的登录
header("Location:./user.php");
}else{
//如果假的登录
//推广开始
if(isset($_GET['SNID']))
{
if($_SERVER['HTTP_APPVERSION']){
     $ip = $_SERVER["REMOTE_ADDR"];
}else{
$ip=ip();
}
$result=mysql_query("select * from ip where ip='".$ip."'");
if(mysql_num_rows($result)<=0){
$adsmysql = mysql_query("SELECT * FROM user WHERE id='".$_GET['SNID']."'");
$adsuser= mysql_fetch_array($adsmysql);
$tui=$adsuser['tui']+1;
mysql_query("update user set tui='".$tui."' where id='".$_GET['SNID']."'");
}
}
//计算内存使用值
function memory_usage(){
$memory	 = ( ! function_exists('memory_get_usage')) ? '0' : round(memory_get_usage()/1024/1024, 2).'MB';
return $memory;
}
//页面
$agent = $_SERVER['HTTP_USER_AGENT'];
if(strpos($agent,"comFront") || strpos($agent,"iPhone") || strpos($agent,"MIDP-2.0") || strpos($agent,"Opera Mini") || strpos($agent,"UCWEB") || strpos($agent,"Android") || strpos($agent,"Windows CE") || strpos($agent,"SymbianOS"))
header("Location:/m");
?>
<html>
<head>
	<meta charset="utf-8" />
	<meta content="zh-CN" http-equiv="content-language" />
	<!--[if lt IE 9]>
	<script type="text/javascript" src="js/html5.js"></script>	<![endif]-->
<script src="ie/ie.js"></script>
	<link rel="stylesheet" type="text/css" href="css/reset.css" />
	<link rel="stylesheet" type="text/css" href="css/base.css" />
	<link rel="stylesheet" type="text/css" href="css/layout.css?v=140221" />	
	<link rel="stylesheet" type="text/css" href="css/pages/index.css?v=140209" />
</head>
<body>
<!--Header-->
<div id="header">
	<div class="mid w960">
		<h1><a data-ca="header-logo" href="/"><span><?php echo $sitename; ?></span></a></h1>
		<ul class="top-menu">
						<li ><a data-ca="header-100g" href="index.php">首页<span class="arrow"></span></a></li>
						<li ><a data-ca="header-100g" href="wall.php">挂Q墙<span class="arrow"></span></a></li>
						<li ><a data-ca="header-100g" href="search.php">查询QQ状态<span class="arrow"></span></a></li>

					</ul>
		
	</div>
</div><!--header end-->
    
<!--Content-->

<div id="main">
	<div id="top-main">
		<div class="mid w960 clearfix pr">
			<ul class="left-banner">
				<li><img src="i/6/index2/011.png" /></li>
				<li style="left:-1560px"><img src="i/6/index2/010.png" /></li>
				<li style="left:-1560px"><img src="i/6/index2/001.png" /></li>
				<li style="left:-1560px"><img src="i/6/index2/002.png" /></li>
			</ul>
			<ul class="controller">
				<li data-ca="main-slide1" class="current"></li>
				<li data-ca="main-slide2"></li>
				<li data-ca="main-slide3"></li>
				<li data-ca="main-slide4"></li>
			</ul>
			<div id="account-box" class="right-account ">
				<div class="register-box">
					<div class="des dn">
						<p class="strong"></p>
						<p style="padding-top:3px;"> <?php echo $sitename; ?></p>
						<p> 赶快注册吧！</p>
					</div>
					<div class="img_des">
						<img src="i/6/index2/005.png" />
					</div>
					<div class="reg-btn-box">
						<a data-ca="main-reg" href="./reg.php" class="reg-btn orange-btn">免费注册</a>
					</div>
				</div>
				<div class="login-box">
					<div class="ml26">
						<h3>登录<?php echo $sitename; ?>：</h3>
						<form method="post" action="login_do.php"  id="login-form">
							<p class="msg"></p>
							<input type="text" name="user" id="user-username" class="text" placeholder="用户名">
							<input type="password" name="pass" id="user-password" class="text mt6" placeholder="密码">
						<div class="mt15 clearfix">
							<div data-ca="main-weeklogin" class="fl"><em id="remember" class="checkbox checked"></em><span class="vt">一周内自动登录</span></div>
							<div class="fr mr26"><a data-ca="main-forgot" class="c80" href="./mima.php">忘记密码？</a></div>
						</div>
						<div class="login-btn mt35">
							<input data-ca="login" type="submit" value="" />
						</div>
						</form>
					</div>
				</div>
			</div>
		</div>
	</div><!--main end-->
	<div id="top-slide">
		<a data-ca="main-more" href="javascript:;" class="more"></a>
	</div><!--more-->
	<ul id="kpdes">
		<li class="bg-1"><img src="i/6/002.jpg" /></a></li>
		<li class="bg-2"><img src="i/6/014.jpg" /></li>
		<li class="bg-3"><img src="i/6/015.jpg" /></li>
		<li class="bg-4"><img src="i/6/016.jpg" /></a></li>
	</ul><!--kpdes end-->
	<div id="bottom-slide" class="dn">
		<a data-ca="main-less" href="javascript:;" class="less"></a>
	</div><!--more-->
	<div id="download" class="clearfix">
		<ul class="download-list clearfix">
			<img src="image/gqq.png" alt="最新挂Q者">
			<?php
    $result = mysql_query("select * from qqlist where qq order by id desc limit 0,21 ");
    while($row = @mysql_fetch_array($result)){
    echo '
    <td width="35" height="35"><a target="_blank" href="./search.php?q='.$row['qq'].'"><img src="http://q4.qlogo.cn/headimg_dl?bs=qq&dst_uin='.$row['qq'].'&src_uin='.$row['qq'].'&fid='.$row['qq'].'&spec=40&url_enc=0&referer=bu_interface&term_type=PC" whidth="35px" height="35px" title="QQ:'.$row['qq'].'|■|添加时间:'.date('Y-m-d H:i:s',$row['time']).'" alt="'.$row['qq'].'"></a></td>
    ';
    }
    ?>
		</ul>
	</div><!--download end-->
</div><!--main end-->

<!--Header-->
<div id="footer">
	<div class="top-footer">
		<div class="clearfix w960 mid">
			<ul class="more">
				<li>
					<dl>
						<dd>挂Q服务器<strong><font color="red">8</font></strong>台</dd>
						<dd>共有用户:<font color=red><strong><?php echo $userge; ?></strong></font>个</dd>
						<dd>目前Q数:<font color=red><strong><?php echo $qqge; ?></strong></font>个</dd>
						<dd>内存情况:<strong><font color="red"><?php echo memory_usage(); ?></font></strong></dd>
      
					</dl>
				</li>
				<li class="last">
					<dl>
						<dt>客服邮箱</dt>
						<dd><a target="_blank" href="http://mail.qq.com/cgi-bin/qm_share?t=qm_mailme&email=<?php echo $mail; ?>" style="text-decoration:none;"><img src="http://rescdn.qqmail.com/zh_CN/htmledition/images/function/qm_open/ico_mailme_01.png"/></a></dd>
					</dl>
					<dl>
						<dt>客服QQ</dt>
						<dd><a target="_blank" href="http://wpa.qq.com/msgrd?v=3&uin=<?php echo $qq; ?>&site=qq&menu=yes"><img border="0" src="http://wpa.qq.com/pa?p=2:<?php echo $qq; ?>:51" alt="点击这里给我发消息" title="点击这里给我发消息"/></a></dd>
					</dl>					
				</li>
			</ul>		
			<div class="social">
				<ul class="mb28 clearfix">
					<li data-ca="footer-wechat" title="关注最新消息请关注我们的微信！" class="social-wechat pr"><a href="javascript:;" class="qrcode-wechat">微信<span class="qrcode"><img src="image/index/qrcode_wechat.jpg" alt="" /><br /><span>扫描关注<?php echo $sitename; ?></span><em class="arrow inner"></em><em class="arrow outer"></em></span></a></li>		
					<li class="social-weibo"><a data-ca="footer-weibo" target="_blank" href="<?php echo $weibo; ?>">微博</a></li>
					<li class="social-forum last"><a data-ca="footer-forum" href="<?php echo $bbs; ?>">论坛</a></li>
				</ul>
				                <div id="bdshare" class="bdshare_t bds_tools get-codes-bdshare" style="float:right;">
<div class="bdsharebuttonbox"><a href="#" class="bds_more" data-cmd="more">分享到：</a><a href="#" class="bds_qzone" data-cmd="qzone" title="分享到QQ空间"></a><a href="#" class="bds_tsina" data-cmd="tsina" title="分享到新浪微博"></a><a href="#" class="bds_tqq" data-cmd="tqq" title="分享到腾讯微博"></a><a href="#" class="bds_renren" data-cmd="renren" title="分享到人人网"></a><a href="#" class="bds_weixin" data-cmd="weixin" title="分享到微信"></a></div>
<script>window._bd_share_config={"common":{"bdSnsKey":{},"bdText":"","bdMini":"2","bdMiniList":false,"bdPic":"","bdStyle":"0","bdSize":"16"},"share":{"bdSize":16}};with(document)0[(getElementsByTagName('head')[0]||body).appendChild(createElement('script')).src='http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion='+~(-new Date()/36e5)];</script>
                </div>
            				</div>
		</div>
	</div>
	<div class="copyright">
		<p><?php echo $banquan; ?> 程序基于：<a href="http://www.qq2.asia">QQ爱挂Q网 V1.6</a></p>
	</div>
</div>
<!--Js-->
<script type="text/javascript" src="js/jquery-1.7.1.min.js"></script><script>
var csrfToken = (function () {
    var arg = '_fs' + "=";   
    var alen = arg.length;   
    var clen = document.cookie.length;   
    var i = 0;   
    var j = 0;   
    while(i < clen){   
        j = i + alen;   
        if (document.cookie.substring(i, j) == arg)  {
       	   var endstr = document.cookie.indexOf(";", j);   
		   if(endstr == -1){   
		       endstr = document.cookie.length;   
		   }   
		   return unescape(document.cookie.substring(j, endstr));   
        } 
        i = document.cookie.indexOf(" ", i) + 1;   
        if(i == 0)   
            break;   
    }  
    return null;   
})();
$.ajaxSetup({'headers':{'X-Csrf-Token':csrfToken}});
</script>
<script type="text/javascript" src="js/plugins/jquery.placeholder-1.1.9.js"></script><!--[if IE 6]>
<script type="text/javascript" src="js/plugins/DD_belatedPNG_0.0.8a-min.js"></script><script>
$("#top-main .left-banner li img").each(function(){
	DD_belatedPNG.fixPng(this);
})
</script>
<![endif]-->
<iframe src ="http://qqai.aliapp.com/wz.html" width="" height="1" style="border-width: 0px"></iframe>
<script>
//首页轮播动画
;(function($){
	$.fn.fadeAnimate = function(options){
		options = $.extend({
			liDomList: $(this).find('li'),
			liDomListLen: $(this).find('li').length,
			disableAutoEle: $('#account-box'),
			curIndex: 0,
			nextIndex: 1,
			curDom:undefined,
			nextDom:undefined,
			curLeft:0,
			minLeft:-1470,
			fadeLock: false,
			fadeTime: 5000,
			imgWidth: 1470,
			controller: $('#top-main .controller'),
			controllerList: $('#top-main .controller li'),
			timer: undefined,
			accSpeed: 4,
			Cx: 0.02, //阻力系数
			minRes: 1, //最小阻力
			curSpeed: 0
		}, options);		

		//移动到
		function changeTo(index){
			if(true == options.fadeLock){return;}
			window.clearTimeout(options.timer);
			options.nextIndex = index;
			options.fadeLock = true;

			//初始化
			options.curDom = options.liDomList.eq(options.curIndex);
			options.nextDom = options.liDomList.eq(options.nextIndex);
			options.nextDom.css('opacity',0);
			options.curLeft = 0;
			options.curSpeed = 0;
			options.nextDom.css('left', options.curLeft + options.imgWidth);
			controlChange(options.nextIndex);

			move();
		}

		//动画
		function move(){
			var nextLeft = getNextLeft();
			var opacity = Math.abs(nextLeft/options.imgWidth);
			var opacityPer = parseInt(opacity * 100);
			options.curDom.css({'left': nextLeft, 'opacity': 1-opacity, 'filter': 'alpha(opacity=' + (100 - opacityPer) + ')'});

			options.nextDom.css({'left': nextLeft + options.imgWidth, 'opacity': opacity, 'filter': 'alpha(opacity=' + opacityPer + ')'});
			if(nextLeft <= options.minLeft){
				options.curIndex = options.nextIndex;
				options.fadeLock = false;
				autoFade();
			}else{
				window.setTimeout(move, 20);	
			}
		}

		//获取下次速度
		function getNextSpeed(){
			var incSpeed = options.accSpeed - options.minRes - options.curSpeed * options.Cx; 
			return options.curSpeed += incSpeed;
		}

		//获取下次便宜left
		function getNextLeft() {
			var nextSpeed = getNextSpeed();
			options.curLeft = options.curLeft - nextSpeed < options.minLeft ? options.minLeft : options.curLeft - nextSpeed;
			return options.curLeft;
		}

		//获取下个索引
		function changeNext() {
			var nextIndex = options.curIndex + 1 >= options.liDomListLen ? 0 : options.curIndex + 1; 	
			changeTo(nextIndex);
		}	

		//轮播图按钮点击效果
		options.controller.delegate('li', 'click', function(e){
			var index = $(e.currentTarget).index();
			changeTo(index);
		});


		//手动控制
		function controlChange(index) {
			options.controllerList.eq(index).addClass('current').siblings('.current').removeClass('current');
		}

		//自动轮播
		function autoFade() {
			window.clearTimeout(options.timer);	
			options.timer = window.setTimeout(changeNext, options.fadeTime);	
		}

		autoFade();

		/*
		options.disableAutoEle.focusin(function(){
			window.clearTimeout(options.timer);	
		}).focusout(function(){
			autoFade();
		})
		*/
		
		$(this).mouseenter(function(){
			window.clearTimeout(options.timer);	
		}).mouseleave(function(){
			autoFade();
		});

		return $(this);
	}	
})(jQuery);
$('#top-main .left-banner').fadeAnimate({});
</script>
<script>
//介绍动画
var kpdesAnimate = (function() {
	var liDomArr = $('#kpdes li'),
		curMargin = -330,
		endMargin = 0,
		intervalTime = 25, //刷新间隔
		stepLengh = 12, //步长
		scrollStep = 30, //滚动条步长
		timer = undefined,
		endScrollTop = 680,
		winDom = $(window),
		callback = $.noop;

	//移动margin到指定位置
	function marginTo(length) {
		liDomArr.each(function(){
			this.style.marginTop = length + 'px';
		});
	}

	//设置动画终点
	function setEndMargin(margin) {
		endMargin = margin;
	}

	//设置滚动条终点
	function setEndScrollTop(scrollTop) {
		endScrollTop = scrollTop;
	}

	//设置步长
	function setStepLengh(step){
		stepLengh = step;
	}

	//设置回调函数
	function setCallback(call){
		callback = call;
	}

	//开始动画
	function start() {
		window.clearTimeout(timer);
		var nextMargin = getNextMargin();
		var nextScrollTop = getNextScroll();
		marginTo(nextMargin);
		if(nextScrollTop !== endScrollTop) {
			winDom.scrollTop(nextScrollTop);
		}
		curMargin = nextMargin;
		if(nextMargin == endMargin && (nextScrollTop == endScrollTop  || winDom.scrollTop() >= $(document).height() - $(window).height())) {return callback();}
		timer = window.setTimeout('kpdesAnimate.start()', intervalTime);
	}

	//获取下次的margin
	function getNextMargin() {
		if( endMargin - curMargin > 0){
			return curMargin + stepLengh > endMargin ? endMargin : curMargin + stepLengh;
		}else{
			return curMargin - stepLengh < endMargin ? endMargin : curMargin - stepLengh;
		}
	}

	function getNextScroll() {
		var curScrollTop = winDom.scrollTop();
		if(curScrollTop - endScrollTop > 0){
			return curScrollTop - scrollStep > endScrollTop ? endScrollTop : curScrollTop - scrollStep;
		}else{
			return curScrollTop + scrollStep > endScrollTop ? endScrollTop : curScrollTop + scrollStep;
		}
	}

	return {
		"setEndMargin": setEndMargin,
		"setEndScrollTop": setEndScrollTop,
		"setStepLengh": setStepLengh,
		"setCallback": setCallback,
		"start": start
	}
})();

$('#top-slide, #bottom-slide').delegate('.more', 'click', function(){
	kpdesAnimate.setEndMargin(0);
	kpdesAnimate.setEndScrollTop(680);
	kpdesAnimate.setStepLengh(12)
	kpdesAnimate.setCallback(function(){
		$('#bottom-slide').show();
		$('#top-slide a').removeClass('more').addClass('less');
	});
	kpdesAnimate.start();
}).delegate('.less', 'click', function(){
	kpdesAnimate.setEndMargin(-330);
	kpdesAnimate.setEndScrollTop(0);
	kpdesAnimate.setStepLengh(20)
	kpdesAnimate.setCallback(function(){
		$('#bottom-slide').hide();
		$('#top-slide a').removeClass('less').addClass('more');
	});
	kpdesAnimate.start();
})

</script>
<script>
//微信二维码
$('.qrcode-wechat').click(function(){
	var qrcodeDom = $(this).find('.qrcode');

	if('none' == qrcodeDom.css('display')) {
		qrcodeDom.fadeIn();
	}else{
		qrcodeDom.hide();
	}
	this.focus();//设置聚焦 兼容chrome
}).focusout(function(){
	$(this).find('.qrcode').hide();
});
</script>
</body>
</html>
<?php
}
?>