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

帝国CMS自带模板变量

上一篇:[!–info.pre–]

下一篇:[!–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]

纯灵动标签

01 [e:loop={'selfinfo',1,0,0,'id<'.$navinfor[id].'','id desc'}]
02 <a href="<?php
03 echo $bqsr[titleurl];
04 $pre='true';
05 ?>">上一篇:<?=$bqr[title]?>
06 </a>
07 [/e:loop]
08 <?php
09 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>

爱搜源码 » 帝国CMS上下翻页页码调用方法集合

发表评论

发表评论