<?php error_reporting(0);?>
  <div class="album_content"> 
   <div class="album_nav"> 
    <ul> 
     <li<?php if($view == "new"){echo " class=\"current\"";} ?>><a href="<?php echo rewrite_url('top.php?do=album&view=new');?>">最新照片</a></li> 
     <li<?php if($view == "hot"){echo " class=\"current\"";} ?>><a href="<?php echo rewrite_url('top.php?do=album&view=hot');?>">人气排行</a></li> 
    </ul> 
   </div> 
  </div> 
  <div class="album_content"> 
	<?php
		global $db;
		$a = 0;
		$lpids="";
		if($view == 'hot'){
			$sql = "select * from ".tname('pic')." order by cd_hits desc";
		}elseif($view == 'like'){
			$sql = "select * from ".tname('pic')." order by cd_praisenum desc";
		}else{
			$sql = "select * from ".tname('pic')." order by cd_addtime desc";
		}
		$Arr = getwebpage($sql,100,"top.php?do=album&view=".$view);
		$result = $db->query($Arr[2]);
		$num = $Arr[5];
		if($num==0){
			echo '<div class="nothing">暂时还没有照片啊！</div>';
		}else{
			if($result){
				echo '<ul class="album" id="imageList"></ul>';
				echo '<div id="imgLoading" class="album_loading"></div>';
				echo '<div id="imgPages" class="album_button" style="display:none;">';
				while ($row = $db ->fetch_array($result)){
					$a=$a+1;
					$user = $db->getrow("select cd_nicheng from ".tname('user')." where cd_id='".$row['cd_uid']."'");
					$lpids=$lpids."{'pid': ".$row['cd_id'].",'src':'".getalbumthumb($row['cd_url'],2)."','create_time':'".datetime(date('Y-m-d H:i:s',$row['cd_addtime']))."','uid':".$row['cd_uid'].",'replyNum':".$row['cd_replynum'].",'width':".$row['cd_width'].",'height':".$row['cd_height'].",'avatar':'".linkuserphoto($row['cd_uid'],48)."','nickname':'".$user['cd_nicheng']."'},";
				}
				$lpids=$lpids.']';
				$lpids=ReplaceStr($lpids,",]","");

				if($num>0){ ?>
					<div class="pages">
						<?php echo $Arr[0]; ?><input type="text" maxlength="5" onkeydown="function c(event,val){e = event ? event :(window.event ? window.event : null);if(e.keyCode==13){val = parseInt(val);val=isNaN(val)||(val<=0)?1:val;window.location.href=zone_domain+'<?php echo "top.php?do=album&view=".$view."&pages="; ?>'+val;return false;}else{return true;}};if(!c(event,this.value))return false;" title="输入页码，按回车快速跳转"/>
					</div>
				<?php }
				echo '</div>';
			}
		}
	?>
  </div> 
<script type="text/javascript" src="<?php echo cd_webpath?>user/static/js/jquery/jquery.min.js"></script>
<script type="text/javascript" src="<?php echo cd_webpath?>user/static/js/core.js"></script>
<script type="text/javascript" src="<?php echo cd_webpath?>user/static/js/card.js"></script>
<script type="text/javascript" src="<?php echo cd_webpath?>user/static/js/dialog.js"></script>
<script type="text/javascript" src="<?php echo cd_webpath?>user/static/site/js/common.js"></script>
  <script type="text/javascript" src="<?php echo cd_webpath?>user/static/js/jquery/jquery.masonry.min.js"></script> 
  <script type="text/javascript" src="<?php echo cd_webpath?>user/static/space/js/album.js"></script> 
<script type="text/javascript">
	nav.init();
	nav.userMenu();
	libs.checkLogin();
	var imgDatas = [<?php echo ReplaceStr($lpids,"]",""); ?>];
	imgLoaded.init('#imageList', imgDatas, 1);
</script> 
<?php include_once('source/space_footer.php');?> 
 </body>
</html>