<!DOCTYPE html>
<!--[if IE 7]>
<html class="ie ie7" lang="zh-CN">
<![endif]-->
<!--[if IE 8]>
<html class="ie ie8" lang="zh-CN">
<![endif]-->
<!--[if !(IE 7) | !(IE 8)  ]><!-->
<html lang="zh-CN">
 <!--<![endif]-->
 <head> 
  <meta charset="UTF-8" /> 
  <meta name="keywords" content="" /> 
  <meta name="description" content="" /> 
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /> 
  <meta name="renderer" content="webkit" /> 
  <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport">
  <meta content="yes" name="apple-mobile-web-app-capable">
  <meta content="black" name="apple-mobile-web-app-status-bar-style">
  <meta content="telephone=no" name="format-detection">
  <title><?php echo $username; ?>的主页_<?php echo $cfg_webname; ?></title> 
  <!--[if lt IE 9]>
    <script src="{dede:global.cfg_cmsurl/}/skin/1.0/js/html5.js" type="text/javascript"></script>
  <![endif]--> 
  <link rel="stylesheet" href="{dede:global.cfg_cmsurl/}/skin/1.0/css/font-awesome.min.css?ver=1.0" type="text/css" media="all" /> 
  <link rel="stylesheet" href="{dede:global.cfg_cmsurl/}/skin/1.0/css/style.css?ver=1.0" type="text/css" media="all" /> 
  <link rel="stylesheet" href="{dede:global.cfg_cmsurl/}/skin/1.0/css/user_style.css?ver=1.0" type="text/css" media="all" /> 
  <script type="text/javascript" src="{dede:global.cfg_cmsurl/}/skin/1.0/js/jquery.min.js?ver=1.0"></script> 
  <script type="text/javascript" src="{dede:global.cfg_cmsurl/}/skin/1.0/js/jquery-migrate.min.js?ver=1.0"></script> 
  <script type="text/javascript" src="{dede:global.cfg_cmsurl/}/skin/1.0/js/m.js?ver=1.0"></script>
  <script language="javascript" type="text/javascript" src="{dede:global.cfg_cmsurl/}/i/ajax_main.js"></script>
  <script type="text/javascript" src="{dede:global.cfg_cmsurl/}/skin/1.0/js/jquery.lazyload.js?ver=1.0"></script> 
  <script type="text/javascript">
      $(function() {
        $('img[data-original]').lazyload({
          effect: "fadeIn"
        });
      })
  </script>
  <style type="text/css">
  .not-found{text-align:center;}
  </style>
 </head> 
 <body>
<?php pasterTempletDiy("head.htm"); ?>
<div id="container" class="container">
   <div class="sub-billboard billboard authors large" style="background-image:url(<?php echo $user_bgo; ?>)"> 
    <div class="wrapper"> 
     <div class="inner"> 
      <div class="author-information"> 
       <div class="user-avatar">
        <img src="<?php echo $space_face; ?>" class="avatar" width="100" height="100" />
       </div> 
       <div class="user-name">
        <?php echo $username; ?>
       </div> 
       <div class="user-profile"> 
        <ul id="index_space">
        </ul> 
       </div> 
      </div> 
     </div> 
    </div> 
   </div> 
   <div class="content writer centralnav"> 
    <div id="guide" class="navcaret"> 
     <div class="group"> 
      <ul> 
	   <li <?php echo $dows; ?>><a href="<?php echo $cfg_cmsurl; ?>/i/?uid=<?php echo $uid; ?>&type=dows"><span>下载 (<?php echo $dowtj;?>)</span></a></li>
       <li <?php echo $likes; ?>><a href="<?php echo $cfg_cmsurl; ?>/i/?uid=<?php echo $uid; ?>&type=likes"><span>喜欢 (<?php echo $likestj;?>)</span></a></li>
       <li <?php echo $stows; ?>><a href="<?php echo $cfg_cmsurl; ?>/i/?uid=<?php echo $uid; ?>&type=stows"><span>收藏 (<?php echo $stowstj;?>)</span></a></li>
      </ul> 
     </div> 
    </div> 
    <div id="primary" class="primary grid" role="main"> 
     <div class="article" role="main">
      <ul id="list"> 
      </ul>
      <?php echo $nodata; ?>
      <nav class="navigation paging-navigation">
		<div class="pagination loop-pagination" id="pagecount"></div>
	  </nav>
     </div> 
    </div> 
   </div> 
  </div>
