<?php
$bt ="影像回忆";
include("../conn.php");
include("../head.php");
include_once("../function.php");
$page=sqlstr($_GET['page']);
$sid = sqlstr($_COOKIE['dl']);
$uin=mysql_fetch_array(mysql_query("select * from user where sid='$sid'"));
$id=$uin['id'];

if(!$uin){
header("Location:../login.php");
exit;//跳转到登录页面
}

echo '<div class="hui"><div class="zuo">我的影像</div><div class="you"><a href="add.php">+上传</a> | <a href="index.php">返回</a></div></div>';


$max=mysql_num_rows(mysql_query("SELECT * FROM pic WHERE piczzid='$id'"));
$p=ceil($max/6);
if(!$page or $page>$p){
$page=1;
}
$low=6*($page-1);//开始查询的条数
$pagesize=6;//每页查询的条数
$rs=mysql_query("SELECT * FROM pic WHERE piczzid='$id' ORDER BY pictime DESC LIMIT {$low},{$pagesize}");//列出最新公开的日记


while($uinfo=mysql_fetch_array($rs)){
$time=ctime($uinfo['pictime']); 
echo '<div id="main"><div class="youlist">　</div><a href="'.$uinfo["pic"].'"><img src="/m/t.php?purl='.$_SERVER['SERVER_NAME'].$uinfo["pic"].'"/>原图</a><br/>　　'.$uinfo["pictxt"].'<br/><br/><div class="you"><div class="time">'.$time.'</div></div></div>';
}

if($max){
echo '<br/><div class="hui"> <center> ';
if($page>1){
$pag=$page-1;
echo '<a href="all.php?page='.$pag.'">上一页</a>　';
} if($page<$p){
$page=$page+1;
echo  '　<a href="all.php?page='.$page.'">下一页</a>';
}
$pa=$page-1;
echo '</center>';
echo '共'.$p.'页/第'.$pa.'页/'.$max.'条字记</div>';
}else{
echo '<br/>还没有人记录感动的影像<br/><br/>';
}

?>


<?php include("../footer.php"); ?>