dedecms5.7会员空间文章列表分页一直显示为0条记录

在用dedecms做二次开发的时候发现会员的文章列表页下面的文章分页一直显示的都是 共 0 页/0条记录 ,才发现是程序出了问题。跟踪代码才发现问题的所在是写的查询总数的正则是错误的,不知道是故意的还是忘记了在测试的时候忘记改过来...

要修改的程序文件为include/arc.memberlistview.class.php

138行源代码为:

if($this->totalResult==0)
        {
            //$this->isQuery = true;
            //$this->dsql->Execute('mbdl',$this->sourceSql);
            //$this->totalResult = $this->dsql->GetTotalRow('mbdl');
            $countQuery = preg_replace("/select[ \r\n\t](.*)[ \r\n\t]from/i","Select count(*) as dd From",$this->sourceSql);
            $row = $this->dsql->GetOne($countQuery);
            $row['dd'] = empty($row['dd']) ? 0 : $row['dd'];
            $this->totalResult = $row['dd'];
            $this->sourceSql .= " limit 0,".$this->pageSize;
        }


修改为:

if($this->totalResult==0)
        {
            $this->isQuery = true;
            $this->dsql->Execute('mbdl',$this->sourceSql);
            $this->totalResult = $this->dsql->GetTotalRow('mbdl');
            $this->sourceSql .= " limit 0,".$this->pageSize;
        }



展开阅读全文

没有更多推荐了,返回首页