云水论坛

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 3699|回复: 2
打印 上一主题 下一主题

[转帖]discuz的htm模板代码分析

[复制链接]

1788

主题

62

好友

8525

积分

管理员

Rank: 9Rank: 9Rank: 9

跳转到指定楼层
楼主
发表于 2011-2-7 14:49:10 |只看该作者 |倒序浏览
 {template header}
<!--/* 系统调用完header.htm头文件后,Discuz首页中间内容开始输出 */-->
<div style="width: {TABLEWIDTH}; clear: both; overflow: hidden;">
  <!--/* Discuz首页左上角个人信息开始*/-->
<div class="left" style="line-height: 18px;">
<span class="bold">
  <!--/* 在gid页面(以index.php?gid=xxx形式进入的页面)时,判断是否是会员,
如果只是游客(条件:$gid || !$discuz_uid),则输出:$bbname和个人空间相应的链接,否则输出:
用户名($discuz_user)
在这里,我们用可以用$gid来控制gid论坛指定列表的页面输出了。。*/-->
<!--{if $gid || !$discuz_uid}-->
<a href="$indexname">$bbname</a>
<!--{else}-->
<!--{if $supe['status']}--><a href="$supe[siteurl]" target="_blank">$supe['sitename']</a> -
<!--{/if}-->
$discuz_user
  <!--{/if}-->

<!--{if $discuz_uid}-->
<!--/*如果是注册会员,*/-->
 
<!--{if $spacestatus || $supe['status']}-->
<!--/*如果$spacestatus 和 $supe['status']两个条件(个人信息显示和是否安装SS)有其中一个成立,则输出“个人空间”的链接*/-->
  - <a href="space.php?uid=$discuz_uid" target="_blank">{lang space}</a>
<!--{/if}-->

<!--{if $supe['status'] && !$xspacestatus}-->
<!--/*如果已经安装SS或者X-SPACE程序*/-->
   <!--{if $spacestatus}-->
  <!--/*如果已经开通个人空间,则输出“升级个人空间”、否则输出“开通个人空间”的链接*/-->
   - <a href="$supe[siteurl]/index.php?action/register" target="_blank">{lang space_upgrade_space}</a>
  <!--{else}-->
   - <a href="$supe[siteurl]/index.php?action/register" target="_blank">{lang supe_signin_xspace}</a>
  <!--{/if}-->
  <!--{/if}-->
<!--{/if}-->
</span>

<br>
{lang credits}: <span class="bold smalltxt">$credits</span> <span id="creditlist">{lang credits_detail}<script type="text/javascript">menuregister(false, "creditlist", true)</script></span> / {lang index_status}:
<!--{if $validdays}-->
<!--/*如果用户组有日期限制的,输出的用户组后面带有相应的日期,否则直接输出用户组名称*/-->
<a href="member.php?action=groupexpiry"><span class="bold">$grouptitle</span>($validdays)</a>
<!--{else}-->
<span class="bold">$grouptitle</span>
<!--{/if}-->
<!--{if $allowinvisible && $discuz_uid}-->
<!--/*如果当前会员为注册会员,并且拥有隐身的权限,则输出详细的在线状态:在线模式、隐身模式,并带上两个状态切换的链接*/-->
{lang online_status}:
<!--{if !empty($invisible)}-->
  <a href="member.php?action=switchstatus" title="{lang login_switch_normal_mode}">{lang login_invisible_mode}</a>
<!--{else}-->
  <a href="member.php?action=switchstatus" title="{lang login_switch_invisible_mode}">{lang login_normal_mode}</a>
<!--{/if}-->
<!--{/if}-->
<br>
{lang your_lastvisit} <span class="smalltxt">$lastvisittime</span><br>
</div>
<!--/* Discuz首页左上角个人信息结束 */-->
  <!--/* Discuz首页右上角论坛基本信息开始 */-->
