<?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_cookie('clubuser_id'));
$photo_name=ftbbs_request($_GET["photo_name"]);

if ($photo_name==""){
   $typestr="";
} 
else{
   $typestr="and photo_name='".$photo_name."'";
}
include_once("memberinfo.php");
?>
<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">
<table width="100%" border="0" cellspacing="0" cellpadding="0" id="layout">
<tr>
<td valign="top" class="c2t3">
<div id="mod_profile" class="mod" rel="drag">
<?
include_once("usercalog.php");
?>
</div>
</td>
          <td valign="top" class="c2t1"> 
            <div id="m_blog" class="modbox">
              <table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tr> 
                  <td width="64%" height="35" class=new14><div class="opt"><img src="blogimages/up.gif"> 
                    <strong><a href="up_photo.php">上传照片到我的相册</a></strong></div></td>
                  <td width="7%" class=new14>&nbsp;</td>
                  <td width="29%" class=new14><!--<div class="opt"><img src="blogimages/wwwup.gif" width="12" height="12"> 
                    <a href="postpic.php"><strong>网上传图</strong></a></div>--></td>
                </tr>
              </table>
              <table width="100%"  border="0" align="center" cellpadding="0" cellspacing="0">
                <tr> 
                  <td width="100%" height="1" bgcolor="#336699" class=new14><spacer height="1" type="block"></td>
                </tr>
              </table>
              <br>
              <table width="100%" border="0" cellspacing="1" cellpadding="0" align="center">
                <tr align=center> 
<?
$p = new ft_page;
$sql="select * from {$tablepre}ftbbs_upload where (bbs_blog_type=2 or bbs_blog_type=1) and clubuser_id=".$userid." ".$typestr." order by id desc";
$rs=mysql_query($sql);
$myrow = mysql_fetch_array($rs);
$numrows = mysql_num_rows($rs);

$p->pvar="page"; 
$p->setvar(array("userid" => $userid));
$p->set(24,$numrows,$psize); 
$rsx=mysql_query($sql." limit ".$p->limit());
if ($numrows!=0){
  do {
  $i++;
  $photourl="";
  $photourl=$myrow["upload_pic"];
?>
                  
                <td height="171">
<div class="opt"><img src="<?=$photourl?>" width="150" border=0><br>
                    <? if ($myrow["bbs_blog_type"]==2){?>
                    <A HREF="flag_photo.php?id=<?=$myrow["id"]?>&flag=1">[删除相片]</A> 
                    <!--<a href="flag_photo.php?id=<?=$myrow["id"]?>&pic=<?=$myrow["upload_pic"]?>&flag=2">设为形象照</a>-->
                    <? }else{?>
                    <A HREF="flag_photo.php?id=<?=$myrow["id"]?>&flag=1">[删除相片]</A> 
                    <? }?>
                  </div>
					</td>
<?
  if ($i % 3==0){
  echo "<tr align=center>";
  }
}
 while ($myrow = mysql_fetch_array($rs));
?>
                </tr>
                <tr align=center> 
                  <td colspan="15"> <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
                      <tr> 
                        <td width="77%" height="30" align="center"> <div class="opt">
    <?
     $p->output(0);
     mysql_free_result($rs);
     mysql_free_result($rsx);
     $db->close(); 
    ?>
                          </div></td>
                      </tr>
                    </table></td>
                </tr>
<? }else{?>
                <tr> 
                  <td height="25" colspan=15 align="center"> <div class="opt"> 暂时还没有照片!</div></td>
                </tr>
<? }?>
              </table>
              <br>
              <br>
            </div>
</td>
</tr></table>
</div>
</div>
<br><center>
<?
include_once("tail.php");
?>
</center>
</center>
</body>
</html>