<?php 
require "../Run.php";
require "../include/page.inc.php";
require "../include/reply.fun.php";
$view=mysql_query("SELECT gro,title,content,time FROM liuyan WHERE lid=
'{$_GET['id']}'");
if($view && mysql_num_rows($view)>0){
list($gro,$title,$content,$time)=mysql_fetch_row($view);
}else{
$tip="抱歉 内容获取失败";
}
$title = $title; 
//统计字数
function utf8_strlen($string = null) {
preg_match_all("/./us", $string, $match);
return count($match[0]);
}

//长度处理
$l=800;
$text = mb_substr($content,$s,$l,"UTF-8");
$html .= head($title);
$html .= topNav('留言阅读','<a href="list.php?cid='.$gro.'">列表</a>','<a href="../index.php">首页</a>');
$html .= '<div class="title">'.$title.'</div>';
$html .= '<div class="subtitle">[作者:'
.$userid.'|时间'.$time.']</div>';
$html .= '<div class="content">'.$text.'</div>';	
//输出
echo UBB($html);
$nums    =   utf8_strlen($content);
$limit   =   $l;
$url     =   'content.php?cid='.$_GET['cid'].'&id='.$_GET['id'].'&';
echo page($nums,$limit,$url,NULL,'view');
if($login == 1){			
echo "<div class=\"title\">发表评论</div>\n
	<form  method=\"post\" action=\"reply.php\">\n
	<textarea type=\"input\" name=\"content\"></textarea>\n
	<input type=\"hidden\" name=\"gro\" value=\"".$_GET['id']."\"><br>\n
	<input type=\"submit\" value=\"发表评论\">\n
	</form>
	</div>";
}else{
echo'赶快登陆发表您的评论吧！';
}
echo listReply($_GET['id'],'liuyan');
echo footer(1);