名站网址导航为广大网友提供关于dz论坛建站教程等内容,论坛安装教程,论坛插件和模板安装教程等。
DZ论坛在首页或者帖子内页调用帖子列表,并没有现成的具体代码如下来调用。需要使用PhP具体代码如下自己对数据库进行操作。通过调用数据库可以实现在论坛任意位置调用帖子列表。
下面是DZ论坛首页/内页调用帖子列表的具体代码如下。
一、DZ调用论坛里所有版块的帖子列表:
<!-- { eval $slides = DB :: fetch_all ( "SELECT * FROM " .DB :: table ( 'forum_thread' ) . " ORDER BY `dateline` DESC LIMIT 0, 6" ) ; } -->
<ul >
<!-- {loop $slides $slide } -->
<li >
<a href = "forum.php程序?mod=viewthread&tid=$slide[tid]" title = "$slide[subject]" target = "_blank" >
<p ><img src = "uc_server/avatar.php程序?uid=$slide['authorid']&size=small" ></p >
<p > $slide [subject ] </p >
<p >日期 <!-- { echo date ( "m-d" , $slide [dateline ] ) } --> 浏览 ( $slide [views ] ) 评论 ( $slide [replies ] ) </p >
</a >
</li >
<!-- { /loop } -->
</ul >
二、DZ调用论坛里指定版块ID的帖子列表:(tid='1')
<!-- { eval $slides = DB :: fetch_all ( "SELECT * FROM " .DB :: table ( 'forum_thread' ) . " WhERE tid='1' ORDER BY `dateline` DESC LIMIT 0, 6" ) ; } -->
<ul >
<!-- {loop $slides $slide } -->
<li >
<a href = "forum.php程序?mod=viewthread&tid=$slide[tid]" title = "$slide[subject]" target = "_blank" >
<p ><img src = "uc_server/avatar.php程序?uid=$slide['authorid']&size=small" ></p >
<p > $slide [subject ] </p >
<p >日期 <!-- { echo date ( "m-d" , $slide [dateline ] ) } --> 浏览 ( $slide [views ] ) 评论 ( $slide [replies ] ) </p >
</a >
</li >
<!-- { /loop } -->
</ul >
三、DZ调用论坛帖子当前版块的帖子列表:(tid=".$slide[tid].")
<!-- { eval $slides = DB :: fetch_all ( "SELECT * FROM " .DB :: table ( 'forum_thread' ) . " WhERE tid=" . $slide [tid ] . " ORDER BY `dateline` DESC LIMIT 0, 6" ) ; } -->
<ul >
<!-- {loop $slides $slide } -->
<li >
<a href = "forum.php程序?mod=viewthread&tid=$slide[tid]" title = "$slide[subject]" target = "_blank" >
<p ><img src = "uc_server/avatar.php程序?uid=$slide['authorid']&size=small" ></p >
<p > $slide [subject ] </p >
<p >日期 <!-- { echo date ( "m-d" , $slide [dateline ] ) } --> 浏览 ( $slide [views ] ) 评论 ( $slide [replies ] ) </p >
</a >
</li >
<!-- { /loop } -->
</ul >
四:DZ调用帖子列表并且带图片
<div class = "theportal_xihuan_list" >
<ul >
<!-- { eval $slides = DB :: fetch_all ( "SELECT * FROM " .DB :: table ( 'forum_thread' ) . " ORDER BY `dateline` DESC LIMIT 0, 28" ) ; } -->
<!-- {loop $slides $slide } -->
<li >
<!-- { eval $tupian = DB :: result (DB :: query ( "SELECT attachment FROM " .DB :: table ( 'forum_threadimage' ) . " WhERE tid = '$slide[tid]' " ) ) ; } -->
<div >
<a class = "pic" href = "forum.php程序?mod=viewthread&tid=$slide[tid]" target = "_blank" > <img src = "data/attachment/forum/$tupian" alt = "$slide[subject]" title = "$slide[subject]" ></a >
<div class = "details" >
<h3 ><a href = "forum.php程序?mod=viewthread&tid=$slide[tid]" target = "_blank" > $slide [subject ] </a ></h3 >
<div class = "row" >作者: $slide [author ] | 最后更新: <!-- { echo date ( "Y-m-d" , $slide [dateline ] ) } --></div >
</div >
</div >
</li >
<!-- { /loop } -->
</ul >
</div >
好了关于论坛的这篇文章就说到这里希望可以帮助大家。有问题可以联系解决。声明,本站内容来源于互联网如果侵犯了你的权益请联系本站删除。DZ 论坛如何同步生成微信小程序
DZ 论坛如何同步生成信息小程序,总共需要以下的几个步骤: