Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Ways to solve phpcms paging errors

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

This article is about how to solve phpcms paging errors. The editor thought it was very practical, so I shared it with you as a reference. Let's follow the editor and have a look.

How to solve the phpcms paging error?

The solution of PHPCMS pagination error

Open the / include/global.func.php lookup function function pages ($total, $page = 1, $perpage = 20, $urlrule ='', $array = array (), $catid = 0) and you can see that the pages function structure is as follows: function pages () {. If () {. } else {. }. } put the contents in the else, namely:

Code:

Else {$firstpage = pageurl ($urlrule, 1, $array); $prepage = pageurl ($urlrule, $prepage, $array); $nextpage = pageurl ($urlrule, $nextpage, $array); $lastpage = pageurl ($urlrule, $pages, $array); $urlpre = pageurl ($urlrule,', $array);}

Replace with

Code:

Else {/ * modify pagination-start * / * $firstpage = pageurl ($urlrule, 1, $array); $prepage = pageurl ($urlrule, $prepage, $array); $nextpage = pageurl ($urlrule, $nextpage, $array); $lastpage = pageurl ($urlrule, $pages, $array); $urlpre = pageurl ($urlrule,'', $array) * / if ((strpos (urldecode ($urlrule), 'mod=phpcms&file=content') > 0 and strpos (urldecode ($urlrule),' mod=phpcms&file=content&action=manage') category ($catid, $prepage, 1); $nextpage = $url- > category ($catid, $nextpage, 1); $lastpage = $url- > category ($catid, $pages, 1); $urlpre = $url- > category ($catid,', 1);} else {$firstpage = pageurl ($urlrule, 1, $array); $prepage = pageurl ($urlrule, $prepage, $array); $array = nextpage ($nextpage, $array, $nextpage) $lastpage = pageurl ($urlrule, $pages, $array); $urlpre = pageurl ($urlrule,'', $array);} / * modify pagination-end * /} the final pages is as follows: function pages ($total, $page = 1, $perpage = 20, $urlrule ='', $array = array (), $catid = 0) {global $PHPCMS; if ($total)

< 1) return ''; if($urlrule == '') $urlrule = url_par('page={$page}'); $pages = ceil($total/$perpage); $page = min($pages, $page); $prepage = $page - 1; $prepage = max($prepage, 1); $nextpage = $page+1; $nextpage = min($nextpage, $pages); if($catid) { $url = load('url.class.php'); $firstpage = $url->

Category ($catid, 1,1); $prepage = $url- > category ($catid, $prepage, 1); $nextpage = $url- > category ($catid, $nextpage, 1); $lastpage = $url- > category ($catid, $pages, 1); $urlpre = $url- > category ($catid,', 1);} else {/ * modify pagination-start * / * $firstpage = pageurl ($urlrule, 1, $array) $prepage = pageurl ($urlrule, $prepage, $array); $nextpage = pageurl ($urlrule, $nextpage, $array); $lastpage = pageurl ($urlrule, $pages, $array); $urlpre = pageurl ($urlrule,'', $array); * / if (strpos (urldecode ($urlrule), 'mod=phpcms&file=content') > 0 and strpos (urldecode ($urlrule),' mod=phpcms&file=content&action=manage') category ($catid, $prepage, 1); $nextpage = $url- > category ($catid, $nextpage, 1); $nextpage = $lastpage > lastpage ($lastpage, $lastpage, 1) $urlpre = $url- > category ($catid,', 1);} else {$firstpage = pageurl ($urlrule, 1, $array); $prepage = pageurl ($urlrule, $prepage, $array); $nextpage = pageurl ($urlrule, $nextpage, $array); $lastpage = pageurl ($urlrule, $pages, $array); $urlpre = pageurl ($urlrule,'', $array) } / * modify pagination-end * /} $data = str_replace ('",'/', $PHPCMS ['pageshtml']); eval (" / $url = / "$data/"; "); return $url;} Thank you for reading! This is the end of the way to solve phpcms paging errors. I hope the above content can help you to some extent, so that you can learn more knowledge. If you think the article is good, you can share it and let more people see it.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report