dedecms 列表 用分页标签 判断 当第一页则显示,第二页以上不显示 土办法!

arc.listview.class.php

function GetPageListST($list_len,$listitem="index,end,pre,next,pageno,spurl")  // ,spurl新增的
,spurl新境的

        $purl = $this->GetCurUrl();
        $maininfo = "<li><span class=\"pageinfo\">共 <strong>{$totalpage}</strong>页<strong>".$this->TotalResult."</strong>条</span></li>\r\n";
        $tnamerule = $this->GetMakeFileRule($this->Fields['id'],"list",$this->Fields['typedir'],$this->Fields['defaultname'],$this->Fields['namerule2']);
        $tnamerule = preg_replace("/^(.*)\//", '', $tnamerule);
        $typedir= ereg_replace('{cmspath}',$GLOBALS['cfg_cmspath'],$this->Fields['typedir']); //新增的

  

        if($this->PageNo != 1)
        {
            $prepage.="<li><a href='".str_replace("{page}",$prepagenum,$tnamerule)."'>上一页</a></li>\r\n";
            $indexpage="<li><a href='".str_replace("{page}",1,$tnamerule)."'>首页</a></li>\r\n";
        }
        else
        {
            $indexpage="<li>首页</li>\r\n";
$spurlpage= $GLOBALS['cfg_basehost'].$typedir."/";  //新增的

  

        }
        $plist = '';
        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;
        if(preg_match('/spurl/i', $listitem)) $plist .= $spurlpage;  //新增的
        
        return $plist;
    }

  list_article.htm 调用 {dede:pagelist listitem="spurl" listsize="0"/}

 

当第一页则显示列表的网址,第二页往后则不显示。用于百度移动适配,因为移动版与PC版条数不一样,二页往后内容完全不对应。适配失败。所以只能适配第一页。

转载于:https://www.cnblogs.com/jizl/p/4634769.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值