由于网站效果需要增加了一个文章分类页面,名称叫caipu.php模版文件名称为caipu.dwt

分页的链接却还是链接到原article_cat.php

接下来我们开始按照步骤修改分页链接

 

第一步:需要修改includes\lib_commen.php

 

搜索 case 'article_cat':代码

在这段代码上方添加

case 'caipu_list':
            if (empty($acid))
            {
                return false;
            }
            else
            {
                if ($rewrite)
                {
                    $uri = 'caipu-' . $acid;
                    if (!empty($page))
                    {
                        $uri .= '-' . $page;
                    }
                    if (!empty($sort))
                    {
                        $uri .= '-' . $sort;
                    }
                    if (!empty($order))
                    {
                        $uri .= '-' . $order;
                    }
                    if (!empty($keywords))
                    {
                        $uri .= '-' . $keywords;
                    }
                }
                else
                {
                    $uri = 'caipu.php?id=' . $acid;
                    if (!empty($page))
                    {
                        $uri .= '&page=' . $page;
                    }
                    if (!empty($sort))
                    {
                        $uri .= '&sort=' . $sort;
                    }
                    if (!empty($order))
                    {
                        $uri .= '&order=' . $order;
                    }
                    if (!empty($keywords))
                    {
                        $uri .= '&keywords=' . $keywords;
                    }
                }
            }

            break;

 红色标记部分是增加的caipu.php的名称做的相应修改

第二步:

在includes/lib_main.php中搜索

case 'article_cat':
            $uri_args = array('acid' => $cat, 'sort' => $sort, 'order' => $order);
            break;

在这段代码下面增加

case 'caipu':
            $uri_args = array('acid' => $cat, 'sort' => $sort, 'order' => $order);
            break;

第三步:

打开增加的caipu.php

搜索assign_pager

将这整句修改成assign_pager('caipu_list', $cat_id, $count, $size, '', '', $page, $goon_keywords);

 

完成。