合云吧»论坛 程序代码 代码更新 页面代码解析 【discuzx2】forumdisplay_subform.htm模板文件深入分析
返回列表 发新帖
查看: 619|回复: 0

【discuzx2】forumdisplay_subform.htm模板文件深入分析

[复制链接]

267

主题

-3

回帖

1640

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
1640
发表于 2022-4-3 22:54:49 | 显示全部楼层 |阅读模式


  1. <div class="bm bmw fl{if $_G['forum']['forumcolumns']} flg{/if}">
  2.         <div class="bm_h cl">
  3.                 <span class="o"><img id="subforum_{$_G[forum][fid]}_img" src="{IMGDIR}/$collapseimg[subforum]" title="{lang spread}" alt="{lang spread}" οnclick="toggle_collapse('subforum_$_G['forum'][fid]');" /></span>
  4.                 <h2>{lang forum_subforums}</h2>
  5.         </div>
  6.         <div id="subforum_{$_G[forum][fid]}" class="bm_c" style="$collapse[subforum]">
  7.                 <table cellspacing="0" cellpadding="0" class="fl_tb">
  8.                         <tr>
  9.                         <!--{loop $sublist $sub}-->
  10.                         <!--{eval $forumurl = !empty($sub['domain']) && !empty($_G['setting']['domain']['root']['forum']) ? 'http://'.$sub['domain'].'.'.$_G['setting']['domain']['root']['forum'] : 'forum.php?mod=forumdisplay&fid='.$sub['fid'];}-->
  11.                         <!--{if $_G['forum']['forumcolumns']}-->
  12.                                 <!--{if $sub['orderid'] && ($sub['orderid'] % $_G['forum']['forumcolumns'] == 0)}-->
  13.                                         </tr>
  14.                                         <!--{if $_G['forum']['orderid'] < $_G['forum']['forumcolumns']}-->
  15.                                                 <tr class="fl_row">
  16.                                         <!--{/if}-->
  17.                                 <!--{/if}-->
  18.                                 <!-- 默认显示的都是 "fl_g" -->
  19.                                 <td class="fl_g" width="$_G[forum][forumcolwidth]">
  20.                                         <!-- 子版块图标 -->
  21.                                         <div class="fl_icn_g"{if !empty($sub[extra][iconwidth]) && !empty($sub[icon])} style="width: {$sub[extra][iconwidth]}px;"{/if}>
  22.                                         <!--{if $sub[icon]}-->
  23.                                                 $sub[icon]
  24.                                         <!--{else}-->
  25.                                                 <a href="$forumurl"{if $sub[redirect]} target="_blank"{/if}><img src="{IMGDIR}/forum{if $sub[folder]}_new{/if}.gif" alt="$sub[name]" /></a>
  26.                                         <!--{/if}-->
  27.                                         </div>
  28.                                         <dl{if !empty($sub[extra][iconwidth]) && !empty($sub[icon])} style="margin-left: {$sub[extra][iconwidth]}px;"{/if}>
  29.                                                 <!-- 子版块名称 -->
  30.                                                 <dt><a href="$forumurl" {if !empty($sub[redirect])}target="_blank"{/if} style="{if !empty($sub[extra][namecolor])}color: {$sub[extra][namecolor]};{/if}">$sub[name]</a><!--{if $sub[todayposts] && !$sub['redirect']}--><em class="xw0 xi1" title="{lang forum_todayposts}"> ($sub[todayposts])</em><!--{/if}--></dt>
  31.                                                 <!-- 主题、帖数 -->
  32.                                                 <!--{if empty($sub[redirect])}--><dd><em>{lang forum_threads}: <!--{echo dnumber($sub[threads])}--></em>, <em>{lang forum_posts}: <!--{echo dnumber($sub[posts])}--></em></dd><!--{/if}-->
  33.                                                 <dd>
  34.                                                 <!--{if $sub['permission'] == 1}-->
  35.                                                         {lang private_forum}
  36.                                                 <!--{else}-->
  37.                                                         <!--{if $sub['redirect']}-->
  38.                                                                 <a href="$forumurl" class="xi2">{lang url_link}</a>
  39.                                                         <!--{elseif is_array($sub['lastpost'])}-->
  40.                                                                 <!--{if $_G['forum']['forumcolumns'] < 3}-->
  41.                                                                         <a href="forum.php?mod=redirect&tid=$sub[lastpost][tid]&goto=lastpost#lastpost" class="xi2"><!--{echo cutstr($sub[lastpost][subject], 30)}--></a> <cite>$sub[lastpost][dateline] <!--{if $sub['lastpost']['author']}-->$sub['lastpost']['author']<!--{else}-->$_G[setting][anonymoustext]<!--{/if}--></cite>
  42.                                                                 <!--{else}-->
  43.                                                                         <a href="forum.php?mod=redirect&tid=$sub[lastpost][tid]&goto=lastpost#lastpost">{lang forum_lastpost}: $sub[lastpost][dateline]</a>
  44.                                                                 <!--{/if}-->
  45.                                                         <!--{else}-->
  46.                                                                 {lang never}
  47.                                                         <!--{/if}-->
  48.                                                 <!--{/if}-->
  49.                                                 <!--{hook/forumdisplay_subforum_extra $sub[fid]}-->
  50.                                                 </dd>
  51.                                         </dl>
  52.                                 </td>
  53.                         <!--{else}--><!-- 默认情况下执行上面的if代码段 -->
  54.                                 <td class="fl_icn" {if !empty($sub[extra][iconwidth]) && !empty($sub[icon])} style="width: {$sub[extra][iconwidth]}px;"{/if}>
  55.                                         <!--{if $sub[icon]}-->
  56.                                                 $sub[icon]
  57.                                         <!--{else}-->
  58.                                                 <a href="$forumurl"{if $sub[redirect]} target="_blank"{/if}><img src="{IMGDIR}/forum{if $sub[folder]}_new{/if}.gif" alt="$sub[name]" /></a>
  59.                                         <!--{/if}-->
  60.                                 </td>
  61.                                 <td>
  62.                                         <h2><a href="$forumurl" {if !empty($sub[redirect])}target="_blank"{/if} style="{if !empty($sub[extra][namecolor])}color: {$sub[extra][namecolor]};{/if}">$sub[name]</a><!--{if $sub[todayposts] && !$sub['redirect']}--><em class="xw0 xi1" title="{lang forum_todayposts}"> ($sub[todayposts])</em><!--{/if}--></h2>
  63.                                         <!--{if $sub[description]}--><p class="xg2">$sub[description]</p><!--{/if}-->
  64.                                         <!--{if $sub['subforums']}--><p>{lang forum_subforums}: $sub['subforums']</p><!--{/if}-->
  65.                                         <!--{if $sub['moderators']}--><p>{lang forum_moderators}: $sub[moderators]</p><!--{/if}-->
  66.                                         <!--{hook/forumdisplay_subforum_extra $sub[fid]}-->
  67.                                 </td>
  68.                                 <td class="fl_i">
  69.                                         <!--{if empty($sub[redirect])}--><span class="xi2"><!--{echo dnumber($sub[threads])}--></span><span class="xg1"> / <!--{echo dnumber($sub[posts])}--></span><!--{/if}-->
  70.                                 </td>
  71.                                 <td class="fl_by">
  72.                                         <div>
  73.                                         <!--{if $sub['permission'] == 1}-->
  74.                                                 {lang private_forum}
  75.                                         <!--{else}-->
  76.                                                 <!--{if $sub['redirect']}-->
  77.                                                         <a href="$forumurl" class="xi2">{lang url_link}</a>
  78.                                                 <!--{elseif is_array($sub['lastpost'])}-->
  79.                                                         <a href="forum.php?mod=redirect&tid=$sub[lastpost][tid]&goto=lastpost#lastpost" class="xi2"><!--{echo cutstr($sub[lastpost][subject], 30)}--></a> <cite>$sub[lastpost][dateline] <!--{if $sub['lastpost']['author']}-->$sub['lastpost']['author']<!--{else}-->$_G[setting][anonymoustext]<!--{/if}--></cite>
  80.                                                 <!--{else}-->
  81.                                                         {lang never}
  82.                                                 <!--{/if}-->
  83.                                         <!--{/if}-->
  84.                                         </div>
  85.                                 </td>
  86.                         </tr>
  87.                         <tr class="fl_row">
  88.                         <!--{/if}-->
  89.                         <!--{/loop}-->
  90.                         $_G['forum']['endrows']
  91.                         </tr>
  92.                 </table>
  93.         </div>
  94. </div>
复制代码



回复

使用道具 举报

返回列表 发新帖
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

CopyRight 2018-2019 河南合云网络科技有限公司 版权所有 豫ICP备19004330号-1营业执照
快速回复 返回列表