• 织梦列表页内容页输出上一个栏目和下一个栏目


    织梦内容页有上一篇下一篇文章,没有上一个栏目下一个栏目,我们不修改程序内核文件,直接在模板里用runphp输出上一个栏目和下一个栏目

    上一个栏目下一个栏目标签写法

    • 适用于列表页、内容页
    • 适用于动态、静态
    {dede:field.typeid runphp=yes}
    global $dsql;
    $topreid = (@me==GetTopid(@me)) ? @me : GetTopid(@me);
    $row = $dsql->GetOne("SELECT * FROM `#@_arctype` WHERE reid=$topreid AND id<@me order by id desc");
    if(!is_array($row))
    {
    	@me = "<li>上一个栏目:没有了</li>";
    }
    else
    {
    	$row['typeurl'] = GetOneTypeUrlA($row);
    	@me = "<li>上一个栏目:<a href='{$row['typeurl']}'>{$row['typename']}</a></li>";
    }
    {/dede:field.typeid}
    
    {dede:field.typeid runphp=yes}
    global $dsql;
    $topreid = (@me==GetTopid(@me)) ? @me : GetTopid(@me);
    $row = $dsql->GetOne("SELECT * FROM `#@_arctype` WHERE reid=$topreid AND id>@me order by id asc");
    if(!is_array($row))
    {
    	@me = "<li>下一个栏目:没有了</li>";
    }
    else
    {
    	$row['typeurl'] = GetOneTypeUrlA($row);
    	@me = "<li>下一个栏目:<a href='{$row['typeurl']}'>{$row['typename']}</a></li>";
    }
    {/dede:field.typeid}
  • 相关阅读:
    flyway
    xxl-job
    响应式布局
    position: fixed
    position: absolute
    position: relative
    GDB高级一点的命令
    坑爹的大页内存
    input8按键对照
    discuz插件应用原理分析
  • 原文地址:https://www.cnblogs.com/dedehtml/p/9914086.html
Copyright © 2020-2023  润新知