<?php
require "../e/class/connect.php";
require "../e/class/db_sql.php";
require "../e/member/class/user.php";
$link=db_connect();
$empire=new mysqlquery;
require "class/fun.php";
$ur=user_returnlogin();
$userid=$ur[userid];
$username=$ur[username];
$nickname=getnickname($ur[userid]);
$email=$ur[email];
$isqqcheck=$ur[isqqcheck];
$headerimg=$ur[userpic]?$ur[userpic]:'temp/images/avatar.jpg';
$lastlogintime=date('Y-m-d H:i:s',$ur[lasttime]);
$regtime=date('Y-m-d H:i:s',$ur[registertime]);
if(!$email){
	if($isqqcheck){
$email='<a href="pass.php" style="color:#F00;">点此设置邮件</a><script>alert("您是QQ登陆用户，还没有设置信箱，不能进行订阅，如需订阅请先设置信箱！")</script>';
	}
	else{
	$email='<a href="pass.php" style="color:#F00;">点此设置邮件</a>';
	}
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>我的首页 - 会员中心 -<?=$public_r[sitename]?></title>
<? include_once "temp/header.php"; ?>
<div id="content" class="layout">
  <div class="ui-box ui-qire fn-clear" id="i-box">
<? include_once "temp/left.php"; ?>
    <div class="i-box-cnt">
      <div id="i-usershow" class="fn-clear">
      <?php if(!$isqqcheck){ ?>
        <p class="qire-notice" id="i-notice"><a class="close" href="javascript:v;" data="20">关闭</a> 你还没有绑定QQ帐号，<a href="/e/memberconnect/?apptype=qq">点这里绑定</a></p>
      <?  } ?>
        <div class="user-info"><a href="avatar.php"><img src="<?=$headerimg?>" alt="<?=$nickname?>" id="userlogo"/>
          <label class="text">点此设置个性头像</label>
          <label class="mask"></label>
          </a></div>
        <!-- // user-info End -->
        <div class="user-cnt">
          <div id="i-intro">
            <p class="user-author"><strong><?=$nickname?></strong><span>(<?=$email?>)</span><a href="info.php">编辑资料</a></p>
            <ul class="user-sign fn-clear">
              <li class="regtime">
                <label>注册时间：</label>
                <?=$regtime?></li>
              <li class="lastlogin">
                <label>最后登录：</label>
                <?=$lastlogintime?></li>
            </ul>
          </div>
          <!-- // i-intro end -->
          <div id="i-message" class="fn-clear">
            <form method="post" action="" id="addsign">
              <textarea class="ui-input ui-textarea" rows="10" cols="60" onfocus="if(this.value=='亲，个性签名能让你个性签哦 ^.^'){this.value='';}" onblur="if(this.value==''){this.value='亲，个性签名能让你个性签哦 ^.^';};"  name="comm_txt"  id="comm_txt">亲，个性签名能让你个性签哦 ^.^</textarea>
              <input type="button" class="ui-button" value="" id="signbt"/>
            </form>
          </div>
          <!-- // i-message end -->
        </div>
        <!-- // user-cnt End -->
      </div>
      <!-- // i-usershow end -->
      <?php
	  if($public_r[add_usergonggao]){
	?>
      <p class="qire-notice" id="i-notice"><a class="close" href="javascript:void(0);" data="20">关闭</a><span style="color:#135294;font-family:tahoma, 宋体, fantasy;font-size:medium;line-height:32px;text-align:center;"><?=$public_r[add_usergonggao]?></span></p>
      <? } ?>
      <!-- // i-notice end -->
      <div id="i-indexcnt" class="fn-clear">
        <div id="i-news">
          <div class="i-tab-nav-box">
            <ul class="i-tab-nav fn-clear">
              <li class="current"><a href="javascript:;" data="class/ajax.php?action=getallnew&show=2" hidefocus>全部动态</a></li>
              <li><a href="javascript:;" data="class/ajax.php?action=getallnew&show=1" hidefocus>关注的人</a></li>
              <li><a href="javascript:;" data="class/ajax.php?action=getallnew&show=0" hidefocus>我的动态</a></li>
            </ul>
          </div>
          <div class="ui-cnt" id="pbl">
            <ul id="list">
            </ul>
            <div id="bbl" class="loading" data="class/ajax.php?action=getallnew&show=2"></div>
          </div>
        </div>
        <!-- // i-news end -->
      </div>
      <!-- // i-indexcnt end -->
    </div>
  </div>
  <!-- // i-box end -->
</div>
<!-- // content end -->
<script type="text/javascript">
	var iswait=0;
	var isstop=0;
	$("#signbt").click(function(){
		$("#addsign").qiresub({
			curobj:$("#signbt"),
			txt:'数据提交中,请稍后...',
			onsucc:function(result){
				$.hidediv(result);
				if(parseInt(result['rcode'])>0){
				$("#comm_txt").val('');
				}
			}
		}).post({url:'class/ajax.php?action=addtalk'});
	});
	window.onload=function(){
		showinfo();
        window.onscroll=function(){
			var h=toTop(document.getElementById('bbl'));
            var clientH=document.documentElement.clientHeight;
            var scrollH=document.documentElement.scrollTop||document.body.scrollTop;
			if(h<(clientH+scrollH)&&iswait==0&&$("#bbl").attr('data')!=''){
				showinfo();
			} 
        }
	}
	function showinfo(){
		$.ajax({url:$("#bbl").attr('data'),success:function(r){
			var rcode=parseInt(r['rcode']);
				if(rcode>0){
				  $("#list").append(r.txt);
				  $("#list").html(r.txt);
				  iswait=0;
				  if(r['nextpage']!=null&&r['nextpage']!=undefined){
					$("#bbl").attr('data',r['nextpage']);}else{
				  $("#bbl").attr('data','').html('');
				  }
				}else{
				$("#bbl").attr('data','').html('');
				}
			},dataType:'json',beforeSend:function(){
				iswait=1;
				$("#bbl").html('<p>正在加载中.....</p>');
			}
		});
	}
	function toTop(obj){
		var top=0;
		while(obj){
			top +=obj.offsetTop;
			obj=obj.offsetParent        
		}
		return top;
    }
	$(".i-tab-nav a").click(function (e){
		$(this).parent().parent().children('li').removeClass('current');
		$(this).parent().addClass('current');
		$("#bbl").attr('data',$(this).attr('data'));
		$("#list").html('');
		showinfo();
	});		
	$("#i-notice .close").click(function(){
		$(this).parent("#i-notice").fadeOut(400, 0, function(){
			$(this).parent("#i-notice").slideUp(400);
			var date = new Date();  
			date.setTime(date.getTime()+600*10000000);  
			document.cookie="acclasttime="+$("#i-notice .close").attr('data')+"; expires=" + date.toGMTString()+";path=/;domain=.qire123.com"; 
		});
		return false;
	});	
</script>
<? include_once "temp/footer.php"; ?>
</body>
</html>