加入收藏 | 设为首页 | 会员中心 | 我要投稿 常州站长网 (https://www.0519zz.com/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 运营中心 > 建站资源 > 经验 > 正文

dedecms列表页上一页下一页翻页独自调用

发布时间:2021-11-24 23:23:11 所属栏目:经验 来源:互联网
导读:我用织梦dedecms实现列表页上一页下一页翻页单独调用的方法 在列表页单独调用上一页和下一页,以及首页,简单搞了一下,仅作上下翻页,主页类似,可自行添加 在模板中以 {dede:pagelist listitem=up/} {dede:pagelist listitem=down/} 来调用、 修改办法如
我用织梦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='".str_replace("{page}",$prepagenum,$tnamerule)."'>上一页/r/n";  
        }  
        else
        {  
            $indexpage="<</b>li>首页/r/n";  
       $uppage.="<</b>a>没有了<</b>/a>/r/n";  
        }  
 
        //下一页,未页的链接  
        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";  
 
        $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; 


dedecms列表页上一页下一页翻页独自调用

(编辑:常州站长网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    热点阅读