内容页调用上一篇,下一篇帝国CMS方法集合
一: 动态调用上一篇下一篇链接<a href="&#091;!--news.url--]e/public/GotoNext?classid=&#091;!--classid--]&id=&#091;!--id--]&enews=pre">上一篇</a> 动态调用上一篇链接<a href="&#091;!--news.url--]e/public/……
一: 动态调用上一篇下一篇链接<a href="[!--news.url--]e/public/GotoNext?classid=[!--classid--]&id=[!--id--]&enews=pre">上一篇</a> 动态调用上一篇链接<a href="[!--news.url--]e/public/GotoNext?classid=[!--classid--]&id=[!--id--]&enews=next">下一篇</a> 动态调用下一篇链接
二: 灵动标签和sql语句调用上一篇链接:
[e:loop={"selectid,classid,newspath,filename,groupid,titleurlfrom[!db.pre!]ecms_".$class_r[$navinfor[classid]]['tbname']."whereid<".$navinfor[id]."andclassid=".$navinfor[classid]."andchecked=1orderbyiddesclimit1",1,24,0}]<?php$titleurl=sys_ReturnBqTitleLink($bqr);echo$titleurl;[/e:loop]
下一篇链接:(把小于号改成大于号)
[e:loop={"selectid,classid,newspath,filename,groupid,titleurlfrom[!db.pre!]ecms_".$class_r[$navinfor[classid]]['tbname']."whereid>".$navinfor[id]."andclassid=".$navinfor[classid]."andchecked=1orderbyiddesclimit1",1,24,0}]<?php$titleurl=sys_ReturnBqTitleLink($bqr);echo$titleurl;[/e:loop]
三: 运用灵动标签调用,比较简洁的方式(感谢 落木萧萧)<!--上一篇-->
[e:loop={'selfinfo',1,0,0,'id<'.$navinfor[id].'','iddesc'}]<ahref="<?phpecho$bqsr[titleurl];$pre='true';?>">上一篇:<?=$bqr[title]?></a>[/e:loop]<?phpif(empty($pre)){echo"上一篇:很抱歉没有了";}?>
<!--下一篇-->
[e:loop={'selfinfo',1,0,0,'id>'.$navinfor[id].'','idasc'}]<ahref="<?phpecho$bqsr[titleurl];$next='true';?>">下一篇:<?=$bqr[title]?></a>[/e:loop]<?phpif(empty($next)){echo"下一篇:很抱歉没有了";}?>
四: 控制上一篇下一篇标题字数截取30个字符为例运用:<?=esub($bqr[title],30)?>
<!--上一篇-->
[e:loop={'selfinfo',1,0,0,'id<'.$navinfor[id].'','iddesc'}]<ahref="<?phpecho$bqsr[titleurl];$pre='true';?>">上一篇:<?=esub($bqr[title],30)?></a>[/e:loop]<?phpif(empty($pre)){echo"上一篇:很抱歉没有了";}?>
<!--下一篇-->
[e:loop={'selfinfo',1,0,0,'id>'.$navinfor[id].'','idasc'}]<ahref="<?phpecho$bqsr[titleurl];$next='true';?>">下一篇:<?=esub($bqr[title],30)?></a>[/e:loop]<?phpif(empty($next)){echo"下一篇:很抱歉没有了";}?>