PHPCMS V9挪用Discuz X2.5指定版块帖子

挪用论坛指定版块帖子或回覆:{pc:get sql="SELECT * FROM discuzx.pre_forum_post where first=1 and fid=62 order by tid desc" num="1" cache="" return="data"}
{loop $data $key $val}
<dt><a href=http://down.chinaz.com/"http:/论坛网址/thread-{$val[tid]}-1-1.html"><strong> {str_cut($val[subject],60,'')}</strong></a></dt>
<dd>
<p>{str_cut($val[message],168,'')}…</p>
</dd>
{/loop}
{/pc}

  表明:first=1 就是帖子的1楼,假如=0 就是挪用回覆。message 截取168字符。fid=62 是论坛版块号

  结果如下:

PHPCMS V9调用Discuz X2.5指定版块帖子

挪用论坛最新帖子 并显示版块名称:

{pc:get sql="SELECT a.*,b.* FROM discuzx.pre_forum_thread as a left join discuzx.pre_forum_forum as b on a.fid=b.fid order by tid desc" num="4" cache="" return="data"}
{loop $data $key $val}
<li><a id="lanmu" href=http://down.chinaz.com/"http:/论坛网址/forum-{$val[fid]}-1.html">[{$val[name]}]</a>& amp; lt;a href=http://down.chinaz.com/"http:/论坛网址/thread-{$val[tid]}-1-1.html"> {str_cut($val[subject],60,'')}</a></li>
{/loop}
{/pc}

  结果:

  按积分排行挪用论坛用户头像和名称,也可以将 credits改成regdate,就是最新注册插手的会员{pc:get sql="SELECT * FROM discuzx.pre_common_member order by credits desc" num="10" cache="" return="data"}
{loop $data $key $val}
<span>
<a href=http://down.chinaz.com/"http:/论坛网址/space-uid-{$val[uid]}.html"><img alt="{$val[username]}" src=http://down.chinaz.com/"http:/论坛网址/uc_server/avatar.php?uid={$val[uid]}&size=small" /></a>
<a href=http://down.chinaz.com/"http:/论坛网址/space-uid-{$val[uid]}.html">{str_cut($val[username],9,'')}</a>
</span>
{/loop}
{/pc}

PHPCMS V9调用Discuz X2.5指定版块帖子

热门版块排行{pc:get sql="SELECT * FROM discuzx.pre_forum_forum order by threads desc" num="10" cache="" return="data"}
{loop $data $key $val}
<li><span><a href=http://down.chinaz.com/"http:/论坛网址/forum-{$val[fid]}-1.html">{$val[name]}</a>& amp; lt;/span> <span><!--<span class="fatieshu">{$val[threads]}</span>主题 -->共<span class="fatieshu">{$val[posts]}</span>帖 今<span class="fatieshu">{$val[todayposts]}</span>帖</span>< /li>
{/loop}
{/pc}

PHPCMS V9调用Discuz X2.5指定版块帖子

最热帖{pc:get sql="SELECT * FROM discuzx.pre_forum_thread order by views desc" num="6" cache="" return="data"}
{loop $data $key $val}
<li><a href=http://down.chinaz.com/"http:/论坛网址/thread-{$val[tid]}-1-1.html">{str_cut($val[subject],54,'')}</a></li>
{/loop}
{/pc}

PHPCMS V9调用Discuz X2.5指定版块帖子

最新帖{pc:get sql="SELECT * FROM discuzx.pre_forum_thread order by tid desc" num="6" cache="" return="data"}
{loop $data $key $val}
<li><a href=http://down.chinaz.com/"http:/论坛网址/thread-{$val[tid]}-1-1.html">{str_cut($val[subject],54,'')}</a></li>
{/loop}
{/pc}

PHPCMS v9.6.0 GBK下载

PHPCMS V9调用Discuz X2.5指定版块帖子

界面预览

  原文地点:

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:http://www.heiqu.com/9956.html