<?php
$bq=$_GET["tip"];
include("alln.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'];
$name=$uin["name"];
 ?>
<div class="hui"><div class="zuo">印象心语</div><div class="you"><a href="add.php">写日记</a> | <a href="/m">返回</a></div></div>
<div id="main">
<?php include("header.php"); 
echo "你好，".$name;
?>
<form action="xieru.php" method="post" ><textarea name="r" cols="30" brows="4"><?php echo $bq; ?></textarea><br/><p>
<input class="libbtn" name="libreg" type="submit" value="写好了" /></p>
</form><br/>


<?php 
$y1=$_GET["y"];
if($y1>0){$y=ceil($y1);}else{$y=1;}
$yq=$y*10-9;
$yh=$y*10;$ys=$y-1;$yx=$y+1;
$a=fopen("liuyan.txt","r");
while(!feof($a))
{
$n=$n+1;$xq=fgets($a);
$x=str_replace("&lt;br/&gt;","<br/>",$xq);
$cd=strlen($x);$n0=$alln-$n+1;
if($cd>153)
{$e=str_split($x,153);$x=$e[0];

$o='<a href="all.php?i='.$n0.'">.....</a>';}else{$o="";}
if($n >= $yq)
{if($n <= $yh)
{
echo '<div class="youlist"> </div><span>['.$n0."楼] ".$x.$o."</span>";}}}



$nu=$n/10+1;
echo "<br/><br/>";
if($ys>0){
echo '<a href="index.php?y='.$ys.'">上页</a>';
}

$nu1=ceil($nu)-1;
echo "< 第".$y."页/共".$nu1."页 >";
if($yx<=$nu){echo '<a href="index.php?y='.$yx.'">下页</a>';
echo "    ";}
fclose($a);
echo '<br /><form action="" method="get" >
<input type="text" name="y" />
<input type="submit" name="y1" value="跳页"/></form><br /> </div> ';
include("../footer.php");
?> 

</body>
</html>