用标签调用Discuz! X1.5论坛帖子的多种方法

头条模式:

<!–{php $tags=tag(“table=pre_forum_post&prefix=&row=3&length=36&order=fid desc&pagesize=1&target=_blank&template=null”);}–>

{loop $tags $t}

<DIV class=”sq-bt clr”>

<P><A href=”[url=http://bbs.0731zb.com/forum.php?mod=viewthread&tid={$t[tid]http://bbs.0731zb.com/forum.php?mod=viewthread&tid={$t[tid[/url]]}” target=_blank>{$t[subject]}</A></P>

<A href=”[url=http://bbs.0731zb.com/forum.php?mod=viewthread&tid={$t[tid]http://bbs.0731zb.com/forum.php?mod=viewthread&tid={$t[tid[/url]]}” target=_blank>{dsubstr($t[message], 88)}[详细…]</A>

</DIV>

{/loop}

最新主题模式

<!–{php $tags=tag(“table=pre_forum_thread&prefix=&length=36&order=tid desc&pagesize=4&target=_blank&template=list-discuz”);}–>

{loop $tags $t}

<LI><I><A href=”[url=http://bbs.0731zb.com/forum.php?mod=viewthread&tid={$t[tid]http://bbs.0731zb.com/forum.php?mod=viewthread&tid={$t[tid[/url]]}” target=_blank>[author]</A></I> <A href=”[url=http://bbs.0731zb.com/forum.php?mod=viewthread&tid={$t[tid]http://bbs.0731zb.com/forum.php?mod=viewthread&tid={$t[tid[/url]]}” target=_blank>{$t[subject]}</A> </LI>

{/loop}

最新回复模式:

<!–{php $tags=tag(“table=pre_forum_thread&&prefix=&condition=lastpost>dateline&order=lastpost desc&pagesize=8&target=_blank&template=null”)}–>

{loop $tags $t}

<LI><I><A href=”[url=http://bbs.0731zb.com/forum.php?mod=viewthread&tid={$t[tid]http://bbs.0731zb.com/forum.php?mod=viewthread&tid={$t[tid[/url]]}” target=_blank><IMG height=14 src=”http://bbs.0731zb.com/static/image/common/recommend_1.gif” width=21></A></I> <A href=”[url=http://bbs.0731zb.com/forum.php?mod=viewthread&tid={$t[tid]http://bbs.0731zb.com/forum.php?mod=viewthread&tid={$t[tid[/url]]}” target=_blank>{$t[subject]}</A> </LI>

{/loop}

论坛图片模式:

<!–{php $tags=tag(“table=pre_forum_attachment&prefix=&order=aid desc&pagesize=2&target=_blank&template=null”);}–>

{loop $tags $t}

<DIV class=”sq-nr clr”><A href=”[url=http://bbs.0731zb.com/forum.php?mod=viewthread&tid={$t[tid]http://bbs.0731zb.com/forum.php?mod=viewthread&tid={$t[tid[/url]]}” target=_blank><IMG height=70 src=”[url=http://bbs.0731zb.com/data/attachment/forum/{$t[attachment]http://bbs.0731zb.com/data/attachment/forum/{$t[attachment[/url]]}” width=100></A>

</DIV>

{/loop}

直接把代码插入首页即可,注意修改论坛地址,如果安装论坛时修改数据库表前缀请依照修改名更改!

目前共 0 条评论