<div class="right" style="line-height: 18px;">
<a href="search.php?srchfrom=$newthreads&searchsubmit=yes">{lang show_newthreads}</a> |
<a href="digest.php">{lang digest}</a> |
<a href="member.php?action=markread">{lang mark_read}</a>
<!--{if $rssstatus}--><a href="rss.php?auth=$rssauth" target="_blank"><img src="images/common/xml.gif" border="0" class="absmiddle" alt="{lang rss_subscribe_all}" /></a><!--{/if}-->
<br>
{lang total} <span class="smalltxt">$threads</span> {lang index_threads} / <span class="smalltxt">$posts</span> {lang index_posts} / {lang index_today} <span class="smalltxt">$todayposts</span> {lang index_posts}<br>
{lang total} <span class="smalltxt">$totalmembers</span> {lang index_members} / {lang welcome_newmember} <a href="space.php?username=$memberenc"><span class="bold">$lastmember</span></a>
</div>
</div><br>
<!--/* Discuz首页右上角论坛基本信息结束 */-->
  <!--/* Discuz首页公告、Qihoo搜索模块开始*/-->
<!--{if empty($gid)}-->
<!--/*没有在没有接到URL传递到的$gid值的条件下(也就是在非指定论坛列表的页面下),输出公告和Qihoo搜索的内容 */-->
  <!--{if !empty($announcements)}-->
<!--/*如果公告变量$announcements非为空,则输出公告内容,并用javascript控制其滚动 */-->
  <div id="announcement">$announcements</div><script type="text/javascript">announcement();</script>
<!--{/if}-->
  <!--/* Discuz首页Qihoo搜索模块开始*/-->
<!--{if !empty($qihoo_status) && $searchboxstatus}-->
  <div class="subtable" style="clear: both; width: {TABLEWIDTH}">
  <div class="right">
  <form method="post" action="search.php?srchtype=qihoo" >
  <input type="hidden" name="searchsubmit" value="yes">
  <input type="text" name="srchtxt" value="$qihoo_searchboxtxt" size="30" class="input" style="{BGCODE};" >
  <select name="stype"><option value="" selected>{lang qihoo_search_filltext}</option><option value="1">{lang qihoo_search_title}</option><option value="2">{lang qihoo_search_author}</option></select>
  <input name="searchsubmit" class="button" type="submit" value="{lang search}">
  </form>
  </div>
  <!--{if $qihoo_links['keywords']}-->
   <span class="bold">{lang qihoo_hot_searches}</span>
   <!--{loop $qihoo_links['keywords'] $link}-->
    $link
   <!--{/loop}-->
  <!--{/if}-->
  </div>
  <div class="subtable" style="clear: both; width: {TABLEWIDTH}">
  <div class="right">
  <!--{if $customtopics}-->
   <span class="bold">{lang qihoo_custom_topics}</span>  $customtopics [<a href="###" >{lang edit}</a>]
  <!--{/if}-->
  </div>
  <!--{if $qihoo_links['topics']}-->
   <span class="bold">{lang qihoo_topics}</span>
   <!--{loop $qihoo_links['topics'] $url}-->
    {$url}  
   <!--{/loop}-->
  <!--{/if}-->
  </div>
<!--{/if}-->
  <!--/* Discuz首页Qihoo搜索模块结束*/-->
<!--{/if}-->
<!--/* Discuz首页公告、Qihoo搜索模块模块结束*/-->
  <!--/* Discuz首页信息提示模块开始*/-->
<!--{if !empty($newpmexists) || $announcepm}-->
<!--/*用户短信息数组为非空,或者公共消息(后台统一发送)数组非空,则调用pmprompt.htm模板,实现首页的短信提示*/-->
<div style="clear: both; margin-top: 5px">
{template pmprompt}
</div>
<!--{/if}-->
<!--/* Discuz首页信息提示模块结束*/-->
  <!--/* Discuz首页广告模块开始*/-->
<!--{if !empty($advlist['text'])}-->
<!--/*如果广告类型为:text的数组为非空,则输出面页广告*/-->
<div style="clear: both; margin-top: 5px;">
<div class="spaceborder" style="width: {TABLEWIDTH}">
<table cellspacing="1" border="0" cellpadding="{TABLESPACE}" width="100%" style="background: {BGBORDER}">$advlist[text]</table>
</div><br></div>
<!--{/if}-->
<!--/* Discuz首页广告模块结束*/-->
  <!--/* Discuz首页X-SPACE热点导读模块开始*/-->
