手机
当前位置:查字典教程网 >CMS教程 >dedecms >dedecms列表页上一页下一页翻页单独调用的方法
dedecms列表页上一页下一页翻页单独调用的方法
摘要:本文实例讲述了dedecms列表页上一页下一页翻页单独调用的方法。分享给大家供大家参考。具体实现方法如下:在列表页单独调用上一页和下一页,以...

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

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

在模板中以

{dede:pagelist listitem="up"/}

{dede:pagelist listitem="down"/}

来调用。

修改办法如下:

在includearc.listview.class.php

找到:

/获得上一页和主页的链接

if($this->PageNo != 1)

{

$prepage.="<</b>li>上一页rn";

$indexpage="<</b>li>首页rn";

$uppage.="<</b>a href='".str_replace("{page}",$prepagenum,$tnamerule)."'>上一页rn";

}

else

{

$indexpage="<</b>li>首页rn";

$uppage.="<</b>a>没有了<</b>/a>rn";

} </p> <p>//下一页,未页的链接

if($this->PageNo!=$totalpage && $totalpage>1)

{

$nextpage.="<</b>li><</b>a href='".str_replace("{page}",$nextpagenum,$tnamerule)."'>下一页rn";

$endpage="<</b>li><</b>a href='".str_replace("{page}",$totalpage,$tnamerule)."'>末页rn"; </p> <p>$downpage.="<</b>a href='".str_replace("{page}",$nextpagenum,$tnamerule)."'>下一页rn";

}

else

{

$endpage="<</b>li>末页rn";

$downpage.="<</b>a>没有了rn";

}

然后:

$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列表页上一页下一页翻页单独调用的方法】相关文章:

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

dedecms实现首页顶部会员登陆框的方法

dedecms 5.6 分页样式代码修改方法

dedecms子栏目中调用其顶级栏目名称和简介的方法

dedecms中调用隐藏栏目的方法

dedecms自定义表单添加发布时间功能的方法

dede在首页调用文章页全部内容的方法

dedecms列表页缩略图大小控制的方法

dedeCMS列表页调用tag的方法小结(5.6/5.7)

dedecms中首页调用专题的方法(5.1-5.7)

精品推荐
分类导航