您的位置首页百科知识

DEDECMS列表页只要上一页下一页处理方式

DEDECMS列表页只要上一页下一页处理方式

的有关信息介绍如下:

DEDECMS列表页只要上一页下一页处理方式

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

模板中以

复制代码代码如下:

{dede:pagelist listitem=up/}

{dede:pagelist listitem=down/}

来调用。

在include\arc.listview.class.php

找到:

/**

* 获取静态的分页列表

*

* @access public

* @param string $list_len 列表宽度

* @param string $list_len 列表样式

* @return string

*/

function GetPageListST($list_len,$listitem="index,end,pre,next,pageno")

{

$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 "

  • 1
  • ";

    // return "

  • 1".$this->TotalResult."条记录
  • \r\n";

    }

    if($this->TotalResult == 0)

    {

    //return "

  • 0".$this->TotalResult."条记录
  • \r\n";

    }

    $purl = $this->GetCurUrl();

    // $maininfo = "

  • {$totalpage}".$this->TotalResult."
  • \r\n";

    $tnamerule = $this->GetMakeFileRule($this->Fields['id'],"list",$this->Fields['typedir'],$this->Fields['defaultname'],$this->Fields['namerule2']);

    $tnamerule = preg_replace("/^(.*)\//", '', $tnamerule);

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

    if($this->PageNo != 1){

    $prepage.="

  • 上一页
  • ";

    $indexpage="

  • 首页
  • ";

    $uppage.="上一页";

    }

    else

    {

    $indexpage="

  • 首页
  • ";

    $uppage.="第一页";

    }

    //下一页,未页的链接

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

    {

    $nextpage.="

  • 下一页
  • ";

    $endpage="

  • 末页
  • ";

    $downpage.="下一页";

    }

    else

    {

    $endpage="

  • 末页
  • ";

    //$downpage.="最后一页";

    }

    复制代码代码如下:$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;