<!--{if $supe['status'] && $supe['items']['status'] && $_DCACHE['supe_updateitems']}-->
<div style="clear: both; margin-top: 5px;">
<div class="spaceborder" style="width: {TABLEWIDTH}">
<table cellspacing="0" border="0" cellpadding="{TABLESPACE}" width="100%">
<tr><td colspan="$supe[items][columns]" class="header" style="padding-left:20px">
<div class="subtable" style="padding: 0px"><a href="$supe[siteurl]" target="_blank">{lang supe_updateitems}</a></div>
</td></tr>
<script language="javascript">$_DCACHE['supe_updateitems']</script></table>
</div></div>
<!--{/if}-->
<!--/* Discuz首页X-SPACE热点导读模块结束*/-->
  <!--/* Discuz首页版块列表模块开始*/-->
<!--{loop $catlist $key $cat}-->
<!--{if $cat['forumscount']}-->
  <div class="spaceborder spacebottom" style="width: {TABLEWIDTH}; clear: both; margin-top: 5px;">
   <table cellspacing="{INNERBORDERWIDTH}" cellpadding="{TABLESPACE}" width="100%" align="center">
       <tr>
       <td colspan="<!--{if $cat['forumcolumns']}-->$cat[forumcolumns] <!--{else}-->7 <!--{/if}-->" class="header" style="padding-left:20px">
    <div class="subtable" style="padding: 0px">
   <div class="right">
  <!--{if $cat['moderators']}-->
  <font color="{HEADERTEXT}">{lang forum_category_modedby}: $cat[moderators]</font>
  <!--{/if}-->
  <a href="###" >
  <img id="category_$cat[fid]_img" src="{IMGDIR}/$cat[collapseimg]" border="0" alt="" /></a>
  </div>
   <a href="$indexname?gid=$cat[fid]">$cat[name]</a>
  </div>
     </td>
    </tr>

 
  你的沉默明亮如灯、简单如指环。

  论坛其他名字 【云水.墨】 【淡墨瀑雪】
回复

使用道具 举报

1788

主题

62

好友

8525

积分

管理员

Rank: 9Rank: 9Rank: 9

