Destoon Mobile terminal Mobileurl function to increase city classification parameters

Source: Internet
Author: User

Mobileurl function in include/global.func.php 858 line

A total of four parameters, moduleid-model id,catid-Classification Id,itemid-Article id,page-page

functionMobileurl ($moduleid,$catid= 0,$itemid= 0,$page= 1) {if(Re_write)return $moduleid.‘ -‘.$catid.‘ -‘.$itemid.‘ -‘.$page.‘. html;if($itemid) {return' Index.php?moduleid= '.$moduleid.‘ &itemid= '.$itemid. ($page> 1? ' &page= '.$page: ‘‘); } Else if($catid) {return' Index.php?moduleid= '.$moduleid.‘ &catid= '.$catid. ($page> 1? ' &page= '.$page: ‘‘); } Else {return' Index.php?moduleid= '.$moduleid. ($page> 1? ' &page= '.$page: ‘‘); }}

1, mobileurl function increase areaid parameter

functionMobileurl ($moduleid,$catid= 0,$itemid= 0,$page= 1, $areaid=0) {//if (re_write) return $moduleid. ' -'. $catid. ' -'. $itemid. ' -'. $page. ' HTML ';if(Re_write)return $moduleid.‘ -‘.$catid.‘ -‘.$itemid.‘ -‘.$page.‘ -‘.$areaid.‘. HTML ';//edit by DP 12-03 for $areaidif($itemid) {return' Index.php?areaid= '.$areaid.‘ &moduleid= '.$moduleid.‘ &itemid= '.$itemid. ($page> 1? ' &page= '.$page: ‘‘);} Else if($catid) {return' Index.php?areaid= '.$areaid.‘ &moduleid= '.$moduleid.‘ &catid= '.$catid. ($page> 1? ' &page= '.$page: ‘‘);} Else {return' Index.php?areaid= '.$areaid.‘ &moduleid= '.$moduleid. ($page> 1? ' &page= '.$page: ‘‘);}}

2. Modify pseudo-static rule root directory Web. config file increase

<rule name= "Destoon_rewrite_8" >     <match url= "^ (. *)/([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+)]. html\?* (. *) $ "/>     <action type=" Rewrite "url=" {R:1}/index.php?moduleid={r:2}&amp;catid={r:3}&amp ; Itemid={r:4}&amp;page={r:5}&amp;areaid={r:6} "  /></rule>

3, modify the Mobile page template template/default/mobile/sell.htm

<divclass= "p-20 f-l ss-js" > <spanclass= "Sort-tt border-r-1 s-cate" > by Region </span> <divclass= "Pro-cat pro-cat-hide" > <divclass= "Cat-l" > <divclass= "Cat-l-box" id= "Scroller3" > {PHP$tags=tag ("Table=area&condition=parentid=0&pagesize=100&order=listorder asc&template=null");} <ul>{loop$tags $i $c} <li&#123;if $i <1& #125, class= "li-active" & #123;/if& #125;>& #123, if $c [child]& #125; 123;& #36;c[areaname]& #125;& #123;else& #125 <a href= "{mobileurl ($catid, 0,1, $c [Areaid])}" Data-ajax= ' false ' >& #123;& #36;c[areaname]& #125;</a>& #123;/if& #125;</li>            {/Loop}</ul> </div> </div> <divclass= "Cat-m" > <divclass= "Cat-close" ><a href= "javascrip:void (0)" ></a></div> <divclass= "Cat-r cat-r-box" id= "Scroller4" > {PHP$tags=tag ("Table=area&condition=parentid=0&pagesize=100&order=listorder asc&template=null");} <div> {loop$tags $i $b} {PHP$sub= Get_mainarea ($b[Arrchildid]);} <divclass= "con-block& #123;$i>=1& #125; Zl-hide & #123;/if& #125; " > <ul style= "padding-top:1em" > <li> <p> {loop$sub $j $v} <span><a href= "{Mobileurl (16,$catid, 0, 1,$v[Areaid])} " Data-ajax= ' false ' >&#123;& #36;v[areaname]& #125;</a></span> {/loop} </p></li> </ul> </div>            {/loop} </div> </div> </div> </div> </div>

4. Add regional parameters by category

<divclass= "p-20 f-l ss-js" > <spanclass= "Sort-tt border-r-1 s-cate" > by category </span> <divclass= "Pro-cat pro-cat-hide" > <divclass= "Cat-l" > <divclass= "Cat-l-box" id= "scroller" > {PHP$maincat= Get_maincat (0, 16, 1);} <ul>{loop$maincat $i $c} <li&#123;if $i <1& #125, class= "li-active" & #123;/if& #125;>& #123, if $c [child]& #125; 123;& #36;c[catname]& #125;& #123;else& #125 <a href= "{mobileurl ($c [catid],0,1, $areaid)}" Data-ajax= ' false ' >& #123;& #36;c[catname]& #125;</a>& #123;/if& #125;</li>            {/Loop}</ul> </div> </div> <divclass= "Cat-m" > <divclass= "Cat-close" ><a href= "javascrip:void (0)" ></a></div> <divclass= "Cat-r cat-r-box" id= "Scroller2" > {PHP$child= Get_maincat (0, 16, 1);} <div> {loop$child $i $c}            <divclass= "con-block& #123;$i>=1& #125; Zl-hide & #123;/if& #125; " > <ul>{PHP$sub= Get_maincat ($c[CATID], 16, 1);} {Loop$sub $j $s}                <li> #123;& #36;s[catname]& #125;{PHP$child= Get_maincat ($s[CATID], 16, 1);} <p> {loop$child $r $e} <span><a href= "{Mobileurl (16,$e[catid],0,1,$areaid} "data-ajax= ' false ' >&#123;& #36;e[catname]& #125;</a></span> {/loop} </p></li>                {/Loop}</ul> </div>            {/loop} </div> </div> </div> </div> </div>

7. Corresponding Modify template/default/mobile/group.htm

8. Add Mobileurl function after sorting, pseudo-static rule

functionMobileurl ($moduleid,$catid= 0,$itemid= 0,$page= 1,$areaid=0,$order=0) {//if (re_write) return $moduleid. ' -'. $catid. ' -'. $itemid. ' -'. $page. ' HTML ';if(Re_write)return $moduleid.‘ -‘.$catid.‘ -‘.$itemid.‘ -‘.$areaid.‘ -‘.$order.‘ -‘.$page.‘. HTML ';//edit by DP 12-03 for $areaidif($itemid) {return' Index.php?order= '.$order.‘ &areaid= '.$areaid.‘ &moduleid= '.$moduleid.‘ &itemid= '.$itemid. ($page> 1? ' &page= '.$page: ‘‘);} Else if($catid) {return' Index.php?order= '.$order.‘ &areaid= '.$areaid.‘ &moduleid= '.$moduleid.‘ &catid= '.$catid. ($page> 1? ' &page= '.$page: ‘‘);} Else {return' Index.php?order= '.$order.‘ &areaid= '.$areaid.‘ &moduleid= '.$moduleid. ($page> 1? ' &page= '.$page: ‘‘);}}
View Code

Pseudo-static rules

<rule name= "Destoon_rewrite_8" >                    <match url= "^ (. *)/([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+]-([[])-([ 0-9]+) \.html\?* (. *) $ "/>                    <action type=" Rewrite "url=" {R:1}/index.php?moduleid={r:2}&amp;catid={r:3} &amp;itemid={r:4}&amp;page={r:7}&amp;areaid={r:5}&amp;order={r:6} "  /> </rule>
View Code

9. Template link

Keep current category ID City ID 0-General sort, 1-reverse chronological, 2-price low to high, 3-high to low, 4-reverse sales

<divclass= "P-35 f-l sort-sel ss-js" > <spanclass= "Sort-tt border-r-1 redstyle s-one" ><emclass= "Sort-t" > General sort </em><i></i></span> <ulclass= "Sort-ul" > <li><a href= "{Mobileurl (16,$catid, 0, 1,$areaid, 0)} "data-ajax= ' false ' > comprehensive sort </a></li> <li><a href=" {Mobileurl (16,$catid, 0, 1,$areaid, 1)} "data-ajax= ' false ' > latest release </a></li> <li><a href=" {Mobileurl (16,$catid, 0, 1,$areaid, 2)} "data-ajax= ' false ' > price from low to high </a></li> <li><a href=" {Mobileurl (16,$catid, 0, 1,$areaid, 3)} "data-ajax= ' false ' > price from high to low </a></li> </ul> </div> <divclass= "p-25 f-l ss-js" > <spanclass= "Sort-tt border-r-1 s-xl" ><a href= "{Mobileurl (16,$catid, 0, 1,$areaid, 4)} "data-ajax= ' false ' > sales priority </a></span> </div>
View Code

Destoon Mobile terminal Mobileurl function to increase city classification parameters

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.