Hi share-Front end technology-Imperial CMS Mobile Station Modify list paging (Sysshowlistmorepage)

Source: Internet
Author: User

Http://bbs.phome.net/showthread-31-318753-0.html

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 <a href= "http://www.thy6415.com" > Hi Share-front-end technology </a> will take you to feel different page 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--] to invoke list-form paging functions (Sys_showlistmorepage) as lists.

Once the PC station uses [!--show.listpage--], the cell phone station will also use the [!--show.listpage--] Call list-form function (Sys_showlistmorepage). -because they are using the same database.

The usual cell phone station should call the drop-down form of the list-paging function (Sys_showlistpage)


Such a goal is already obvious. Mobile Station same as PC station using list-like List paging functions (sys_showlistmorepage), simply change the Sys_showlistmorepage function body content of the cell phone station to a list-paging function in the dropdown form (sys_showlistpage ) of the main content. Only the function name has not changed.


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

First, locate and copy the Sys_showlistpage function body contents.

Copies the contents of function sys_showlistpage (to the end of the}.

Second, paste to the Sys_showlistmorepage function, and then modify, let the application of the Imperial CMS Mobile Station, here gives me the final modified version:

List-page pagination for list templates
function Sys_showlistmorepage ($num, $pagenum, $dolink, $dotype, $page, $lencord, $ok, $search = "", $add) {
Global $fun _r;
Filename
if (Empty ($add [' dofile ']))
{
$add [' dofile ']= ' index ';
}
Static pages
$repagenum = $add [' Repagenum '];
Home
if ($pagenum <>1)
{
$pagetop = "<a href=". $dolink. $add [' Dofile ']. $dotype. "' > ". $fun _r[' StartPage ')." </a>&nbsp;&nbsp; ";
}
Else
{
$pagetop = $fun _r[' startpage '). " &nbsp;&nbsp; ";
}
Previous page
if ($pagenum <>1)
{
$PAGEPR = $pagenum-1;
if ($pagepr ==1)
{
$prido = $add [' Dofile ']. $dotype;
}
Else
{
$prido = $add [' dofile ']. ' _ '. $pagepr. $dotype;
}
$pagepri = "<a href=". $prido. "' > ". $fun _r[' pripage ')." </a>&nbsp;&nbsp; ";
}
Else
{
$pagepri = $fun _r[' pripage '). " &nbsp;&nbsp; ";
}
Echo $dolink;
Next page
if ($pagenum <> $page)
{
$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; ";
}
Last
if ($pagenum = = $page)
{
$pageeof = $fun _r[' lastpage ');
}
Else
{
$lastpagelink = $repagenum && $repagenum < $page? eReturnRewritePageLink2 ($add, $page): $dolink. $add [' Dofile ‘].‘ _ '. $page. $dotype;
$pageeof = "<a href=". $lastpagelink. "' > ". $fun _r[' LastPage ')." </a> ";
}
$options = "";
Get the drop-down page
if (empty ($search))
{
for ($go =1; $go <= $page; $go + +)
{
if ($go ==1)
{$file = $add [' Dofile ']. $dotype;}
Else
{$file = $add [' dofile ']. ' _ '. $go. $dotype;}
$thispagelink = $repagenum && $repagenum < $go? eReturnRewritePageLink2 ($add, $go): $file;
if ($ok = = $go)
{$select = "selected";}
Else
{$select = "";}
$myoptions. = "<option value= '". $thispagelink. "' > ". $fun _r[' GOTOs '). $go. $fun _r[' Gotol ']." </option> ";
$options. = "<option value= '". $thispagelink. "". $select. " > ". $fun _r[' GOTOs '). $go. $fun _r[' Gotol ']." </option> ";
}
}
Else
{
$myoptions = $search;
$options =str_replace ("value=". $add [' Dofile ']. ' _ '. $ok. $dotype. ' > "," value= ' ". $add [' Dofile ']." _ ". $ok. $dotype." ' Selected> ", $search);
}
$options = "<select name=select onchange=\" self.location.href=this.options[this.selectedindex].value\ ">". $ Options. " </select> ";
Page out
Thy-$pagelink = $pagetop. $pagepri. $pagenext. $pageeof; --Split the previous page and the next page apart:
$pagepri = $pagepri;
$pagenext = $pagenext;
Replace template variables
Thy-$pager [' ShowPage ']=returnlistpagestr ($pagenum, $page, $lencord, $num, $pagelink, $options);
--Return to the RETURNLISTPAGESTR () function in function.php, add ' page ', ' Total pages ', ' Total number ', and so on in the Returnlistpagestr () function.
--No need for these in the cell phone station, so don't return
$pager [' showpage ']= ' <div class= ' pagelist ' > '. $pagepri. $options. $pagenext. ' </div> ';
$pager [' option ']= $myoptions;
return $pager;
}



Some notes:

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.
$dolink gets 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 we need to get rid of $dolink. Address directly using index_*.html

Hi share-Front end technology-Imperial CMS Mobile Station Modify list paging (Sysshowlistmorepage)

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.