沙发
发表于 2011-2-7 14:49:51 |只看该作者
  <!--/*在非首页下级论坛横排的情况下,论坛版块列表的输出开始*/-->
  <!--{if !$cat['forumcolumns']}-->
   <tbody id="category_$cat[fid]" style="$collapse['category_'.$cat[fid]]">
   <tr class="category" align="center">
   <td width="5%"> </td>
   <td width="56%" align="left">{lang forum_name}</td>
   <td width="5%">{lang forum_threads}</td>
   <td width="5%">{lang forum_posts}</td>
   <td width="13%">{lang forum_lastpost}</td>
   <td width="16%">{lang forum_moderators}</td>
   </tr>

   <!--{loop $cat[forums] $forumid}-->
    <!--{eval $forum=$forumlist[$forumid];}-->
    <tr class="row"  >
    <td align="center">$forum[folder]</td>
     <td align="left" class="subject">
    $forum[icon]
    <a href="forumdisplay.php?fid=$forum[fid]"><span class="bold">$forum[name]</span></a>
     <!--{if $forum[todayposts]}-->
    <span class="todayposts">($forum[todayposts])</span>
    <!--{/if}-->
     <br><span class="smalltxt">$forum[description]
     <!--{if $forum['subforums']}-->
     <br><span class="bold">{lang forum_subforums}:</span> $forum['subforums']<!--{/if}--></span>
    </td>
     <td align="center">$forum[threads]</td>
    <td align="center">$forum[posts]</td>
     <!--{if $forum['permission'] == 1}-->
     <td align="center"><span class="smalltxt">{lang private_forum}</span></td>
    <!--{else}-->
      <!--{if is_array($forum['lastpost'])}-->
      <td align="center" title="{lang forum_lastpost_in}: {$forum[lastpost][subject]}" nowrap>
      <span class="smalltxt"><a href="redirect.php?tid=$forum[lastpost][tid]&amp;goto=lastpost#lastpost">$forum[lastpost][dateline]</a></span><br>{lang forum_lastpost_by} <!--{if $forum['lastpost']['author']}-->$forum['lastpost']['author']<!--{else}-->{lang anonymous}<!--{/if}-->
      </td>
     <!--{else}-->
      <td align="center"><span class="smalltxt">{lang never}</span></td>
     <!--{/if}-->
    <!--{/if}-->
     <td align="center" style="word-break: keep-all">$forum[moderators]</td></tr>
   <!--{/loop}-->
   <!--/*在非首页下级论坛横排的情况下,论坛版块列表的输出结束*/-->
   <!--{else}-->
   <!--/*在首页下级论坛横排的情况下,论坛版块列表的输出开始*/-->
   <tbody id="category_$cat[fid]" style="$collapse['category_'.$cat[fid]]">
    <tr class="altbg2">
   <!--{loop $cat['forums'] $forumid}-->
    <!--{eval $forum=$forumlist[$forumid];}-->
     <!--{if $forum['orderid'] && ($forum['orderid'] % $cat['forumcolumns'] == 0)}-->
     </tr>
      <!--{if $forum['orderid'] < $cat['forumscount']}-->
      <tr class="altbg2">
     <!--{/if}-->
    <!--{/if}-->
     <td width="$cat[forumcolwidth]" valign="top" class="altbg2"  >
    <table cellspacing="0" cellpadding="0" width="100%">
    <tr>
     <td rowspan="3" align="center" width="15%">$forum[folder]</td>
     <td colspan="3" class="bold subject"><a href="forumdisplay.php?fid=$forum[fid]">$forum[name]</a></td>
    </tr>
    <tr class="smalltxt">
     <td colspan="3">{lang forum_lastpost}:
    <!--{if is_array($forum['lastpost'])}-->
     <a href="redirect.php?tid=$forum[lastpost][tid]&amp;goto=lastpost#lastpost">$forum[lastpost][dateline]</a>
     {lang forum_lastpost_by} <!--{if $forum['lastpost']['author']}-->$forum['lastpost']['author']<!--{else}-->{lang anonymous}<!--{/if}-->
    <!--{else}-->
     {lang never}
    <!--{/if}-->
      </td>
    </tr>
    <tr class="smalltxt">
     <td>{lang forum_threads}: $forum[threads]</td>
     <td>{lang forum_posts}: $forum[posts]</td>
     <td>{lang forum_todayposts}: $forum[todayposts]</td>
    </tr>
    </table>
    </td>
    <!--{/loop}-->
   $cat['endrows']
  <!--{/if}-->
  <!--/*在首页下级论坛横排的情况下,论坛版块列表的输出结束*/-->
   </tbody>
   </table></div>
   <!--/* Discuz广告类型为:分类间广告的广告模块开始,嵌套在gid的LOOP里面,每一个总分类循环一次*/-->
  <!--{if !empty($advlist['intercat'])}-->
  <div style="clear: both; margin-top: 5px;">
   <!--{echo $advlist['intercat'][array_rand($advlist['intercat'])]}--></div>
   <!--{else}--><br>
  <!--{/if}-->
  <!--/* Discuz广告类型为:分类间广告的广告模块结束*/-->
  <!--{/if}-->
<!--{/loop}-->
<!--/* Discuz首页版块列表模块结束*/-->

  你的沉默明亮如灯、简单如指环。

  论坛其他名字 【云水.墨】 【淡墨瀑雪】
回复

使用道具 举报

1788

主题

62

好友

8525

积分

管理员

Rank: 9Rank: 9Rank: 9

板凳
发表于 2011-2-7 14:50:04 |只看该作者
  <!--/* Discuz首页论坛联盟信息、生日信息、在线信息、X-SPACE更新信息模块开始*/-->
<!--{if empty($gid) && ($_DCACHE['forumlinks'] || $whosonlinestatus || $bdaystatus == 1 || $bdaystatus == 3)}-->
<div class="spaceborder" style="width: {TABLEWIDTH}">
  <table cellspacing="{INNERBORDERWIDTH}" cellpadding="{TABLESPACE}" width="100%" align="center">
