您好,欢迎访问一九零五行业门户网

Thinkphp简单的无限评论回复

这不知道谁发的无限评论回复,已在基础上修改了样式,并替换了最新的框架thinkphp3.2.3.
无限递归评论:function commentlist($pid = 0, &$commentlist = array(), $spac = 0) { 
    static $i = 0; 
    $spac = $spac + 1; //初始为1级评论 
    $list = m('comment')-> 
                    field('id,add_time,author,content,pid')-> 
                    where(array('pid' => $pid))->order(id desc)->select(); 
    foreach ($list as $k => $v) { 
        $commentlist[$i]['level'] = $spac; //评论层级 
        $commentlist[$i]['author'] = $v['author']; 
        $commentlist[$i]['id'] = $v['id']; 
        $commentlist[$i]['pid'] = $v['pid']; //此条评论的父id 
        $commentlist[$i]['content'] = $v['content']; 
        $commentlist[$i]['time'] = $v['add_time']; 
        // $commentlist[$i]['pauthor']=$pautor; 
        $i++; 
        $this->commentlist($v['id'], $commentlist, $spac); 
    } 
    return $commentlist; 
}评论和回复在线演示地址:http://www.sucaihuo.com/js/557.html
thinkphp带表情的无限评论回复.zip ( 2.91 mb 下载:278 次 )
ad:真正免费,域名+虚机+企业邮箱=0元
其它类似信息

推荐信息