织梦dedecms上一页下一页列表翻页单独调用的如何实现代码

已经是深秋了,森林里那一望无际的林木都已光秃,让褐色的苔掩住它身上的皱纹。无情的秋天剥下了它们美丽的衣裳,它们只好枯秃地站在那里。
这个效果就是,列表页上的上一页和下一页,就是单独调用这两个功能,那么怎么实现呢? 简单搞了一下,仅作上下翻页,主页类似,可自行添加。 修改办法如下 找到这个文件 include\arc.listview.class.php 修改一下代码: //获得上一页和主页的链接 if($this->PageNo != 1) { $prepage.="<li><a rel="nofollow noopener noreferrer" href='".str_replace("{page}",$prepagenum,$tnamerule)."'>上一页</a></li>\r\n"; $indexpage="<li><a rel="nofollow noopener noreferrer" href='".str_replace("{page}",1,$tnamerule)."'>首页</a></li>\r\n"; $uppage.="<a rel="nofollow noopener noreferrer" href='".str_replace("{page}",$prepagenum,$tnamerule)."'>上一页</a>\r\n"; } else { $indexpage="<li>首页</li>\r\n"; $uppage.="<a>没有了</a>\r\n"; } //下一页,未页的链接 if($this->PageNo!=$totalpage && $totalpage>1) { $nextpage.="<li><a rel="nofollow noopener noreferrer" href='".str_replace("{page}",$nextpagenum,$tnamerule)."'>下一页</a></li>\r\n"; $endpage="<li><a rel="nofollow noopener noreferrer" href='".str_replace("{page}",$totalpage,$tnamerule)."'>末页</a></li>\r\n"; $downpage.="<a rel="nofollow noopener noreferrer" href='".str_replace("{page}",$nextpagenum,$tnamerule)."'>下一页</a>\r\n"; } else { $endpage="<li>末页</li>\r\n"; $downpage.="<a>没有了</a>\r\n"; } 红色是新加的部分 然后添加以下红色代码: $plist = ''; if(preg_match('/up/i', $listitem)) $plist .= $uppage; if(preg_match('/down/i', $listitem)) $plist .= $downpage; if(preg_match('/index/i', $listitem)) $plist .= $indexpage; if(preg_match('/pre/i', $listitem)) $plist .= $prepage; if(preg_match('/pageno/i', $listitem)) $plist .= $listdd; if(preg_match('/next/i', $listitem)) $plist .= $nextpage; if(preg_match('/end/i', $listitem)) $plist .= $endpage; if(preg_match('/option/i', $listitem)) $plist .= $optionlist; if(preg_match('/info/i', $listitem)) $plist .= $maininfo; 最后在模板中调用以下代码: {dede:pagelist listitem="up"/} {dede:pagelist listitem="down"/} 这样就可以单独的调用上一页下一页了的功能了。

到此这篇关于织梦dedecms上一页下一页列表翻页单独调用的如何实现代码就介绍到这了。对牛弹琴伤心的不是牛,先了解对象后,再“弹琴”。更多相关织梦dedecms上一页下一页列表翻页单独调用的如何实现代码内容请查看相关栏目,小编编辑不易,再次感谢大家的支持!

您可能有感兴趣的文章
织梦后台文档列表添加复制文档功能支持所有模型

织梦无法上传ico图标格式文件的如何解决方法

dedecms如何实现任意页面调用当前会员信息的方

织梦dede:tag调用指定多个栏目的TAG标签

织梦栏目列表按附加表自定义字段排序