帝国CMS翻页 上一页下一页调用方法集合

分类:程序说明教程 发布时间:2020-02-05 21:22:26

摘要:帝国CMS如何使用灵动标签调用上一页下一页?SQL调用上一页下一页调用方法&教程&指南,适用于帝国7.5,7.2,7.0

帝国CMS自带模板变量

  1. 上一篇:[!--info.pre--]
  2. 下一篇:[!--info.next--]

缺点:[!--info.pre--] 和 [!--info.next--] 中封装的 <a>标签的内容无法定制

灵动标签+SQL语句

  1. [e:loop={"select * from [!db.pre!]ecms_news where id<'$navinfor[id]' and classid='$navinfor[classid]' order by id desc limit 1",1,24,0}]
  2. 上一篇:<a href="<?=$bqsr[titleurl]?>" title="上一篇:<?=$bqr[title]?>" target="_blank">  &#9756;&nbsp; </a>
  3. [/e:loop]
  4. [e:loop={"select * from [!db.pre!]ecms_news where id>'$navinfor[id]' and classid='$navinfor[classid]' order by id limit 1",1,24,0}]
  5. 下一篇:<a href="<?=$bqsr[titleurl]?>" title="下一篇<?=$bqr[title]?>" target="_blank">&#9758;</a>
  6. [/e:loop]

纯灵动标签

  1. [e:loop={'selfinfo',1,0,0,'id<'.$navinfor[id].'','id desc'}]
  2. <a href="<?php 
  3. echo $bqsr[titleurl];
  4. $pre='true';
  5. ?>">上一篇:<?=$bqr[title]?>
  6. </a>
  7. [/e:loop]
  8. <?php 
  9. if(empty($pre)){
  10. echo "上一篇:很抱歉没有了";
  11. }
  12. ?>
  13. [e:loop={'selfinfo',1,0,0,'id>'.$navinfor[id].'','id asc'}]
  14. <a href="<?php 
  15. echo $bqsr[titleurl];
  16. $next='true';
  17. ?>">下一篇:<?=$bqr[title]?>
  18. </a>
  19. [/e:loop]
  20. <?php 
  21. if(empty($next)){
  22. echo "下一篇:很抱歉没有了";
  23. }
  24. ?>

动态调用

  1. <a href="/e/public/GotoNext?classid=[!--self.classid--]&id=[!--id--]&enews=pre">上一篇文章</a>
  2. <a href="/e/public/GotoNext?classid=[!--self.classid--]&id=[!--id--]&enews=next">下一篇文章</a>