帝国cms分页导航美化t_function.php sys_ShowListMorePage全解释,列表页模板[!--show.listpage--]分页导航(列表式)

匿名 (未验证) 提交于 2019-12-02 22:11:45

帝国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&lt;=$line)
{
return '';
}
$search=RepPostStr($search,1);
$url=eReturnSelfPage(0).'?page';
$snum=2;//最小页数
$totalpage=ceil($num/$line);//取得总页数
$firststr='&lt;a title="'.$fun_r['trecord'].'" class="disabled"&gt;'.$num.'&lt;/a&gt;';
//上一页
if($page&lt;&gt;0)
{
$toppage='&lt;a href="'.$url.'=0'.$search.'" class="disabled"&gt;'.$fun_r['startpage'].'&lt;/a&gt;';
$pagepr=$page-1;
$prepage='&lt;a href="'.$url.'='.$pagepr.$search.'" class="disabled"&gt;'.$fun_r['pripage'].'&lt;/a&gt;';
}
//下一页
if($page!=$totalpage-1)
{
$pagenex=$page+1;
$nextpage='&lt;a href="'.$url.'='.$pagenex.$search.'" class="disabled"&gt;'.$fun_r['nextpage'].'&lt;/a&gt;';
$lastpage='&lt;a href="'.$url.'='.($totalpage-1).$search.'" class="disabled"&gt;'.$fun_r['lastpage'].'&lt;/a&gt;';
}
$starti=$page-$snum&lt;0?0:$page-$snum;
$no=0;
for($i=$starti;$i&lt;$totalpage&amp;&amp;$no&lt;$page_line;$i++)
{
$no++;
if($page==$i)
{
$is_1="&lt;a class='cur'&gt;";
$is_2="&lt;/a&gt;";
}
else
{
$is_1='&lt;a href="'.$url.'='.$i.$search.'"&gt;';
$is_2="&lt;/a&gt;";
}
$pagenum=$i+1;
$returnstr.=$is_1.$pagenum.$is_2;
}
$returnstr=$firststr.$toppage.$prepage.$returnstr.$nextpage.$lastpage;
return $returnstr;
}
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!