PHPCMS 栏目页及列表页分页修改 网站栏目页及列表页要实现的效果如下: 1、栏目页最多只列出100页; 2、列表页不限制最大页数,有多少页就列出多少页。 要实现这个效果,需要改动的文件有3个,文件及改动内容如下: 复制代码代码如下: /* 文件:/include/global.func.php 函数:get */ /* 为 get 函数添加一个参数 ismaxpage 就是所添加的参数,用于判断是否启用“列表页最大页数”这个参数 而插入代码的部分是为了改变total的值,即记录集总数 */ function get($sql, $rows = 0] $page = 0] $dbname = '', $dbsource = '', $urlrule = '', $distinct_field = '', $catid = 0] $ismaxpage = 0) { ... if($dbname || $dbsource) { $r = $db->get_one("SELECT COUNT(*) AS `count` ".stristr($sql, 'from')); $total = $r['count',; } elseif($distinct_field) { $total = cache_count("SELECT COUNT(distinct $distinct_field) AS `count` ".stristr($sql, 'from')); } else { $total = cache_count("SELECT COUNT(*) AS `count` ".stristr($sql, 'from')); } /* 插入以下代码 开始 */ global $PHPCMS; if ($ismaxpage) { $total = min($total, $PHPCMS['maxpage',*$row...
内容已隐藏,请关注公众号输入验证码查看
本帖支持关注公众号查看
【无套路 无套路 无套路 扫描二维码关注公众号发送【验证码】收到验证码 在上面输入点击提交查看即可显示隐藏内容】
|