帝国cms分页导航t_function.php sys_ShowListMorePage全解释,列表页模板[!--show.listpage--]分页导航(列表式)
原文地址:https://www.wentong.org/ecms/template/20180612876.html
最后一点要说明下,就是分页个数是在【系统设置】-【系统参数设置】-【搜索设置】-【页面设置】中根据自己的需要设置把
html结构
<div class="pageBox pTB20"><a class="cur">1</a><a href="#">2</a><a href="#">3</a><a href="#">4</a><a href="#">5</a><a href="/liaotian/index_6.html">6</a><a href="#">7</a><a href="#">8</a><a href="#" class="disabled">下一页</a><a href="#" class="disabled">尾页</a></div>
/*** page-------------------------------------------------------------- ****/ | |
.pageBox {text-align: center;} | |
.pageBox a {border:1px solid #ddd;display:inline-block;margin-right:6px;color: #707070;width:34px;height:34px;font:bold 14px/34px arial;} | |
.pageBox a:hover,.pageBox a:active{background:#3aa9f2;color: #FFFFFF;text-decoration: none;} | |
.pageBox .cur { background: #3aa9f2;border: 1px solid #3aa9f2;text-decoration: none;} | |
.pageBox a.cur {color: #fff;} | |
.pageBox .disabled {width: 79px;} |
修改默认搜索模版的分页是在e/class/connect.php下,搜索下function page1就是我们要修改的分页了,下面贴上我修改后的分页
继续阅读
//前台分页 | |
function page1($num,$line,$page_line,$start,$page,$search){ | |
global $fun_r; | |
if($num<=$line) | |
{ | |
return ''; | |
} | |
$search=RepPostStr($search,1); | |
$url=eReturnSelfPage(0).'?page'; | |
$snum=2;//最小页数 | |
$totalpage=ceil($num/$line);//取得总页数 | |
$firststr='<a title="'.$fun_r['trecord'].'" class="disabled">'.$num.'</a>'; | |
//上一页 | |
if($page<>0) | |
{ | |
$toppage='<a href="'.$url.'=0'.$search.'" class="disabled">'.$fun_r['startpage'].'</a>'; | |
$pagepr=$page-1; | |
$prepage='<a href="'.$url.'='.$pagepr.$search.'" class="disabled">'.$fun_r['pripage'].'</a>'; | |
} | |
//下一页 | |
if($page!=$totalpage-1) | |
{ | |
$pagenex=$page+1; | |
$nextpage='<a href="'.$url.'='.$pagenex.$search.'" class="disabled">'.$fun_r['nextpage'].'</a>'; | |
$lastpage='<a href="'.$url.'='.($totalpage-1).$search.'" class="disabled">'.$fun_r['lastpage'].'</a>'; | |
} | |
$starti=$page-$snum<0?0:$page-$snum; | |
$no=0; | |
for($i=$starti;$i<$totalpage&&$no<$page_line;$i++) | |
{ | |
$no++; | |
if($page==$i) | |
{ | |
$is_1="<a class='cur'>"; | |
$is_2="</a>"; | |
} | |
else | |
{ | |
$is_1='<a href="'.$url.'='.$i.$search.'">'; | |
$is_2="</a>"; | |
} | |
$pagenum=$i+1; | |
$returnstr.=$is_1.$pagenum.$is_2; | |
} | |
$returnstr=$firststr.$toppage.$prepage.$returnstr.$nextpage.$lastpage; | |
return $returnstr; | |
} |