Imperial CMS Mobile Station modified list paging (Sys_showlistmorepage)

Source: Internet
Author: User

If your website is using an Imperial cms. PC stations and mobile stations use a single template group, but use a single database together. So your PC station and mobile station, the list page style is the same?

Today hi share-front-end technology will take you to feel different pagination style!

PC Station can be paged by 1, 2, 3, 4 ... This and arranged out, but the cell phone station is absolutely not to do so, or mobile phone screen small, paging look at all is good long, a little is not beautiful.

The Empire CMS PC Station can use [!--show.listpage--] the list paging function () in the form of a call list sys_ShowListMorePage .

Once the PC station is used [!--show.listpage--] , the phone station will also use [!--show.listpage--] the list paging function () in the form of the call list sys_ShowListMorePage . -because they are using the same database.

and the usual cell phone station should call the dropdown form of the list paging function ( sys_ShowListPage )

Such a goal is already obvious. Mobile Station same as PC station the list paging function () in list form is used to change the main contents of the sys_ShowListMorePage function body of the cell phone station to the sys_ShowListMorePage principal content of the list paging function () in the drop- down form sys_ShowListPage . Only the function name has not changed.

Modify the following in the e/class/t_function.php file in your phone station:

First, find and copy sys_ShowListPagefunction body content.

Copy function sys_ShowListPage( to the end of the } content.

Second, paste to sys_ShowListMorePagefunction, and then make modifications, let the applicable Imperial CMS Mobile Station, here give me the final modified version:
1 //List -page pagination for list templates2 functionSys_showlistmorepage ($num,$pagenum,$dolink,$dotype,$page,$lencord,$ok,$search="",$add){3     Global $fun _r;4     //file name5     if(Empty($add[' Dofile ']))6     {7         $add[' Dofile ']= ' index ';8     }9     //static pagesTen     $repagenum=$add[' Repagenum ']; One     //Home Page A     if($pagenum<>1) -     { -         $pagetop= "<a href= '".$dolink.$add[' Dofile '].$dotype."‘ > ".$fun _r[' StartPage ']. " </a>&nbsp;&nbsp; "; the     } -     Else -     { -         $pagetop=$fun _r[' StartPage ']. " &nbsp;&nbsp; "; +     } -     //Previous Page +     if($pagenum<>1) A     { at         $pagepr=$pagenum-1; -         if($pagepr==1) -         { -             $prido=$add[' Dofile '].$dotype; -         } -         Else in         { -             $prido=$add[' Dofile ']. ' _‘.$pagepr.$dotype; to         } +         $pagepri= "<a href= '".$prido."‘ > ".$fun _r[' Pripage ']. " </a>&nbsp;&nbsp; "; -     } the     Else *     { $         $pagepri=$fun _r[' Pripage ']. " &nbsp;&nbsp; ";Panax Notoginseng     } -     Echo $dolink; the     //Next Page +     if($pagenum<>$page) A     { the         $pagenex=$pagenum+1; +         $nextpagelink=$repagenum&&$repagenum<$pagenex? ERETURNREWRITEPAGELINK2 ($add,$pagenex):$add[' Dofile ']. ' _‘.$pagenex.$dotype; -         $pagenext= "<a href= '".$nextpagelink."‘ > ".$fun _r[' NextPage ']. " </a>&nbsp;&nbsp; "; $     } $     Else -     { -         $pagenext=$fun _r[' NextPage ']. " &nbsp;&nbsp; "; the     } -     //last pageWuyi     if($pagenum==$page) the     { -         $pageeof=$fun _r[' LastPage ']; Wu     } -     Else About     { $         $lastpagelink=$repagenum&&$repagenum<$page? ERETURNREWRITEPAGELINK2 ($add,$page):$dolink.$add[' Dofile ']. ' _‘.$page.$dotype; -         $pageeof= "<a href= '".$lastpagelink."‘ > ".$fun _r[' LastPage ']. " </a> "; -     } -     $options=""; A     //get the drop-down page +     if(Empty($search)) the     { -          for($go= 1;$go<=$page;$go++) $         { the             if($go==1) the{$file=$add[' Dofile '].$dotype;} the             Else the{$file=$add[' Dofile ']. ' _‘.$go.$dotype;} -             $thispagelink=$repagenum&&$repagenum<$go? ERETURNREWRITEPAGELINK2 ($add,$go):$file; in             if($ok==$go) the{$select= "Selected";} the             Else About{$select="";} the             $myoptions. = "<option value= '".$thispagelink."‘ > ".$fun _r[' GOTOs '].$go.$fun _r[' Gotol ']. " </option> "; the             $options. = "<option value= '".$thispagelink."‘".$select." > ".$fun _r[' GOTOs '].$go.$fun _r[' Gotol ']. " </option> "; the         } +     } -     Else the     {Bayi         $myoptions=$search; the         $options=Str_replace("Value= '".$add[' Dofile ']. ' _‘.$ok.$dotype."‘ > "," value= ' ".$add[' Dofile ']. " _".$ok.$dotype. "' Selected>",$search); the     } -     $options= "<select name=select onchange=\" self.location.href=this.options[this.selectedindex].value\ ">".$options." </select> "; -     //page Out the //thy-$pagelink = $pagetop. $pagepri $pagenext. $pageeof;--Split the previous page and the next page apart: the     $pagepri=$pagepri; the     $pagenext=$pagenext; the     //Replace template variables - //thy-$pager [' ShowPage ']=returnlistpagestr ($pagenum, $page, $lencord, $num, $pagelink, $options); the //--returns to the RETURNLISTPAGESTR () function in function.php, adding ' page ', ' Total number of pages ', ' total bars ', and so on in the Returnlistpagestr () function.  the //--do not need these in the mobile station, so do not return the     $pager[' ShowPage ']= ' <div class= ' pagelist ' > '.$pagepri.$options.$pagenext.‘ </div> ';94     $pager[' option ']=$myoptions; the     return $pager; the}
View Code

Some notes:

    1. The page on the mobile station only needs "previous", "Next", "drop-down page". At the same time, separate the previous page and next page, in the order of previous page, dropdown page, next page.
    2. $dolinkGets the address of the current column. such as: http://www.thy6415.com/moban/ . But the cell phone station should be http://www.thy6415.com/wap/moban/ or m.thy6415.com/moban/ . So get rid of it $dolink . Address Direct useindex_*.html

Finally, I'll see what I've done. A list of mobile stations the overall effect of how to:

Related Article

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.