轻源码

  • QingYuanMa.com
  • 全球最大的互联网技术和资源下载平台
搜索
一起源码网 门户 织梦CMS 查看主题

织梦上一页下一页列表翻页单独调用的实现代码

发布者: wu_wang | 发布时间: 2018-10-1 09:23| 查看数: 4554| 评论数: 1|帖子模式

这个效果就是,列表页上的上一页和下一页,就是单独调用这两个功能,那么怎么实现呢? 简单搞了一下,仅作上下翻页,主页类似,可自行添加。 修改办法如下
找到这个文件
include\arc.listview.class.php
修改一下代码:
//获得上一页和主页的链接
if($this->PageNo != 1)
{
$prepage.="
\r\n";
$indexpage="
\r\n";

$uppage.="\r\n";
}
else
{
$indexpage="首页
\r\n";
$uppage.="\r\n";
}

//下一页,未页的链接
if($this->PageNo!=$totalpage && $totalpage>1)
{
$nextpage.="
\r\n";
$endpage="
\r\n";

$downpage.="\r\n";
}
else
{
$endpage="末页
\r\n";
$downpage.="\r\n";
}


红色是新加的部分

然后添加以下红色代码:

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

最后在模板中调用以下代码:
{dede:pagelist listitem="up"/}
{dede:pagelist listitem="down"/}

这样就可以单独的调用上一页下一页了的功能了。

最新评论

老头丿飘雪 发表于 2022-7-11 14:36
代码参考网站

轻源码让程序更轻更快

QingYuanMa.com

工作时间 周一至周六 8:00-17:30

侵权处理

客服QQ点击咨询

关注抖音号

定期抽VIP

Copyright © 2016-2021 https://www.171739.xyz/ 滇ICP备13200218号

快速回复 返回顶部 返回列表