phpcms怎样让父栏目支持分页
发布:smiling 来源: PHP粉丝网 添加日期:2014-10-21 16:45:44 浏览: 评论:0
打开include\html.class.php文件,找到第53行:
$arrchildid = subcat('phpcms',$catid);
前面添加如下代码:
if($page == 0) $page = 1;
打开admin\html.inc.php文件,找到61行至80行:
- if($CATEGORY[$catid]['child'])
- {
- $pages = 1;
- $html->category($catid);
- }
- else
- {
- $offset = $pagesize*($page-1);
- if($page == 1)
- {
- $contents = cache_count("SELECT COUNT(*) AS `count` FROM `".DB_PRE."content` WHERE catid=$catid AND status=99");
- $total = ceil($contents/$PHPCMS['pagesize'])+1;
- $pages = ceil($total/$pagesize);
- }
- $max = min($offset+$pagesize, $total);
- for($i=$offset; $i<$max; $i++)
- {
- $html->category($catid, $i);
- }
- }
- //改为:
- $offset = $pagesize*($page-1);
- if($page == 1)
- {
- $condition=get_sql_catid($catid);
- $contents = cache_count("SELECT COUNT(*) AS `count` FROM `".DB_PRE."content` WHERE status=99 $condition");
- $total = ceil($contents/$PHPCMS['pagesize'])+1;
- $pages = ceil($total/$pagesize);
- }
- $max = min($offset+$pagesize, $total);
- for($i=$offset; $i<$max; $i++)
- { //phpfensi.com
- $html->category($catid, $i);
- }
Tags: phpcms父栏目分页 phpcms支持分页
推荐文章
热门文章
最新评论文章
- 写给考虑创业的年轻程序员(10)
- PHP新手上路(一)(7)
- 惹恼程序员的十件事(5)
- PHP邮件发送例子,已测试成功(5)
- 致初学者:PHP比ASP优秀的七个理由(4)
- PHP会被淘汰吗?(4)
- PHP新手上路(四)(4)
- 如何去学习PHP?(2)
- 简单入门级php分页代码(2)
- php中邮箱email 电话等格式的验证(2)