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

$userid=intval(get_cookie('clubuser_id'));
$blogtypeid=intval($_GET["blogtypeid"]);
if ($blogtypeid!=""){
   $typestr=" and blogtypeid='".$blogtypeid."'";
}

$query = "SELECT * FROM {$tablepre}ftbbsmb";
$ftbbsmb=makecache('ftbbsmb.html',$query,$expire);
$pagesize=$ftbbsmb[5];

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("bokerhead.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 valign="middle"> 
                  <td height="40" colspan="5" class=new14 align="left"><div class="opt"> 
                    <img src="blogimages/post.gif" width="15" height="15"> 
                      <strong><a href="blogcenter_add.php">发表</a></strong></div></td>
                </tr>
                <tr> 
                  <td height="1" colspan="5" bgcolor="#336699" class=new14><spacer height="1" type="block"></td>
                </tr>
                <tr> 
                  
                <td width="65%" height="25"> 
                  <div align="left"><strong>&nbsp;&nbsp;标题</strong></div></td>
                  
                <td width="8%"> 
                  <div align="center">查看</div></td>
                  
                <td width="10%">
<div align="center">置顶</div></td>
                  
                <td width="10%">
<div align="center">推荐</div></td>
                  <td width="7%"><div align="center">删除</div></td>
                </tr>
                <tr> 
                  <td height="1" colspan="5" background="blogimages/dotbg.gif"><spacer height="1" type="block"></td>
                </tr>
<?
$sql="select * from {$tablepre}ftblog where userid=".$userid." ".$typestr." order by writedate desc";
$rs=mysql_query($sql);
$myrow = mysql_fetch_array($rs);
$numrows = mysql_num_rows($rs);
$p = new ft_page;

$p->pvar="page"; 
//$p->setvar(array("userid" => $userid)); 
$p->set($pagesize,$numrows,$psize); 
$rsx=mysql_query($sql." limit ".$p->limit());
if ($numrows!=0){
while ($myrow = mysql_fetch_array($rsx)){		  
?>
                <tr> 
                  <td height="25"><div class="opt">&nbsp;&nbsp;<a href="blog_edit.php?id=<?=$myrow["id"]?>"><?=$myrow["writedate"]?></a>&nbsp; 
                    <a href="blog_edit.php?id=<?=$myrow["id"]?>"><?=$myrow["blogtitle"]?></a></div></td>
                  <td height="25" align="center"><div class="opt"><a href="myblog.php?id=<?=$myrow["id"]?>&userid=<?=$userid?>&blogtypeid=<?=$myrow["blogtypeid"]?>" target="_blank">查看</a></div></td>
                  <td height="25" align="center"><div class="opt">
                      <? if ($myrow["blogtop"]==1){?>
                      <a href="blogop.php?id=<?=$myrow["id"]?>&op=top&v=0"><font color="#FF0000">已置顶</font></a>
                      <? }else{?>
                      <a href="blogop.php?id=<?=$myrow["id"]?>&op=top&v=1">未置顶</a>
                      <? }?>
                    </div></td>
                  <td height="25" align="center"><div class="opt">
				      <? if ($myrow["blogtj"]==1){?>
                      <a href="blogop.php?id=<?=$myrow["id"]?>&op=tj&t=0"><font color="#FF0000">已推荐</font></a>
                      <? }else{?>

                      <a href="blogop.php?id=<?=$myrow["id"]?>&op=tj&t=1">未推荐</a>
                      <? }?>
                    </div></td>
                  <td height="25" align="center"><div class="opt"><a href="blogop.php?id=<?=$myrow["id"]?>&op=del&blogtypeid=<?=$myrow["blogtypeid"]?>">删除</a></div></td>
                </tr>
                <tr> 
                  <td height="1" colspan="5" background="blogimages/dotbg.gif"><spacer height="1" type="block"></td>
                </tr>
<?
}
?>
                <tr> 
                  <td colspan="5" height="35">
<?
$p->output(0);
?>
				  </td>
                </tr>
<?
}
else{
?>
                <tr> 
                  <td colspan="5" height="25">记录为空</td>
                </tr>
<? }?>
              </table>
              <br>
            </div>

</td>
</tr></table>
</div>
</div>
<br><center>
<?
include_once("tail.php");
?>
  </center>
</center>
</body>
</html>