织梦DedeCMS会员空间内的文章列表无法分页的解决方法
DedeCMS 5.7会员空间的文章列表分页显示不正常,总是显示0页0条记录错误。下面告诉大家如何解决这个问题:
找到并打开include/arc.memberlistview.class.php文件,在里面找到下面这句代码:
$countQuery = preg_replace(
"/select[ \r\n\t](.*)[ \r\n\t]from/i"
,
"Select count(*) as dd From"
,$this->sourceSql);
修改成
$countQuery = preg_replace("/select[ \r\n\t](.*)[ \r\n\t]from/is","Select count(*) as dd From",$this->sourceSql);
$countQuery = preg_replace("/ORDER[ \r\n\t]{1,}BY(.*)/is", '', $countQuery);
最终效果