<div class="content">
<?php
  global $db;
  $row1=$db->getrow("Select * from ".Getdbname('pic')." where CS_ID=".$id."");
  $picnum=$db -> num_rows($db -> query("select * from ".Getdbname('photo')." where CS_CID=".$id.""));
     if($picnum>0){
	   $rs=$db->query("select * from ".Getdbname('photo')." where CS_CID=".$id." order by CS_id desc limit 1");
	   $row2=$db->fetch_array($rs);
           $pid=$row2['CS_ID'];
	   $rowu=$db->getrow("Select * from ".Getdbname('photo')." where CS_ID<$pid and CS_CID=".$id." order by CS_ID desc");
	   if($rowu){
	        $xlink=userlink('pick',$cscms_uid,$rowu['CS_ID']);
	   }else{
	        $xlink="#";
	   }
	   $rowd=$db->getrow("Select * from ".Getdbname('photo')." where CS_ID>$pid and CS_CID=".$id." order by CS_ID asc");
	   if($rowd){
	        $slink=userlink('pick',$cscms_uid,$rowd['CS_ID']);
	   }else{
	        $slink="#";
	   }
     }
?>
     <div class="main">
		<div class="box photo photo_list">
			<h3 id="img">
                <a href="###" class="h3_a1">我的相册</a>-
                <a href="###" class="h3_a2"><?php echo $row1['CS_Name']?></a>
            </h3>
      <?php if($picnum>0){ ?>
			<div class="page1">
                <img src="images/arrow_left.gif" />
                <a href="<?php echo $slink?>">上一张</a>
                &nbsp;&nbsp; &nbsp;&nbsp;共<?php echo $picnum?>张&nbsp;&nbsp;&nbsp;&nbsp;
                <a href="<?php echo $xlink?>">下一张</a>
                <img src="images/arrow_right.gif" />
            </div>
			<div class="img_x"><a href="<?php echo $xlink?>" title="下一张"><img src="<?php echo piclink('pic',$row2['CS_Url'])?>"></a></div>
			<p class="tex_center">
                <span><?php echo $row1['CS_Name']?></span>
			    <em>上传时间：<?php echo $row2['CS_AddTime']?>&nbsp;&nbsp;</em>
                <a href="<?php echo piclink('pic',$row2['CS_Url'])?>" target="_blank">查看原图</a><br />
			</p>	
      <?php } ?>		
		</div>
    </div>
	<div class="right">
		<div class="rig user photo1">  
			<h3>相册介绍</h3>
			<div class="user_info">
            
				<p class="user_pic"><img alt="<?php echo $row1['CS_Name']?>" src="<?php echo piclink('pic',$row1['CS_Pic'])?>" onerror="javascript:this.src='images/none.gif'"/></p>
				<p class="user_mode">
				<strong>相册名称：</strong><?php echo $row1['CS_Name']?><br />
                <strong>相册描述：</strong><?php echo $row1['CS_Content']?><br />
                <strong>相册张数：</strong>共<?php echo $picnum?>张照片<br />
                        最后更新：<?php echo $row1['CS_AddTime']?><br />
				</p>
                
			</div>
		</div>
	</div>
 
    </div>