<!--{if $_DCACHE['forumlinks']}-->
  <tbody>
   <tr>
    <td colspan="3" class="header"><a href="###" ><img id="forumlinks_img" src="{IMGDIR}/$collapseimg[forumlinks]" border="0" align="right" alt="" /></a>
       <span class="bold">{lang board_links}</span>
      </td>
    </tr>
  </tbody>
  <tbody id="forumlinks" style="$collapse[forumlinks]">
  <!--{loop $_DCACHE['forumlinks'] $flink}-->
   <!--{if $flink['type'] == 1}-->
    <tr class="row"  >
    <td width="5%" align="center" valign="middle"><img src="{IMGDIR}/forumlink.gif" alt="" /></td>
    <td width="77%" valign="middle">$flink[content]</td>
    <td width="18%" align="center" valign="middle"><img src="$flink[logo]" border="0" alt="" /></td>
    </tr>
   <!--{elseif $flink['type'] == 2}-->
    <tr class="row"  >
    <td width="5%" align="center" valign="middle"><img src="{IMGDIR}/forumlink.gif" alt="" /></td>
    <td width="95%" colspan="2" valign="middle" style="word-break: keep-all">$flink[content]</td>
    </tr>
   <!--{else}-->
    <tr class="row"  >
    <td width="5%" align="center" valign="middle"><img src="{IMGDIR}/forumlink.gif" alt="" /></td>
    <td width="95%" colspan="2" valign="middle" style="word-break: keep-all">$flink[content]</td>
    </tr>
   <!--{/if}-->
  <!--{/loop}-->
  </tbody>
<!--{/if}-->
  <!--{if $maxbdays}-->
  <tbody>
   <tr>
    <td colspan="3" class="header"><a href="###" ><img id="birthdays_img" src="{IMGDIR}/$collapseimg[birthdays]" align="right" border="0" alt="" /></a>
       <a href="member.php?action=list&amp;type=birthdays">
        <span class="bold">{lang todays_birthdays}</span>
       </a>
      </td>
     </tr>
   </tbody>
  <tbody id="birthdays" style="$collapse[birthdays]">
  <tr class="row"  >
  <td width="5%" align="center" valign="middle"><img src="{IMGDIR}/birthday.gif" alt="" /></td>
  <td width="95%" colspan="2" valign="middle" style="word-break: keep-all">
  <!--{if $_DCACHE['birthdays_index']['todaysbdays']}-->$_DCACHE[birthdays_index][todaysbdays]<!--{else}-->{lang todays_birthdays_none}<!--{/if}-->
  </td></tr>
  </tbody>
<!--{/if}-->
  <!--{if $supe['status'] && $supe['maxupdateusers'] && $_DCACHE['supe_updateusers']}-->
  <tbody>
   <tr>
    <td colspan="3" class="header"><a href="###" ><img id="supe_maxupdateusers_img" src="{IMGDIR}/collapsed_no.gif" align="right" border="0" alt="" /></a>
        <a href="$supe[siteurl]" target="_blank"><span class="bold">{lang supe_updateusers}</span></a>
      </td>
    </tr>
  </tbody>
  <tbody id="supe_maxupdateusers">
  <tr class="row"  >
  <td width="5%" align="center" valign="middle"><img src="{IMGDIR}/supe_updateusers.gif" alt="" /></td>
  <td width="95%" colspan="2" valign="middle" style="word-break: keep-all">
  <!--{loop $_DCACHE['supe_updateusers'] $supe_updateuser}-->
   <a href="$supe[siteurl]/?uid/{$supe_updateuser[uid]}" target="_blank">{$supe_updateuser[username]}</a>
  <!--{/loop}-->
  </td></tr>
  </tbody>
