在destoon開發中有時候我們需要調用論壇的帖子,但是帶有圖片的帖子該怎麼調用出來呢,本文就來實例展示一個可以調用discuz論壇帶圖片的帖子的方法:
標簽代碼如下:
<!--{php $tags=tag("table=pre_forum_thread i,pre_forum_threadimage t&prefix=&condition=i.tid=t.tid&length=36&order=i.tid desc&pagesize=9&target=_blank&template=null");}--> {loop $tags $t} <A href="bbs/forum.php?mod=viewthread&tid={$t[tid]}" rel="external nofollow" rel="external nofollow" rel="external nofollow" target=_blank>{$t[subject]}</A> <br /> <A href="bbs/forum.php?mod=viewthread&tid={$t[tid]}" rel="external nofollow" rel="external nofollow" rel="external nofollow" target=_blank><img src="bbs/data/attachment/forum/{$t[attachment]}" width="50" height="50" /></A> {/loop}
調用論壇新帖子的方法如下:
<!--{php $tags=tag("table=pre_forum_thread&prefix=&length=36&order=tid desc&pagesize=9&target=_blank&template=null");}--> {loop $tags $t} <A href="bbs/forum.php?mod=viewthread&tid={$t[tid]}" rel="external nofollow" rel="external nofollow" rel="external nofollow" target=_blank>{$t[subject]}</A> {/loop}
希望本文所述方法對大家destoon開發有所幫助。