<?php 
	require "../Run.php";
	require "../include/reply.fun.php";
	require "../include/page.inc.php";
	$limit = 15;
	function start($limit){
		$page = $_GET['p'];
		if($page == NULL || $page <= 0){
			$page = 1;
		}
		$start = ($page-1) * $limit;
		return $start;
	}
		$sql="SELECT lid,userid,title,gro FROM liuyan WHERE lid='{$_GET['id']}'";
		$view = mysql_query($sql);
		if($view && mysql_num_rows($view)>0){
			list($articleid,$userid,$title,$gro) = mysql_fetch_row($view);
			}else{
		die("http://".HTTP_HOST."/error/error_NofindContent");
			}
			$title = '关于"'.$title.'"的评论';
	echo head($title);
	echo topNav($title,'<a href="content.php?id='.$_GET['id'].'">返回</a>',' ');
	echo UBB(listReplyAll($_GET['id'],'liuyan',start($limit),$limit));
	echo '<div class="mylink">';
	$url = 'http://'.HTTP_HOST.'/liuyan/reply_list.php?id='.$_GET['id'].'&';
	echo page(listReplyNums($_GET['id'],'liuyan'),$limit,$url,'p','view');
	echo '</div>';
	echo '<div class="content"><form  method="post" action="reply.php">
 <textarea type="input" name="content"></textarea>
  <input type="hidden" name="gro" value="'.$_GET['id'].'"><br>
  <input type="submit" value="发表评论">
</form></div>';
	echo footer(1);
?>