栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > PHP > php开源框架 > dedecms

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

dedecms 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

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

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

    $uppage.="上一页rn";
    }
    else
    {
    $indexpage="
  • 首页
  • rn";
    $uppage.="没有了rn";
    }

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

    $downpage.="下一页rn";
    }
    else
    {
    $endpage="
  • 末页
  • rn";
    $downpage.="没有了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;

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

    这样就可以单独的调用上一页下一页了的功能了。
    转载请注明:文章转载自 www.mshxw.com
    本文地址:https://www.mshxw.com/it/9211.html
    我们一直用心在做
    关于我们 文章归档 网站地图 联系我们

    版权所有 (c)2021-2022 MSHXW.COM

    ICP备案号:晋ICP备2021003244-6号