一: 动态调用上一篇下一篇链接 <a href="https://www.ecmsphp.com/e/public/GotoNext?classid=9&id=3131&enews=pre">上一篇</a> 动态调用上一篇链接 <a href="https://www.ecmsphp.com/e/public/GotoNext?classid=9&id=3131&enews=next">下一篇</a> 动态调用下一篇链接 二: 运用灵动标签和SQl语句调用 上一篇链接: [e:loop={"select id,classid,newspath,filename,groupid,titleurl from [!db.pre!]ecms_".$class_r[$navinfor[classid]]['tbname']." where id<".$navinfor[id]." and classid=".$navinfor[classid]." and checked=1 order by id desc limit 1",1,24,0}] <?php $titleurl=sys_ReturnBqTitleLink($bqr); echo $titleurl; [/e:loop] 下一篇链接:(把小于号改成大于号) [e:loop={"select id,classid,newspath,filename,groupid,titleurl from [!db.pre!]ecms_".$class_r[$navinfor[classid]]['tbname']." where id>".$navinfor[id]." and classid=".$navinfor[classid]." and checked=1 order by id desc limit 1",1,24,0}] <?php $titleurl=sys_ReturnBqTitleLink($bqr); echo $titleurl; [/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 "下一篇:很抱歉没有了"; } ?>
|