<?php
$bt="流年时刻";
include("../conn.php");
include("../head.php");
include_once("../function.php");
$sid=sqlstr($_COOKIE['dl']);
$user=mysql_fetch_array(mysql_query("select * from user where sid='$sid'"));
if($user){
header("Location:diary.php");
exit;//查询到登录则跳转到个人中心  
}
$diary=mysql_num_rows(mysql_query("SELECT * FROM diary"));
$user=mysql_num_rows(mysql_query("SELECT * FROM user"));
$now=date("Y年m月d日 H时i分");
echo '<div class="hui"><div class="zuo">流年时刻　<a href="/m/one/liulan.php">ONE</a></div><div class="you"><a href="../login.php">登陆</a> | <a href="../reg.php">注册</a></div></div>
<div id="main"><div class="listyou"> 你的痕迹，似水流年，消逝不见<br/>(这里显示了那些公开的)</div></div>';

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


while($uinfo=mysql_fetch_array($rs)){
$writeid=$uinfo['diarywriteid'];
$time=ytime($uinfo['diarytime']); 
$wtime=wtime($uinfo['diarytime']);
$htime=htime($uinfo['diarytime']);
$uina=mysql_fetch_array(mysql_query("select * from user where id='$writeid'"));
$uiname=$uina["name"];
echo '<div id="main"><div class="youlist"><a href="/m/user/?'.$writeid.'">'.$uiname.'</a><div class="time">'.$time.' '.$wtime.'</div></div><div class="time">'.$htime.'</div>'.$uinfo["diarytxt"].'</div>';
}

if($max){
echo '<br/><br/><div class="youlist"> </div><br/><center>MORE......<br/>'.$now.'<br/>已经为<b>'.$user.'</b>人珍藏了<b>'.$diary.'</b>篇日记</center><br/><div class="hui"><div class=zuo>这里显示了那些公开的</div><div class="you"><a href="#C1">顶部</a></div></div>';
}else{
echo "<br/><br/><font color=red>还没有人写字记</font><br/><br/>　　其实生活中值得我们去记录的东西有很多，只是那一份静下心来写字记的宁静最难得。<br/><br/>";
}

?>

<div id="libbottom" class="ll"><a href="../login.php">登录</a> | <a href="../about.php">关于印象</a><br /><?php echo $showtime=date("Y年m月d日 H:i:s");?><br />Linerss.com By Dayin<br/>© 一线印象日记本儿</div>