帝国CMS列表分页[!---show.listpage--]页码修改方法
在帝国CMS中,我们使用[!--show.page--]和[!--show.listpage--]来生成列表页码,其中[!--show.page--]标签为不带页码带下拉分页的样式,如下图:
修改[!--show.page--]的方法,在后台找到模板——>公共模板——>列表分页模板,修改里面代码即可!
其中[!--show.listpage--]所生成的html列表分页代码如下:
<a title="Total record"> <b>9</b> </a> <a href="/dg/news/china/index.html">首页</a> <a href="/dg/news/china/index.html">上一页</a> <a href="/dg/news/china/index.html">1</a> <b>2</b> <a href="/dg/news/china/index_3.html">3</a> <a href="/dg/news/china/index_3.html">下一页</a> <a href="/dg/news/china/index_3.html">尾页</a>
然后根据帝国默认的生成标签样式,写了css的代码即可,现在我们就讲讲如何修改其样式:
首先帝国CMS的分页样式在:e/class下的t_functions.php这个文件里,找到sys_ShowListMorePage函数,其代码的相关说明,如下:
一,总页码数
大概在118行找到
$firststr='<a title="Total record"> <b>'.$num.'</b> </a> ';
比较一下
$firststr='<a title="Total record"> <b>'.$num.'</b> </a> '; <a title="Total record"> <b>9</b></a>
这里也就是说明,总页码“9” 所对应的变量为 '.$num.' $firststr 是总页码的变量名称
二,首页
我们再找到
$toppage='<a href="'.$dolink.'index'.$type.'">'.$fun_r['startpage'].'</a> ';
比较一下
$toppage='<a href="'.$dolink.'index'.$type.'">'.$fun_r['startpage'].'</a> '; <a href="/dg/news/china/index.html">首页</a>
这里我们能看出来 首页所对应的“首页”代码为“'.$fun_r['startpage'].'” 其链接所对应“'.$dolink.'index'.$type.'”
三.上一页
我们再找到
$prepage='<a href="'.$dolink.$prido.'">'.$fun_r['pripage'].'</a>';
比较一下
$prepage='<a href="'.$dolink.$prido.'">'.$fun_r['pripage'].'</a>'; <a href="/dg/news/china/index.html">上一页</a>
四,下一页和尾页
这里所对应的代码为每一页的页码标签
找到
$nextpage=' <a href="'.$dolink.'index_'.$pagenex.$type.'">'.$fun_r['nextpage'].'</a>'; $lastpage=' <a href="'.$dolink.'index_'.$totalpage.$type.'">'.$fun_r['lastpage'].'</a>';
这里所对应的代码为 下一页和尾页
<a href=" /dg/news/china/index_3.html">下一页</a> <a href=" /dg/news/china/index_3.html">尾页</a>
五,所在页面前面页码和所在页面的后页代码
$starti=$page-$snum<1?1:$page-$snum; $no=0; for($i=$starti;$i<=$totalpage&&$no<$page_line;$i++) { $no++; if($page==$i) { $is_1="<b>"; $is_2="</b>"; elseif($i==1) { $is_1='<a href="'.$dolink.$add[filename].$type.'">'; $is_2="</a>"; } else { $is_1='<a href="'.$dolink.$add[filename].'_'.$i.$type.'">'; $is_2=" </a>"; } $returnstr.=' '.$is_1.$i.$is_2;
1.所在页面的代码
$is_1="<b>"; $is_2="</b>";
意思为所在页面标签为<b>所在页面</b>
2.所在页面之后的页码
elseif($i==1) { $is_1='<a href="'.$dolink.$add[filename].$type.'">'; $is_2="</a>";
意思为所在页面,为<a>之前页面</a>
3.所在页面之后的页码
else { $is_1='<a href="'.$dolink.$add[filename].'_'.$i.$type.'">'; $is_2=" </a>";
意思为所在页面之后的页面,为<a>之后的页面</a>
(资源库 www.zyku.net)
您可能感兴趣的文章
- 11-30帝国CMS修改TAG列表分页数量的方法
- 10-15DedeCMS 文章列表分页样式修改的方法
- 09-26帝国cms怎样修改列表分页函数
- 07-15帝国CMS判断会员是否登陆的方法
- 11-16钉钉蓝牙自动打卡怎样设置
- 06-16帝国CMS检测服务器是否支持采集或远程
- 09-04Apache安装完无法正常启动的解决方法
- 01-12喵喵手账-喵喵手账应用软件功能介绍
- 01-18口袋铃声-口袋铃声应用软件功能介绍
- 09-26oppo手机怎样唤醒语音助手
- 12-29阳光照明-阳光照明应用软件功能介绍
- 07-06opporeno6暗色模式开启方法
- 12-12小米平板5如何更换字体
- 10-27快手在哪里查看视频播放量
- 08-21帝国CMS7.5火车采集器免登录发布模块
- 04-01git fetch 和git pull 的差别
- 01-17一条锦鲤-一条锦鲤应用软件功能介绍
- 02-20Dreamweaver定义模板批量制作网页
- 02-20使用notepad运行php,python的图文设置
- 02-28WordPress 文章/页面添加时间限制,到期
最近更新
阅读排行
猜你喜欢
- 02-11SecureCRTSecure7.0查看连接密码的步
- 12-31群宇科教-群宇科教应用软件功能介绍
- 11-24红米k40如何设置小窗应用
- 11-17小米12mini怎么设置悬浮窗
- 09-28微信群聊折叠功能怎么关闭
- 01-01iphone12录屏功能使用方法分享
- 04-10一加9r应用隐藏教程
- 09-12notability录音重命名步骤分享
- 01-11苹果12怎样设置壁纸
- 01-18好抓娃娃机app-好抓娃娃机app应用软件