易仿帝国yfdiguo.com

您当前的位置:首页 > 问题库

帝国CMS灵动标签调用Discuz帖子的方法

zcmcss发表于2017-12-11问题库
调用某版块最新帖子:
[e:loop={"select tid,subject,dateline from 数据库名.表前缀_threads where fid=版块ID order by tid desc limit 10",10,24,0}]
<li><a href="http://www.cmsjzy.cn /bbs/thread-<?=$bqr[tid]?>-1-1.html" target="_blank"><?=esub($bqr[subject],32)?></a></li>
[/e:loop]

 
调用全论坛新帖子:
[e:loop={"select tid,subject,dateline from cmsjzy.cmsjzy_threads order by tid desc limit 8",10,24,0}]
<li><a href="http://www.cmsjzy.cn /bbs/thread-<?=$bqr[tid]?>-1-1.html" target="_blank"><?=esub($bqr[subject],32)?></a></li>
[/e:loop]


调用全论坛热帖子:
[e:loop={"select tid,subject,dateline from cmsjzy.cmsjzy_threads order by views desc limit 8",10,24,0}]
<li><a href="http://www.cmsjzy.cn /bbs/thread-<?=$bqr[tid]?>-1-1.html" target="_blank"><?=esub($bqr[subject],32)?></a></li>
[/e:loop]


调用指定版块的精华帖子:
[e:loop={"select tid,subject,dateline,digest  from cmsjzy.cmsjzy_thread where digest!=0 and fid=版块ID order by tid desc limit 10",10,24,0}]
<li><a href="http://www.cmsjzy.cn /thread-<?=$bqr[tid]?>-1-1.html" title="<?=$bqr[subject]?>" target="_blank"><?=esub($bqr[subject],30)?></a></li>
[/e:loop]


调用指定版块热门帖,如调用版块ID为40的回复数超过20的帖:
[e:loop={"select tid,subject,dateline,replies  from cmsjzy.cmsjzy_thread where replies>=20 and fid=40 order by tid desc limit 10",10,24,0}]
<li><a href="http://www.cmsjzy.cn /thread-<?=$bqr[tid]?>-1-1.html" title="<?=$bqr[subject]?>" target="_blank"><?=esub($bqr[subject],30)?></a></li>
[/e:loop]

热门问题

©2017 易仿帝国yfdiguo.com


友情链接: 阿里云优惠网| 阿里云推荐码| 阿里云教程| 莫愁博客|
♥ www.yfdiguo.com
联系作者QQ: