ECShop二次开发教程--修改的伪静态分类URL

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

电话:029-87888753/13891864749邮件:xaphp@126.com网址:、lib_common.phpbuild_uri我做了修改我把整个函数贴出来1.functionbuild_uri($app,$params,$append='',$page=0,$size=0)2.{3.static$rewrite=NULL;4.5.if($rewrite===NULL)6.{7.$rewrite=intval($GLOBALS['_CFG']['rewrite']);8.}9.10.$args=array('cid'=0,11.'gid'=0,12.'bid'=0,13.'acid'=0,14.'aid'=0,15.'sid'=0,16.'gbid'=0,17.'auid'=0,18.'sort'='',19.'order'='',20.);21.22.extract(array_merge($args,$params));23.$uri='';24.switch($app)电话:029-87888753/13891864749邮件:xaphp@126.com网址:{26.case'category':27.if(empty($cid))28.{29.returnfalse;30.}31.else32.{33.if($rewrite)34.{35.$name=urlencode(preg_replace('/[\.|\/|\?|&|\+|\\\|\'||,]+/','',$append));36.$uri='wholesale-'.$name.'-'.$cid;37.if(isset($bid))38.{39.$uri.='-b'.$bid;40.}41.if(isset($price_min))42.{43.$uri.='-min'.$price_min;44.}45.if(isset($price_max))46.{47.$uri.='-max'.$price_max;48.}49.if(isset($filter_attr))50.{51.$uri.='-attr'.$filter_attr;电话:029-87888753/13891864749邮件:xaphp@126.com网址:}53.if(!empty($page))54.{55.$uri.='-'.$page;56.}57.if(!empty($sort))58.{59.$uri.='-'.$sort;60.}61.if(!empty($order))62.{63.$uri.='-'.$order;64.}65.}66.else67.{68.$uri='category.php?id='.$cid;69.if(!empty($bid))70.{71.$uri.='&brand='.$bid;72.}73.if(isset($price_min))74.{75.$uri.='&price_min='.$price_min;76.}77.if(isset($price_max))78.{79.$uri.='&price_max='.$price_max;80.}电话:029-87888753/13891864749邮件:xaphp@126.com网址:(!empty($filter_attr))82.{83.$uri.='&filter_attr='.$filter_attr;84.}85.86.if(!empty($page))87.{88.$uri.='&page='.$page;89.}90.if(!empty($sort))91.{92.$uri.='&sort='.$sort;93.}94.if(!empty($order))95.{96.$uri.='&order='.$order;97.}98.}99.}100.101.break;102.case'goods':103.if(empty($gid))104.{105.returnfalse;106.}107.else108.{109.$uri=$rewrite?'goods-'.$gid:'goods.php?id='.$gid;电话:029-87888753/13891864749邮件:xaphp@126.com网址:}111.112.break;113.case'brand':114.if(empty($bid))115.{116.returnfalse;117.}118.else119.{120.if($rewrite)121.{122.$uri='brand-'.$bid;123.if(isset($cid))124.{125.$uri.='-c'.$cid;126.}127.if(!empty($page))128.{129.$uri.='-'.$page;130.}131.if(!empty($sort))132.{133.$uri.='-'.$sort;134.}135.if(!empty($order))136.{137.$uri.='-'.$order;138.}电话:029-87888753/13891864749邮件:xaphp@126.com网址:}140.else141.{142.$uri='brand.php?id='.$bid;143.if(!empty($cid))144.{145.$uri.='&cat='.$cid;146.}147.if(!empty($page))148.{149.$uri.='&page='.$page;150.}151.if(!empty($sort))152.{153.$uri.='&sort='.$sort;154.}155.if(!empty($order))156.{157.$uri.='&order='.$order;158.}159.}160.}161.162.break;163.case'article_cat':164.if(empty($acid))165.{166.returnfalse;167.}电话:029-87888753/13891864749邮件:xaphp@126.com网址:{170.if($rewrite)171.{172.$uri='article_cat-'.$acid;173.if(!empty($page))174.{175.$uri.='-'.$page;176.}177.if(!empty($sort))178.{179.$uri.='-'.$sort;180.}181.if(!empty($order))182.{183.$uri.='-'.$order;184.}185.}186.else187.{188.$uri='article_cat.php?id='.$acid;189.if(!empty($page))190.{191.$uri.='&page='.$page;192.}193.if(!empty($sort))194.{195.$uri.='&sort='.$sort;196.}电话:029-87888753/13891864749邮件:xaphp@126.com网址:(!empty($order))198.{199.$uri.='&order='.$order;200.}201.}202.}203.204.break;205.case'article':206.if(empty($aid))207.{208.returnfalse;209.}210.else211.{212.$uri=$rewrite?'article-'.$aid:'article.php?id='.$aid;213.}214.215.break;216.case'group_buy':217.if(empty($gbid))218.{219.returnfalse;220.}221.else222.{223.$uri=$rewrite?'group_buy-'.$gbid:'group_buy.php?act=view&id='.$gbid;电话:029-87888753/13891864749邮件:xaphp@126.com网址:}225.226.break;227.case'auction':228.if(empty($auid))229.{230.returnfalse;231.}232.else233.{234.$uri=$rewrite?'auction-'.$auid:'auction.php?act=view&id='.$auid;235.}236.237.break;238.case'snatch':239.if(empty($sid))240.{241.returnfalse;242.}243.else244.{245.$uri=$rewrite?'snatch-'.$sid:'snatch.php?id='.$sid;246.}247.248.break;249.case'search':250.break;251.case'exchange':电话:029-87888753/13891864749邮件:xaphp@126.com网址:($rewrite)253.{254.$uri='exchange-'.$cid;255.if(isset($price_min))256.{257.$uri.='-min'.$price_min;258.}259.if(isset($price_max))260.{261.$uri.='-max'.$price_max;262.}263.if(!empty($page))264.{265.$uri.='-'.$page;266.}267.if(!empty($sort))268.{269.$uri.='-'.$sort;270.}271.if(!empty($order))272.{273.$uri.='-'.$order;274.}275.}276.else277.{278.$uri='exchange.php?cat_id='.$cid;279.if(isset($price_min))280.{电话:029-87888753/13891864749邮件:xaphp@126.com网址:='&integral_min='.$price_min;282.}283.if(isset($price_max))284.{285.$uri.='&integral_max='.$price_max;286.}287.288.if(!empty($page))289.{290.$uri.='&page='.$page;291.}292.if(!empty($sort))293.{294.$uri.='&sort='.$sort;295.}296.if(!empty($order))297.{298.$uri.='&order='.$order;299.}300.}301.302.break;303.case'exchange_goods':304.if(empty($gid))305.{306.returnfalse;307.}308.else309.{电话:029-87888753/13891864749邮件:xaphp@126.com网址:=$rewri

1 / 13
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功