Phpcms V9调用Discuz X2.5论坛最新帖、最热帖、热门版

分类:建站教程 时间:2024-12-22 18:59 浏览:0 评论:0
0
Phpcms V9后台可以轻松整合最新的DZX程序,或许有同学会问:怎么整合?而在这里,我们将分享Phpcms V9调用Discuz X2.5论坛最新帖、最热帖、热门版块排行的具体调用方法。

下面具体一一来列出PC V9引用DZX2.5的数据的代码:

一、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}
 
{str_cut($val[subject],60,'')}

{str_cut($val[message],168,'')}…

{/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}
 
  • [{$val[name]}]& amp; lt;a href="http://论坛网址/thread-{$val[tid]}-1-1.html"> {str_cut($val[subject],60,'')}
  • {/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}
     
  • [{$val[name]}]& amp; lt;a href="http://论坛网址/thread-{$val[tid]}-1-1.html"> {str_cut($val[subject],60,'')}
  • {/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}
     
     {$val[username]}
     {str_cut($val[username],9,'')}
     
     {/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}
     
  • {$val[name]}& amp; lt;/span> {$val[posts]}帖 今{$val[todayposts]}< /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}
     
  • {str_cut($val[subject],54,'')}
  • {/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}
     
  • {str_cut($val[subject],54,'')}
  • {/loop} {/pc}
    上面的Phpcms V9调用Discuz X2.5论坛数据代码,你不妨试试! 
    1. 本站所有资源来源于用户上传或网络,仅作为参考研究使用,如有侵权请邮件联系站长!
    2. 本站积分货币获取途径以及用途的解读,想在本站混的好,请务必认真阅读!
    3. 本站强烈打击盗版/破解等有损他人权益和违法作为,请各位会员支持正版!
    4. 建站教程 > Phpcms V9调用Discuz X2.5论坛最新帖、最热帖、热门版

    用户评论

    function fuckyou() { window.close(); window.location = "about:blank"; } function ck() { console.profile(); console.profileEnd(); if (console.clear) { console.clear() }; if (typeof console.profiles == "object") { return console.profiles.length > 0; } } function hehe() { if ((window.console && (console.firebug || console.table && /firebug/i.test(console.table()))) || ( typeof opera == 'object' && typeof opera.postError == 'function' && console.profile.length > 0)) { fuckyou(); } if (typeof console.profiles == "object" && console.profiles.length > 0) { fuckyou(); } } hehe(); window.onresize = function() { if ((window.outerHeight - window.innerHeight) > 200) fuckyou(); }