首页 > 教程 > Ecshop教程 > Ecshop新增单页模块修改分页链接

Ecshop新增单页模块修改分页链接

2015-07-31 18:44:23侠客源码 复制链接

Ecshop自己添加的页面如何修改分页链接,由于商城模块需要,新增了一个商品分类页面bsend.php,单独模板显示bsend.dwt

后来发现分布链接已然是原来的category.php

接下来按步骤可修改分布链接:

1、打开includes\lib_commen.php

搜索 case 'category'代码

在其上方新增:

case 'bsend':
            if (empty($cid))
            {
                return false;
            }
            else
            {
                if ($rewrite)
                {
                    $uri = 'bsend-' . $cid;
                    if (isset($bid))
                    {
                        $uri .= '-b' . $bid;
                    }
                    if (isset($price_min))
                    {
                        $uri .= '-min'.$price_min;
                    }
                    if (isset($price_max))
                    {
                        $uri .= '-max'.$price_max;
                    }
                	if (isset($filter))
                    {
                        $uri .= '-fil' . $filter;
                    }
                    if (isset($filter_attr))
                    {
                        $uri .= '-attr' . $filter_attr;
                    }
                    if (!empty($page))
                    {
                        $uri .= '-' . $page;
                    }
                    if (!empty($sort))
                    {
                        $uri .= '-' . $sort;
                    }
                    if (!empty($order))
                    {
                        $uri .= '-' . $order;
                    }
                }
                else
                {
                    $uri = 'bsend.php?id=' . $cid;
                    if (!empty($bid))
                    {
                        $uri .= '&brand=' . $bid;
                    }
                    if (isset($price_min))
                    {
                        $uri .= '&price_min=' . $price_min;
                    }
                    if (isset($price_max))
                    {
                        $uri .= '&price_max=' . $price_max;
                    }
                	if (isset($filter))
                    {
                        $uri .= '&filter=' . $filter;
                    }
                    if (!empty($filter_attr))
                    {
                        $uri .='&filter_attr=' . $filter_attr;
                    }

                    if (!empty($page))
                    {
                        $uri .= '&page=' . $page;
                    }
                    if (!empty($sort))
                    {
                        $uri .= '&sort=' . $sort;
                    }
                    if (!empty($order))
                    {
                        $uri .= '&order=' . $order;
                    }
                }
            }

            break;


代码中 bsend 就是新增页面的名称 


2、在includes/lib_main.php中搜索

case 'category':
            $uri_args = array('cid' => $cat, 'bid' => $brand, 'price_min'=>$price_min, 'price_max'=>$price_max, 'filter_attr'=>$filter_attr, 'sort' => $sort, 'order' => $order, 'display' => $display_type);
            break;

下方新增:

 case 'bsend':
            $uri_args = array('cid' => $cat, 'bid' => $brand, 'price_min'=>$price_min, 'price_max'=>$price_max, 'filter_attr'=>$filter_attr, 'sort' => $sort, 'order' => $order, 'display' => $display_type);
            break;

3、打开新增的bsend.php

搜索:

 assign_pager('category',$cat_id, $count, $size, $sort, $order, $page, '', $brand, $price_min, $price_max, $display, $filter_attr_str);

修改为:

assign_pager('bsend',$cat_id, $count, $size, $sort, $order, $page, '', $brand, $price_min, $price_max, $display, $filter_attr_str);

OK  完成!

  • 上一篇:ecshop新建增加独立页面的方法
  • 下一篇:ecshop在线支付按钮$pay_online美化