<?php
include_once("inc/config.php");
include_once("inc/publicfun.php");
include_once("inc/ftbbsdbclass.php");
include_once("inc/pageclass.php");
include_once("inc/ftcode.php");
include_once("conn.php");

$userid=intval($_GET["userid"]);
$id=intval($_GET["id"]);
$photo_name=ftbbs_request($_GET["photo_name"]);
$sign=$_GET["sign"];
if ($_SESSION["passok"]!="" && $_SESSION["userid"]==$userid){
   $sign="(sign=0 or sign=2)";
}
else{
   $sign="sign=0";
}

include_once("memberinfo.php");

$p = new ft_page;
$sql="SELECT * FROM {$tablepre}ftbbs_upload WHERE (bbs_blog_type=1 or bbs_blog_type=2) and photo_name='".$photo_name."' and clubuser_id=".$userid." and ".$sign." order by indate desc";
$rs=mysql_query($sql);
$myrow = mysql_fetch_array($rs);
$numrows = mysql_num_rows($rs);

$p->pvar="page"; 
$p->setvar(array("userid" => $userid,"photo_name" => $photo_name,"sign" => $sign));
$p->set(20,$numrows,$psize); 
$rsx=mysql_query($sql." limit ".$p->limit());
?>
<html><head><meta http-equiv=content-type content="text/html; charset=utf-8>">
</head>

<body>
<center>
<title><?=$username?>的个人相册</title>
<link rel="stylesheet" type="text/css" href="<?=$cssfile?>">
<link rel="stylesheet" type="text/css" href="blogcss/blogpage.css">
<?
include_once("usernav.php");
include_once("photohead.php");
?>
<div class="stage">
<div class="stagepad">

<div style="width:100%">
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="modth">
<tr><td class="modtl" width="7">&nbsp;</td>
<td class="modtc" nowrap><div class="modhead"><a href="myphoto.php?id=<?=$id?>&userid=<?=$userid?>" class="modtit">相册列表</a> &gt;&gt; <span class="modtit"><?=$photo_name?></span></div></td>
<td class="modtc" nowrap align="right"></td>
<td class="modtr" width="7">&nbsp;</td>
</tr></table>
<div id="m_albumlist" class="modbox">
<!--<strong>简介：</strong>-->
<div style="width:100%">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<?
if ($numrows!=0){
  while ($myrow = mysql_fetch_array($rsx)) {
    $i++;
    if ($myrow["bbs_blog_type"]==2){
       $photourl=$myrow["upload_pic"];
	}
    else{
       $photourl=$myrow["upload_pic"];
    }
?>
<td align="center" valign="bottom" width="25%">
	<a href="mypic.php?id=<?=$myrow["id"]?>&userid=<?=$userid?>&photo_name=<?=$myrow["photo_name"]?>"><img src="<?=$photourl?>" width="200" border="0" resize="1"></a>
	<div class="tit"><span class="size"><?=$myrow["upload_size"]?>K</span></div>
</td>
<?
  if ($i % 4==0){
  echo "</tr><tr><td colspan=\"4\"><div class=\"line\">&nbsp;</div></td></tr><tr>";
  }
}
 //while ($myrow = mysql_fetch_array($rsx));
}
?>
</tr>
</tr><tr><td colspan="4"><div class="line">&nbsp;</div></td></tr><tr>
</table>
<div id="page">
<?
$p->output(0);
mysql_free_result($rs);
mysql_free_result($rsx);
$db->close(); 
?>
</div>
</div>
</div>
<table width="100%" border="0" cellspacing="0" cellpadding="0" height="8">
<tr><td class="modbl" width="7">&nbsp;</td>
<td class="modbc">&nbsp;</td>
<td class="modbr" width="7">&nbsp;</td>
</tr></table>
</div>
</div>
</div>
</div>
<br>
<center>
<?
include_once("tail.php");
?>
</center>
</center>
</body>
</html>