导航
关闭

狼王King

当前位置:首页 > 网络教程 - 正文

帝国CMS上一篇,下一篇标题链接字数截取调用灵动标签sql当前栏目

  人参与 |更新时间: 2020年01月24日 23:47

一、动态调用上一篇下一篇链接

动态调用上一篇链接:

<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={"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 "下一篇:很抱歉没有了"; 

?>

四、控制上一篇下一篇标题字数截取30个字符为例 

运用:<?=esub($bqr[title],30)?> 
 
上一篇代码:

[e:loop={'selfinfo',1,0,0,'id<'.$navinfor[id].'','id desc'}] 
<a href="<?php 
echo $bqsr[titleurl]; 
$pre='true'; 
?>">上一篇: <?=esub($bqr[title],30)?></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'; 
?>">下一篇:<?=esub($bqr[title],30)?> 
</a> 
[/e:loop] 
<?php 
if(empty($next)){ 
echo "下一篇:很抱歉没有了"; 

?> 

编辑:狼王(微信/QQ:1574808)

来源:狼王King(微信/QQ:1574808),欢迎分享!

本文链接:https://www.iwolfking.com/jiaocheng/482.html

评论专区

留言与评论(共有 0 条评论)
表情:   
验证码: