打開/include/global.func.php查找函數function pages($total, $page = 1, $perpage = 20, $urlrule = '', $array = array(), $catid = 0) 可以看到pages函數結構如下 代碼: function pages(){ ..... if(){ ..... } else{ ..... } ..... } 把else内的内容即:
代碼: 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); } 替換為
代碼: else {
if (( strpos(urldecode($urlrule),'mod=phpcms&file=content') > 0 and strpos(urldecode($urlrule),'mod=phpcms&file=content&action=manage') <= 0 and strpos(urldecode($urlrule),'mod=phpcms&file=content_all') <= 0 and strpos(urldecode($urlrule),'mod=phpcms&file=block') <= 0) or strpos(urldecode($urlrule),'mod=phpcms&file=html') > 0){ global $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 { $firstpage = pageurl($urlrule, 1, $array); $prepage = pageurl($urlrule, $prepage, $array); $nextpage = pageurl($urlrule, $nextpage, $array); $lastpage = pageurl($urlrule, $pages, $array); $urlpre = pageurl($urlrule, '', $array); } } 最後的pages如下 代碼: 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 { if (( strpos(urldecode($urlrule),'mod=phpcms&file=content') > 0 and strpos(urldecode($urlrule),'mod=phpcms&file=content&action=manage') <= 0 and strpos(urldecode($urlrule),'mod=phpcms&file=content_all') <= 0 and strpos(urldecode($urlrule),'mod=phpcms&file=block') <= 0) or strpos(urldecode($urlrule),'mod=phpcms&file=html') > 0){ global $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 { $firstpage = pageurl($urlrule, 1, $array); $prepage = pageurl($urlrule, $prepage, $array); $nextpage = pageurl($urlrule, $nextpage, $array); $lastpage = pageurl($urlrule, $pages, $array); $urlpre = pageurl($urlrule, '', $array); } } $data = str_replace('"', '/"', $PHPCMS['pageshtml']); eval("/$url = /"$data/";"); return $url; }
http://www.3ppt.com/Code/PHPCMS/1051.html