演示链接:查看演示

dedecms利用loop标签调用Discuz论坛论坛中的内容

我想在dedecmsCMSdedecms首页调用特定栏目的精华帖,但是JS太慢,想生成HTML。

我现在是这样调最新帖的,请问怎么调某个板块的精华帖?

论坛最新主题:<br/>

{dede:loop table="cdb_threads" sort="tid" row="10"}

<a href="/dz/viewthread.php?tid=[field:tid /]">

·[field:subject function="cn_substr('@me',30)" /]([field:lastpost function="date('m-d H:M','@me')" /])

</a>

<br/>

{/dede:loop}

刚刚试了下,这样可以调特定板块的主题,现在就想问,怎么调精华主题?

论坛最新主题:<br/>

{dede:loop table="cdb_threads" if="fid=5 and displayorder!=-1" sort="tid" row="10"}

<a href="/dz/viewthread.php?tid=[field:tid /]">

·[field:subject function="cn_substr('@me',30)" /]([field:lastpost function="date('m-d H:M','@me')" /])

</a>

<br/>

{/dede:loop}

再次发现,这样可以显示精华帖。

论坛最新主题:<br/>

{dede:loop table="cdb_threads" if="fid=5 AND digest>0 and displayorder!=-1 " sort="tid" row="10"}

<a href="/dz/viewthread.php?tid=[field:tid /]">

·[field:subject function="cn_substr('@me',30)" /]([field:lastpost function="date('m-d H:M','@me')" /])

</a>

<br/>

{/dede:loop}

这样又可以按查看次数排序:

论坛最新主题:<br/>

{dede:loop table="cdb_threads" if="fid=5 and displayorder!=-1" sort="views" row="10"}

<a href="/dz/viewthread.php?tid=[field:tid /]">

·[field:subject function="cn_substr('@me',30)" /]([field:lastpost function="date('m-d H:M','@me')" /])

</a>

<br/>

{/dede:loop}
 

THE END
喜欢就支持一下吧
点赞0 分享