<?php pasterTempletDiy("footer.htm"); ?>
<script language="javascript" type="text/javascript" src="<?php echo $cfg_cmsurl; ?>/i/index_space_ajax.php?uid=<?php echo $uid; ?>"></script>
<script language="javascript" type="text/javascript">
var curPage = 1; //当前页码
        var total,pageSize,totalPage;
        //获取数据
        function getData(page){ 
            $.ajax({
                type: 'POST',
                url: '{dede:global.cfg_cmsurl/}/i/json_user_index.php?type=<?php echo $type; ?>&uid=<?php echo $uid; ?>',
                data: {'pageNum':page-1},
                dataType:'json',
                beforeSend:function(){
                    $("#list").append("<div id='loading'><img src='{dede:global.cfg_cmsurl/}/images/loadinglit.gif' /><br>loading...</div>");
                },
                success:function(json){
                    $("#list").empty();
                    total = json.total; //总记录数
					$i = total;
                    pageSize = json.pageSize; //每页显示条数
                    curPage = page; //当前页
                    totalPage = json.totalPage; //总页数
                    var li = "";
                    var list = json.list;
                    $.each(list,function(index,array){ //遍历json数据列
						li += "<li class='group'><div class='item'><div style='height:180px;overflow:hidden'>";
						li += "<a target='_blank' href='{dede:global.cfg_cmsurl/}/moban/"+array['id']+".html' title='"+array['title']+"'><img width='280' alt='"+array['title']+"' src='"+array['litpic']+"' /></a></div>";
						li += "<div class='meta'><div class='title'>";
						li += "<h2><a target='_blank' href='{dede:global.cfg_cmsurl/}/moban/"+array['id']+".html' rel='bookmark' title='"+array['title']+"'>"+array['title']+"</a></h2></div> ";
						li += "</div>";
						li += "<div class='data'><time class='time'><i class='fa fa-date'></i> "+array['senddate']+" </time></div></div>";
						li += "</li>";
                    });
                    $("#list").append(li);
                },
                complete:function(){ //生成分页条
                    getPageBar();
                },
                error:function(){
                    alert("数据加载失败");
                }
            });
        }
        
        //获取分页条
        function getPageBar(){
            //页码大于最大页数
            if(curPage>totalPage) curPage=totalPage;
            //页码小于1
            if(curPage<1) curPage=1;
            pageStr = "<a class='page-numbers ym'>"+curPage+" / "+totalPage+"</a>";
            
            //如果是第一页
            if(curPage==1){
                //pageStr += "<span>首页</span><span>上一页</span>";
            }else{
                pageStr += "<a class='page-numbers' href='javascript:void(0)' rel='1'>首页</a><a class='prev page-numbers' href='javascript:void(0)' rel='"+(curPage-1)+"'><i class='fa fa-chevron-left'></i></a>";
            }
            
            //如果是最后页
            if(curPage>=totalPage){
                //pageStr += "<span>下一页</span><span>尾页</span>";
            }else{
                pageStr += "<a class='next page-numbers' href='javascript:void(0)' rel='"+(parseInt(curPage)+1)+"'><i class='fa fa-chevron-right'></i></a><a class='page-numbers' href='javascript:void(0)' rel='"+totalPage+"'>尾页</a>";
            }
                
            $("#pagecount").html(pageStr);
        }
        
        $(function(){
            getData(1);
            $("#pagecount a").live('click',function(){
                var rel = $(this).attr("rel");
                if(rel){
                    getData(rel);
                }
            });
        });
</script>

</body>
</html>