<!--{/if}-->
  <!--{if $whosonlinestatus}-->
  <!--{if $detailstatus}-->
  <tbody>
    <tr class="header">
     <td colspan="3" class="smalltxt" style="font-weight: normal; color: {HEADERTEXT}">
         <a name="online"></a>
         <a href="$indexname?showoldetails=no#online"><img src="{IMGDIR}/collapsed_no.gif" align="right" border="0" alt="" /></a>
         <span class="bold"><a href="member.php?action=online">{lang index_activeusers}</a></span> -
          
         <span class="bold">$onlinenum</span> {lang onlines} -
         <span class="bold">$membercount</span> {lang index_members}(<span class="bold">$invisiblecount</span> {lang index_invisibles}),
         <span class="bold">$guestcount</span> {lang index_guests} | {lang index_mostonlines}
         <span class="bold">$onlineinfo[0]</span> {lang on} <span class="bold">$onlineinfo[1]</span>.
      </td>
    </tr>
  </tbody>
  <!--{else}-->
   <tbody>
    <tr class="header">
     <td colspan="3" class="smalltxt" style="font-weight: normal; color: {HEADERTEXT}">
         <a name="online"></a>
         <a href="$indexname?showoldetails=yes#online"><img src="{IMGDIR}/collapsed_yes.gif" align="right" border="0" alt="" /></a>
         <span class="bold"><a href="member.php?action=online">{lang index_activeusers}</a></span> -
          {lang total}
         <span class="bold">$onlinenum</span> {lang onlines} | {lang index_mostonlines}
         <span class="bold">$onlineinfo[0]</span> {lang on} <span class="bold">$onlineinfo[1]</span>.
       </td>
     </tr>
   </tbody>
  <!--{/if}-->
  <tbody>
  <tr class="altbg2">
  <td width="5%" align="center"><img src="{IMGDIR}/online.gif" alt="" /></td>
  <td colspan="2">
  <table cellspacing="0" cellpadding="0" border="0" width="98%" align="center">
  <tr><td colspan="7" valign="middle">$_DCACHE[onlinelist][legend]</td></tr>
  <!--{if $detailstatus}-->
   <tbody>
    <tr><td colspan="7"><hr class="line" size="0"></td></tr>
    <tr><td nowrap>
   <!--{if $whosonline}-->
    <!--{loop $whosonline $key $online}-->
      <!--{if $key % 7 == 0}-->
     </td></tr>
     <tr><td width="15%" nowrap>
     <!--{else}-->
     </td><td width="15%" nowrap>
     <!--{/if}-->
      <img src="images/common/$online[icon]"  alt="" />
     <!--{if $online['uid']}-->
      <a href="space.php?uid=$online[uid]"
      <!--{else}-->
      <a href="###"
     <!--{/if}-->title="{lang time}: $online[lastactivity]{LF}
     {lang action}: $online[action]
     <!--{if $online['fid']}-->{LF}{lang forum}: $online[fid]<!--{/if}-->
     ">$online[username]</a>
     <!--{/loop}-->
   <!--{else}-->
        {lang online_only_guests}
   <!--{/if}-->
   <!--{/if}-->
  </td></tr>
  </tbody>
   </table></td></tr>
<!--{/if}-->

</table></div><br><br>
</div>
<!--{/if}-->
<!--/* Discuz首页论坛联盟信息、生日信息、在线信息、X-SPACE更新信息模块结束*/-->
  <!--/* Discuz首页论坛图标示例模块开始*/-->
<div class="tableborder" style="width: 300px; padding: 9px; background-color: {ALTBG1}">
<span class="smalltxt">
<img src="{IMGDIR}/red_forum.gif" class="absmiddle" alt="" />  {lang forum_newposts}             
<img src="{IMGDIR}/forum.gif" class="absmiddle" alt="" />  {lang forum_nonewpost}
  </span>
</div>
<!--/* Discuz首页论坛图标示例模块结束*/-->

<!--/* Discuz首页个人详细积分弹出菜单模块开始*/-->
<div title="menu" class="popupmenu_popup" id="creditlist_menu" style="display: none">
<div class="popupmenu_option" style="text-align: left">
{lang credits}: $credits<br>
<!--{loop $extcredits $id $credit}-->
$credit[title]: $GLOBALS['extcredits'.$id] $credit[unit]<br>
<!--{/loop}-->
</div></div>
<!--/* Discuz首页个人详细积分弹出菜单模块结束*/-->
  <!--/* Discuz首页中间内容结束,开始调用footer.htm并输出,完成整个页面 */-->
{template footer}

本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/phpsome/archive/2009/02/19/3910210.aspx
  你的沉默明亮如灯、简单如指环。

  论坛其他名字 【云水.墨】 【淡墨瀑雪】
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

Archiver|手机版|云水网 ( 鲁ICP备09069806号 )

GMT+8, 2024-6-1 20:29 , Processed in 0.039249 second(s), 18 queries .

Powered by Discuz! X2.5

© 2001-2012 Comsenz Inc.

回顶部