帝國CMS自帶模板變量
上一篇:[!--info.pre--]
下一篇:[!--info.next--]
缺點:[!--info.pre--] 和 [!--info.next--] 中封裝的 <a>標簽的內容無法定制
靈動標簽+SQL語句
[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}]上一篇:<a href="<?=$bqsr[titleurl]?>" title="上一篇:<?=$bqr[title]?>" target="_blank"> ☜ </a>[/e:loop][e:loop={"select * from [!db.pre!]ecms_news where id>'$navinfor[id]' and classid='$navinfor[classid]' order by id limit 1",1,24,0}]下一篇:<a href="<?=$bqsr[titleurl]?>" title="下一篇<?=$bqr[title]?>" target="_blank">☞</a>[/e:loop]
純靈動標簽
[e:loop={'selfinfo',1,0,0,'id<'.$navinfor[id].'','id desc'}]<a href="<?php echo $bqsr[titleurl];$pre='true';?>">上一篇:<?=$bqr[title]?></a>[/e:loop]<?php if(empty($pre)){echo "上一篇:很抱歉沒有了";}?>[e:loop={'selfinfo',1,0,0,'id>'.$navinfor[id].'','id asc'}]<a href="<?php echo $bqsr[titleurl];$next='true';?>">下一篇:<?=$bqr[title]?></a>[/e:loop]<?php if(empty($next)){echo "下一篇:很抱歉沒有了";}?>
動態調用
<a href="/e/public/GotoNext?classid=[!--self.classid--]&id=[!--id--]&enews=pre">上一篇文章</a><a href="/e/public/GotoNext?classid=[!--self.classid--]&id=[!--id--]&enews=next">下一篇文章</a>
|
新聞熱點
疑難解答