织梦优化

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

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

温馨提示:DedeCMS用户请及时前往织梦官网处理官方版权事宜。
dedecms列表页上一页下一页翻页单独调用的方法

本文实例讲述了dedecms列表页翻页单独调用的方法。分享给大家供大家参考。具体实现方法如下:

在列表页单独调用,以及首页,简单搞了一下,仅作上下翻页,主页类似,可自行添加。

在模板中以代码如下:

{dede:pagelist listitem="up"/}
{dede:pagelist listitem="down"/}

修改办法如下:

在include\arc.listview.class.php

找到如下代码:

//获得,未页的链接
if($this->PageNo!=$totalpage && $totalpage>1)
{
$nextpage.="<</b>li><</b>a href='".str_replace("{page}",$nextpagenum,$tnamerule)."'>下一页\r\n";
$endpage="<</b>li><</b>a href='".str_replace("{page}",$totalpage,$tnamerule)."'>末页\r\n"; </p> <p>$downpage.="<</b>a href='".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;

本文属原创,转载请注明原文:http://www.zhimatong.com/jiaocheng/616.html

为保证教程的实用性及扩大知识面覆盖,如果您有相似问题而未解决,可联系在线客服免费技术支持。

内容有用

联系
顾问

在线
客服
购物车
账号登录

没有账号?立即注册

忘记密码

登录即同意用户协议没有账号? 立即注册
账号注册
我已阅读并同意用户协议
立即注册
注册即同意用户协议已有账号? 立即登录
找回密码

操作步骤:邮箱验证->设置新密码

注册即同意用户协议已有账号? 立即登录