Bootstrap 织梦搜索列表分页

找到 include 下的 arc.searchview.class.php

并找到该代码段
Bootstrap 织梦搜索列表分页_第1张图片
 

将其他方法替换为:

    /**
     *  获取动态的分页列表
     *
     * @access    public
     * @param     string  $list_len  列表宽度
     * @return    string
     */
    function GetPageListDM($list_len)
    {
        global $oldkeyword;
        $prepage="";
        $nextpage="";
        $prepagenum = $this->PageNo - 1;
        $nextpagenum = $this->PageNo + 1;
        if($list_len=="" || preg_match("/[^0-9]/", $list_len))
        {
            $list_len=3;
        }
        $totalpage = ceil($this->TotalResult / $this->PageSize);
        if($totalpage<=1 && $this->TotalResult>0)
        {
            return "";
        }
        if($this->TotalResult == 0)
        {
            return "";
        }
        $purl = $this->GetCurUrl();
        
        $oldkeyword = (empty($oldkeyword) ? $this->Keyword : $oldkeyword);

        //当结果超过限制时,重设结果页数
        if($this->TotalResult > $this->SearchMaxRc)
        {
            $totalpage = ceil($this->SearchMaxRc/$this->PageSize);
        }
        $infos = "
  • 共找到".$this->TotalResult."条记录/最大显示{$totalpage}
  • \r\n"; $geturl = "keyword=".urlencode($oldkeyword)."&searchtype=".$this->SearchType; $hidenform = "\r\n"; $geturl .= "&channeltype=".$this->ChannelType."&orderby=".$this->OrderBy; $hidenform .= "\r\n"; $hidenform .= "\r\n"; $geturl .= "&kwtype=".$this->KType."&pagesize=".$this->PageSize; $hidenform .= "\r\n"; $hidenform .= "\r\n"; $geturl .= "&typeid=".$this->TypeID."&TotalResult=".$this->TotalResult."&"; $hidenform .= "\r\n"; $hidenform .= "\r\n"; $purl .= "?".$geturl; //获得上一页和下一页的链接 if($this->PageNo != 1) { $prepage.="
  • «
  • \r\n"; $indexpage="
  • 首页
  • \r\n"; } else { $indexpage="
  • 首页
  • \r\n"; } if($this->PageNo!=$totalpage && $totalpage>1) { $nextpage.="
  • »
  • \r\n"; $endpage="
  • 末页
  • \r\n"; } else { $endpage="
  • 末页
  • \r\n"; } //获得数字链接 $listdd=""; $total_list = $list_len * 2 + 1; if($this->PageNo >= $total_list) { $j = $this->PageNo - $list_len; $total_list = $this->PageNo + $list_len; if($total_list > $totalpage) { $total_list = $totalpage; } } else { $j=1; if($total_list > $totalpage) { $total_list = $totalpage; } } for($j; $j<=$total_list; $j++) { if($j == $this->PageNo) { $listdd.= "
  • ".$j."
  • \r\n"; } else { $listdd.="
  • ".$j."
  • \r\n"; } } $plist = "
    $hidenform"; $plist .= "
      \r\n"; //$plist .= $infos; $plist .= $indexpage; $plist .= $prepage; $plist .= $listdd; $plist .= $nextpage; $plist .= $endpage; $plist .= "
    \r\n
    \r\n"; return $plist; }

     

    在html页面上写

    {dede:pagelist listitem="index,end,pre,next,pageno"/}

     

    效果图:
    Bootstrap 织梦搜索列表分页_第2张图片
     

     

    你可能感兴趣的:(境-Boots)