Ways to solve phpcms paging errors
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.