dedecms列表页上一页下一页翻页单独调用的方法
框架(架构)  /  管理员 发布于 6年前   136
本文实例讲述了dedecms列表页上一页下一页翻页单独调用的方法。分享给大家供大家参考。具体实现方法如下:
在列表页单独调用上一页和下一页,以及首页,简单搞了一下,仅作上下翻页,主页类似,可自行添加。
在模板中以
复制代码代码如下:{dede:pagelist listitem="up"/}
{dede:pagelist listitem="down"/}
来调用。
修改办法如下:
在include\arc.listview.class.php
找到:
复制代码代码如下:/获得上一页和主页的链接
if($this->PageNo != 1)
{
$prepage.="<</b>li>上一页\r\n";
$indexpage="<</b>li>首页\r\n";
$uppage.="<</b>a href='https:/cms/".str_replace("{page}",$prepagenum,$tnamerule)."'>上一页\r\n";
}
else
{
$indexpage="<</b>li>首页\r\n";
$uppage.="<</b>a>没有了<</b>/a>\r\n";
} </p><p>//下一页,未页的链接
if($this->PageNo!=$totalpage && $totalpage>1)
{
$nextpage.="<</b>li><</b>a href='https:/cms/".str_replace("{page}",$nextpagenum,$tnamerule)."'>下一页\r\n";
$endpage="<</b>li><</b>a href='https:/cms/".str_replace("{page}",$totalpage,$tnamerule)."'>末页\r\n"; </p><p>$downpage.="<</b>a href='https:/cms/".str_replace("{page}",$nextpagenum,$tnamerule)."'>下一页\r\n";
}
else
{
$endpage="<</b>li>末页\r\n";
$downpage.="<</b>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;
希望本文所述对大家的dedecms建站有所帮助。
122 在
学历:一种延缓就业设计,生活需求下的权衡之选中评论 工作几年后,报名考研了,到现在还没认真学习备考,迷茫中。作为一名北漂互联网打工人..123 在
Clash for Windows作者删库跑路了,github已404中评论 按理说只要你在国内,所有的流量进出都在监控范围内,不管你怎么隐藏也没用,想搞你分..原梓番博客 在
在Laravel框架中使用模型Model分表最简单的方法中评论 好久好久都没看友情链接申请了,今天刚看,已经添加。..博主 在
佛跳墙vpn软件不会用?上不了网?佛跳墙vpn常见问题以及解决办法中评论 @1111老铁这个不行了,可以看看近期评论的其他文章..1111 在
佛跳墙vpn软件不会用?上不了网?佛跳墙vpn常见问题以及解决办法中评论 网站不能打开,博主百忙中能否发个APP下载链接,佛跳墙或极光..
Copyright·© 2019 侯体宗版权所有·
粤ICP备20027696号