<?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"]);
$blogtypeid=intval($_GET["blogtypeid"]);

if ($blogtypeid!=""){
   $idstr=" and ftblog.blogtypeid=".$blogtypeid;
}
else{
   $idstr="";
}
include_once("memberinfo.php");

$NewsDate=$_GET["NewsDate"];
if ($NewsDate!=""){
$arr=explode("-",$NewsDate);
$yy=$arr[0];
$mm=$arr[1];
$dd=$arr[2];
}
?>
<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="c2t1">
<div id="mod_bloglist" class="mod" rel="drag">
	<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"><span class="modtit">文章列表</span></div></td>
	<td class="modtc" nowrap align="right"></td>
	<td class="modtr" width="7">&nbsp;</td>
	</tr></table>
<div id="m_blog" class="modbox">
<?
$p = new ft_page;
if ($NewsDate!=""){
$sql="select {$tablepre}ftblog.id,{$tablepre}ftblog.blogtitle,{$tablepre}ftblog.blogtypeid,{$tablepre}ftblog_type.blogtype,{$tablepre}ftblog.blogcontent,{$tablepre}ftblog.writedate,{$tablepre}ftblog.blogplnum,{$tablepre}ftblog.hits from {$tablepre}ftblog,{$tablepre}ftblog_type where year({$tablepre}ftblog.writedate)='".$yy."' and month({$tablepre}ftblog.writedate)='".$mm."' and day({$tablepre}ftblog.writedate)='".$dd."' and {$tablepre}ftblog.blogtypeid={$tablepre}ftblog_type.id and {$tablepre}ftblog.sign=0 and {$tablepre}ftblog_type.blogphoto=0 and {$tablepre}ftblog.userid=".$userid." ".$idstr." order by {$tablepre}ftblog.id desc";
}
else{
$sql="select {$tablepre}ftblog.id,{$tablepre}ftblog.blogtitle,{$tablepre}ftblog.blogtypeid,{$tablepre}ftblog_type.blogtype,{$tablepre}ftblog.blogcontent,{$tablepre}ftblog.writedate,{$tablepre}ftblog.blogplnum,{$tablepre}ftblog.hits from {$tablepre}ftblog,{$tablepre}ftblog_type where {$tablepre}ftblog.blogtypeid={$tablepre}ftblog_type.id and {$tablepre}ftblog.sign=0 and {$tablepre}ftblog_type.blogphoto=0 and {$tablepre}ftblog.userid=".$userid." ".$idstr." order by {$tablepre}ftblog.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($blogpagesize,$numrows,$psize); 
$rsx=mysql_query($sql." limit ".$p->limit());
if ($numrows!=0){
while ($myrow = mysql_fetch_array($rsx)){
$blogcontent=substr(nohtml($myrow["blogcontent"]),0,200)
?>
	<div class="line">&nbsp;</div>
	<div class="tit"><a href="myblog.php?id=<?=$myrow["id"]?>&userid=<?=$userid?>&blogtypeid=<?=$myrow["blogtypeid"]?>"><?=$myrow["blogtitle"]?></a></div>
	<div class="date"><?=$myrow["writedate"]?> &nbsp;&nbsp;<?if ($myrow["xinqin"]!=""){?>心情:&nbsp;<?=$myrow["xinqin"]?><?}?></div>
	<div class="cnt"><?=$blogcontent?></div></br>
    <div class="opt"><a href="boker.php?blogtypeid=<?=$myrow["blogtypeid"]?>&userid=<?=$userid?>" title="查看该分类中所有文章">类别：<?=$myrow["blogtype"]?></a> | <a href="myblog.php?id=<?=$myrow["id"]?>&blogtypeid=<?=$myrow["blogtypeid"]?>&userid=<?=$userid?>#comment" title="查看该文章的所有评论">评论(<?=$myrow["blogplnum"]?>)</a> | <a href="myblog.php?id=<?=$myrow["id"]?>&blogtypeid=<?=$myrow["blogtypeid"]?>&userid=<?=$userid?>" title="浏览全文">浏览全文(<?=$myrow["hits"]?>)</a></div>
<?
}
?>
<div class="line">&nbsp;</div>
<div class="ftblog">
<?
$p->output(0);
?>
</div>
<?
}
else
{
?>
<div class="date">数据为空</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>

</td>
<td class="c2t2">&nbsp;</td>
<td valign="top" class="c2t3">
<div id="mod_profile" class="mod" rel="drag">
<?
include_once("Rblog.php");
?>
</div>
</td>
</tr></table>
</div>
</div>
<br><center>
<?
include_once("tail.php");
?>
  </center>
</center>
</body>
</html>