<?php
$bt ="点滴记忆";
include("../conn.php");
include("../head.php");
include_once("../function.php");
$sid = sqlstr($_COOKIE['dl']);
$uin=mysql_fetch_array(mysql_query("select * from user where sid='$sid'"));
$id=$uin['id'];


echo '<div class="hui"><div class="zuo"><a href="/m/diary">日记</a>　<a href="/m/one">ONE</a></div><div class="you"><a href="diary.php">流年时刻</a>| 点滴</div></div> <div id="main"><div class="listyou">那些点滴的瞬间,或许早已成为回忆<br/>或许还在心中跳跃,或许我还在想你</div> </div>';

$max=mysql_fetch_array(mysql_query("select * from diary where diaryzz='1'"));

$rs=mysql_query("SELECT * FROM diary WHERE diaryzz='1' ORDER BY rand() DESC LIMIT 0,10");//列出指定文章

while($uinfo=mysql_fetch_array($rs)){
$writeid=$uinfo['diarywriteid'];
$rows=mysql_fetch_array(mysql_query("select * from user WHERE id='$writeid'"));

if(stripos($rows["tx"],"http")!==false){
$tx=$rows["tx"];
}else{
$tx="/m/img.php?t=http://".$_SERVER['SERVER_NAME'].$rows["tx"];
}

$time=ctime($uinfo['diarytime']); 
$uina=mysql_fetch_array(mysql_query("select * from user where id='$writeid'"));
$uiname=$uina["name"];
echo '<div id="main"><div class="youlist"> </div><br/><div><span class="zuo"><img src="'.$tx.'" alt="头像" width="50" height="50" /></span><span class="you">　<font color="red"><b>'.$uiname.'</b></font><br/>　<a href="/m/user/?'.$writeid.'">公开日记»</a></span><br/><br/><div class="time">'.$time.'</div></div>'.$uinfo["diarytxt"].'</div>';
}
if($max){}else{
echo "<br/><br/><font color=red>还没有人公开日记哦</font><br/><br/>";
}
echo '<br/><div class="hui"><div class=zuo>这里随机显示那些公开的</div><div class="you"><a href="/m/diary/diandi.php">点滴瞬间</a></div></div><br/>';

include("../footer.php");
?>

