dedecms列表页上一页下一页翻页单独调用的方法


本文整理自网络,侵删。

本文实例讲述了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 >上一页\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 >下一页\r\n";
$endpage="<</b>li><</b>a >末页\r\n"; </p> <p>$downpage.="<</b>a >下一页\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建站有所帮助。


标签:织梦DedeCMS

相关阅读 >>

织梦dede去掉后台登陆界面广告的方法

收集的dedecms一些使用经验

织梦DedeCMS 分表实现一个栏目对应一个表(图)

织梦dede模板内怎么加入php代码的方法示例

dedecms list增加noflag属性的方法 实现让列表标签不调用有推荐属性的文章

织梦DedeCMS安全漏洞includecommon.inc.php漏洞解决方法

关于cms的选择几点建议

dedecms 5.6 5.7发布文章空白问题解决方法

dedecms仿站教程dede模板文件的代码结构

织梦DedeCMS内页、详情页中调用文章发布者信息的方法

更多相关阅读请进入《织梦DedeCMS》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...

    正在狠努力加载,请稍候...