加入收藏 | 设为首页 | 会员中心 | 我要投稿 济源站长网 (https://www.0391zz.cn/)- 数据工具、数据仓库、行业智能、CDN、运营!
当前位置: 首页 > 教程 > 正文

内容页调用上一篇,下一篇方法总结

发布时间:2022-06-29 13:24:56 所属栏目:教程 来源:互联网
导读:动态调用上一篇下一篇链接 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 动态调用下
  动态调用上一篇下一篇链接
 
  <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(emptyempty($pre)){
  echo "上一篇:很抱歉没有了";
  }
  ?>
  <!--下一篇-->
  [e:loop={'selfinfo',1,0,0,'id>'.$navinfor[id].'','id asc'}]
  <a href="<?php //开源软件:phpfensi.com
  echo $bqsr[titleurl];
  $next='true';
  ?>">下一篇:<?=$bqr[title]?>
  </a>
  [/e:loop]
  <?php  
  if(emptyempty($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(emptyempty($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(emptyempty($next)){
  echo "下一篇:很抱歉没有了";
  }
  ?>。

(编辑:济源站长网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    热点阅读