帝国cms建站系统免费无广告 帝国CMS翻页 上一页下一页调用方法集合

帝国CMS教程

帝国cms自带模板变量

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

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

灵动标签+SQL语句

  1. [e:loop={"select*from[!db.pre!]ecms_newswhereid<'$navinfor[id]'andclassid='$navinfor[classid]'orderbyiddesclimit1",1,24,0}]
  2. 上一篇:<ahref="<?=$bqsr[titleurl]?>"title="上一篇:<?=$bqr[title]?>"target="_blank">&#9756;&nbsp;</a>
  3. [/e:loop]
  4. [e:loop={"select*from[!db.pre!]ecms_newswhereid>'$navinfor[id]'andclassid='$navinfor[classid]'orderbyidlimit1",1,24,0}]
  5. 下一篇:<ahref="<?=$bqsr[titleurl]?>"title="下一篇<?=$bqr[title]?>"target="_blank">&#9758;</a>
  6. [/e:loop]

纯灵动标签

  1. [e:loop={'selfinfo',1,0,0,'id<'.$navinfor[id].'','iddesc'}]
  2. <ahref="<?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].'','idasc'}]
  14. <ahref="<?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. <ahref="/e/public/GotoNext?classid=[!--self.classid--]&id=[!--id--]&enews=pre">上一篇文章</a>
  2. <ahref="/e/public/GotoNext?classid=[!--self.classid--]&id=[!--id--]&enews=next">下一篇文章</a>