@@ -114,13 +113,17 @@ function replyComment($plid, $content) {
...
@@ -114,13 +113,17 @@ function replyComment($plid, $content) {
}
}
//评论列表
//评论列表
functioncomments($newsid,$num,$p=1){
functioncomments($newsid,$plid=0,$num=10){
global$empire,$dbtbpre;
global$empire,$dbtbpre;
$tablecomment=$dbtbpre.'ecms_comments';
$tablecomment=$dbtbpre.'ecms_comments';
$tablemember=$dbtbpre.'enewsmember';
$tablemember=$dbtbpre.'enewsmember';
$offset=($p-1)*$num;
$sql="select c.*,u.avatar,u.nickname,u.username from $tablecomment c left join {$tablemember} u on c.user_id=u.userid where newsid={$newsid} and c.reply_id=0 order by c.id desc limit {$offset},{$num}";
$where='';
if($plid){
$where="c.id<{$plid} and ";
}
$sql="select c.*,u.avatar,u.nickname,u.username from $tablecomment c left join {$tablemember} u on c.user_id=u.userid where {$where} c.newsid={$newsid} and c.reply_id=0 order by c.id desc limit {$num}";