网络营销电子商务研究中心  
How to buy the best prescription safety glasses in Canada? Let's study!
Go Back   网络营销电子商务研究中心 > 网站建设 > 帝国Cms
User Name
Password
 
FAQ Members List Calendar Cheap Glasses Mark Forums Read

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1   IP: 49.87.51.174
Old 2014-01-27, 06:49 PM
topvip topvip is offline
超级版主
 
Join Date: 2006-01-04
Posts: 1206
topvip 正向着好的方向发展
Default 上一篇,下一篇自定义综合解决方案:标题链接调用,字数截取 灵动标签 sql 当前栏目

论坛有很多朋友都有同样的疑问:如何单独调用上一篇,下一篇的链接?如何限制调用出来的标题字数?
【一丝冰凉】今天总结下详细的解决方案:

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

<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 "下一篇:很抱歉没有了";
}
?>
Reply With Quote
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Sql优化34条(转) car 建站交流 0 2009-12-13 10:16 AM
X-Cart Multiple Input Validation Holes Permit SQL Injection and Cross-Site Scripting topvip X-Cart 0 2009-07-21 10:03 AM
SQL Server导出导入数据方法 topvip 服务器环境搭建 0 2009-05-06 11:04 AM
跟我学sql:(一)数据查询 topvip 建站交流 0 2009-02-12 07:41 AM
sql 经典语句 topvip 建站交流 0 2009-02-12 07:39 AM

Prescription-glasses.com offers prescription glasses online at discount prices.
All times are GMT +8. The time now is 07:28 AM.


Powered by vBulletin Version 3.8.7
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.