织梦cms如何实现列表页单独的上一页下一页翻页效果

看淡拥有,不刻意追求某些东西,落叶归根,那些属于你的,总会回来。劳动的意义不仅在于追求业绩,更在于完善人的心灵。

某个朋友要仿这个效果,在列表页单独调用上一页和下一页,以及首页,简单搞了一下,仅作上下翻页,主页类似,可自行添加。

在模板中以

{dede:pagelist listitem=”up”/}
{dede:pagelist listitem=”down”/}

来调用、

修改办法如下

includearc.listview.class.php

找到

本部分设定了隐藏,您已回复过了,以下是隐藏的内容

//获得上一页和主页的链接
if($this->PageNo != 1)
{
$prepage.=”<li><a rel="nofollow noopener noreferrer" href=’”.str_replace(“{page}”,$prepagenum,$tnamerule).”‘>上一页</a></li>rn”;
$indexpage=”<li><a rel="nofollow noopener noreferrer" href=’”.str_replace(“{page}”,1,$tnamerule).”‘>首页</a></li>rn”;

$uppage.=”<a rel="nofollow noopener noreferrer" href=’”.str_replace(“{page}”,$prepagenum,$tnamerule).”‘>上一页</a>rn”;
}
else
{
$indexpage=”<li>首页</li>rn”;
$uppage.=”<a>没有了</a>rn”;
}

//下一页,未页的链接
if($this->PageNo!=$totalpage && $totalpage>1)
{
$nextpage.=”<li><a rel="nofollow noopener noreferrer" href=’”.str_replace(“{page}”,$nextpagenum,$tnamerule).”‘>下一页</a></li>rn”;
$endpage=”<li><a rel="nofollow noopener noreferrer" href=’”.str_replace(“{page}”,$totalpage,$tnamerule).”‘>末页</a></li>rn”;

$downpage.=”<a rel="nofollow noopener noreferrer" href=’”.str_replace(“{page}”,$nextpagenum,$tnamerule).”‘>下一页</a>rn”;
}
else
{
$endpage=”<li>末页</li>rn”;
$downpage.=”<a>没有了</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;

 

本文织梦cms如何实现列表页单独的上一页下一页翻页效果到此结束。记得三个尊:尊重自已,尊重别人,保持尊严,对自已的行为负责。小编再次感谢大家对我们的支持!

您可能有感兴趣的文章
织梦后台文档列表添加复制文档功能支持所有模型

织梦无法上传ico图标格式文件的如何解决方法

dedecms如何实现任意页面调用当前会员信息的方

织梦dede:tag调用指定多个栏目的TAG标签

织梦栏目列表按附加表自定义字段排序