dede調用DZ論壇帖子及特定板塊帖子的調用方法
論壇最新主題:
調特定板塊的主題:
{dede:loop table="cdb_threads" sort="tid" row="10″} <a href="/dz/viewthread.php?tid=[field:tid /]"> ·[field:subject function="cn_substr('@me',30)" /]([field:lastpost function="date('m-d H:M','@me')" /]) </a> <br/> {/dede:loop}
{dede:loop table="cdb_threads" if="fid=5 and displayorder!=-1″ sort="tid" row="10″} <a href="/dz/viewthread.php?tid=[field:tid /]"> ·[field:subject function="cn_substr('@me',30)" /]([field:lastpost function="date('m-d H:M','@me')" /])</a> {/dede:loop}
顯示精華帖:
{dede:loop table="cdb_threads" if="fid=5 AND digest>0 and displayorder!=-1 " sort="tid" row="10″} <a href="/dz/viewthread.php?tid=[field:tid /]"> ·[field:subject function="cn_substr('@me',30)" /]([field:lastpost function="date('m-d H:M','@me')" /])</a> {/dede:loop}
論壇之星/活躍會員:
{dede:loop table="cdb_members" sort="posts" row="3″} <LI> <A href="/bbs/space.php?uid=[field:uid /]"><IMG src="/bbs/uc_server/avatar.php?uid=[field:uid /]&size=middle"></A> <A href="/bbs/space.php?uid=[field:uid /]">[field:username/]</A> <BR>貼子:[field:posts/] <BR>加入:[field:regdate function="GetDateMK(@me)"/] </LI> {/dede:loop}
/bbs/space.php?uid=[field:uid /] 個人信息地址 /bbs/uc_server/avatar.php?uid=[field:uid /]&size=middle 論壇頭像 /home/space.php?uid=[field:uid /] UCHOME的個人空間地址
調用貼子:
{dede:loop table="cdb_threads" if='digest>0′ sort="tid" row="10″} <LI><A href="/bbs/viewthread.php?tid=[field:tid /]">[field:subject function="cn_substr('@me',30)" /]</A> {/dede:loop}
if="" 條件
示例1:調用版塊ID為4的貼子:
if="fid=4″ 調用指定版塊的貼子
示例2:調用版塊ID為4的精華貼子
if="fid=4 AND digest>0″
示例3:調用回復超過20貼的貼子
if="fid=4 AND replies>20″
調用附件帶圖片的貼子
{dede:sql sql="SELECT` cdb_attachments`.`aid`, `cdb_attachments`.`attachment`,`cdb_threads`.`tid`, `cdb_threads`.`fid`, `cdb_threads`.`subject` FROM `cdb_attachments` LEFT JOIN `cdb_threads` ON `cdb_threads`.`tid`=`cdb_attachments`.`tid` WHERE `cdb_attachments`.`readperm`='0′ AND `displayorder`>='0′ AND `filetype`='image/pjpeg' GROUP BY tid LIMIT 0,2″} <li><A href="/bbs/viewthread.php?tid=[field:tid /]"><IMG src="/bbs/attachments/[field:attachment/]"></A></li> <li><A href="/bbs/viewthread.php?tid=[field:tid /]">[field:subject function="cn_substr('@me',30)" /]</A></li> {/dede:sql}
新聞熱點
疑難解答