今天发现会员中心里,查看用户全部文章时,列表分页始终显示“共 0 页/0条记录”,分页无法正常显示,于是从网上找了一下,终于解决,特将此方法分享给各位:


修正办法“


打开include/arc.memberlistview.class.php


查找


$countQuery = preg_replace("/select[ rnt](.*)[ rnt]from/i","Select count(*) as dd From",$this->sourceSql);


修改为


$countQuery = preg_replace("#SELECT[ rnt](.*)[ rnt]FROM#is", 'SELECT COUNT(*) AS dd FROM', $this->sourceSql);


$countQuery = preg_replace("#ORDER[ rnt]{1,}BY(.*)#is", '', $countQuery);

这样,分页就可以正常显示了,希望能对你有所帮助。

发表评论

后才能评论