A5下载 - 努力做内容最丰富最安全的下载站!

A5站长下载站

当前位置:A5下载 > 源码技巧 > dedecms > dedecms列表页上一页下一页翻页单独调用的方法

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

时间:2015-05-07 10:23作者:zhao人气:195

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

在模板中以

代码如下:

{dede:pagelist listitem="up"/}

{dede:pagelist listitem="down"/}

来调用。

修改办法如下:

在includearc.listview.class.php

找到:

代码如下:
/获得,未页的链接

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,列表,一页,翻页,单独,用的,方法,列表,单

相关下载

查看所有评论+

网友评论

网友
您的评论需要经过审核才能显示

公众号