zoukankan      html  css  js  c++  java
  • dzx2.5 templatedefaultforumviewthread_node_body.htm代码调用注释

    第二行直到第十三行
    该段代码所调用的就是版主或以上用戶组(不包自定義用戶及普通用戶等)
    在进行对帖子屏蔽﹑禁止用戶﹑禁止发言﹑禁止访问﹑hide代码中的提示以及內容显示

    <!--{if !$_G['forum']['ismoderator'] && $_G['setting']['bannedmessages'] & 1 && (($post['authorid'] && !$post['username']) || ($_G['thread']['digest'] == 0 && ($post['groupid'] == 4 || $post['groupid'] == 5 || $post['memberstatus'] == '-1')))}-->


    此段是判斷于用戶组的显示信息(只限于版主或以上用戶组)

    {lang message_banned}


    调用语言包"sourcelanguageforumlang_template.php"(1176,4):  'message_banned' => '提示: <em>作者被禁止或删除 内容自动屏蔽</em>',"

    <!--{elseif !$_G['forum']['ismoderator'] && $post['status'] & 1}


    "如果用戶给屏蔽后提示下列信息"

    {lang message_single_banned}


    调用语言包"sourcelanguageforumlang_template.php"(1178,4):  'message_single_banned' => '提示: <em>该帖被管理员或版主屏蔽</em>',"

    <!--{elseif $needhiddenreply}-->
            <div class="locked">{lang message_ishidden_hiddenreplies}</div>


    如果楼主设置了帖子只有作者可见所显示的信息,{lang message_ishidden_hiddenreplies}调用语言包"sourcelanguageforumlang_misc.php"(30,3):    'message_ishidden_hiddenreplies' => '此帖仅作者可见',"

    <!--{elseif $post['first'] && $_G['forum_threadpay']}-->
        <!--{template forum/viewthread_pay}-->


    如果"<!--{elseif $post['first'] && $_G['forum_threadpay']}-->"是出售主题那么就"<!--{template forum/viewthread_pay}-->"调用模版文件夾下的出售主题信息模版

            <!--{if !$post['first'] && !empty($post[subject])}-->
                    <h2>$post[subject]</h2>
            <!--{/if}-->


    调用帖子內容(內容不多说)

    <!--{if $_G['setting']['bannedmessages'] & 1 && (($post['authorid'] && !$post['username']) || ($_G['thread']['digest'] == 0 && ($post['groupid'] == 4 || $post['groupid'] == 5 || $post['memberstatus'] == '-1')))}-->
                    <div class="locked">{lang admin_message_banned}</div>


    IF判斷如果用戶组不是版主或以上用戶组所显示出的提示
    {lang admin_message_banned}调用于语言包
    "sourcelanguageforumlang_template.php"(1166,10):  'admin_message_banned' => '提示: <em>作者被禁止或删除 内容自动屏蔽,只有管理员或有管理权限的成员可见</em>',"

            <!--{elseif $post['status'] & 1}-->
                    <div class="locked">{lang admin_message_single_banned}</div>
            <!--{/if}-->


    IF句判斷是禁止用戶的句子
    {lang admin_message_single_banned} 调用于语言包(不多说先行搜索呗)

            <!--{if !$post['first'] && $hiddenreplies && $_G['forum']['ismoderator']}-->
                    <div class="locked">{lang message_ishidden_hiddenreplies}</div>
            <!--{/if}-->


    IF句判斷楼主是否设置了回帖只有作者可见的功能
    {lang message_ishidden_hiddenreplies}调用于语言包 不多说 自行搜索

                    <!--{if $_G['forum_thread']['price'] > 0 && $_G['forum_thread']['special'] == 0}-->
                            <div class="locked"><em class="y"><a href="forum.php?mod=misc&action=viewpayments&tid=$_G[tid]">{lang pay_view}</a></em>{lang pay_threads}: <strong>$_G[forum_thread][price] {$_G['setting']['extcredits'][$_G['setting']['creditstransextra'][1]][unit]}{$_G['setting']['extcredits'][$_G['setting']['creditstransextra'][1]][title]} </strong></div>
                    <!--{/if}-->


    IF判斷该帖是否以出售主题的形式发布
    如是即显示下列內容
    {lang pay_view} =>查看
    {lang pay_threads} =>付费主题,出价
    $_G[forum_thread][price] {$_G['setting']['extcredits'][$_G['setting']['creditstransextra'][1]][unit]}{$_G['setting']['extcredits'][$_G['setting']['creditstransextra'][1]][title]} => 调用出出售帖子的价格以及积分名

    <!--{if $threadsort && $threadsortshow}-->
                            <!--{if $threadsortshow['typetemplate']}-->
                                    $threadsortshow[typetemplate]
                            <!--{elseif $threadsortshow['optionlist']}-->
                                    <div class="typeoption">
                                            <!--{if $threadsortshow['optionlist'] == 'expire'}-->
                                                    {lang has_expired}
                                            <!--{else}-->
                                                    <table summary="{lang threadtype_option}" cellpadding="0" cellspacing="0" class="cgtl mbm">
                                                            <caption>$_G[forum][threadsorts][types][$_G[forum_thread][sortid]]</caption>
                                                            <tbody>
                                                                    <!--{loop $threadsortshow['optionlist'] $option}-->
                                                                            <!--{if $option['type'] != 'info'}-->
                                                                                    <tr>
                                                                                            <th>$option[title]:</th>
                                                                                            <td><!--{if $option['value']}-->$option[value] $option[unit]<!--{else}-->-<!--{/if}--></td>
                                                                                    </tr>
                                                                            <!--{/if}-->
                                                                    <!--{/loop}-->
                                                            </tbody>
                                                    </table>
                                            <!--{/if}-->
                                    </div>
                            <!--{/if}-->
                    <!--{/if}-->
            <!--{/if}-->


    调用主题分类信息帖子內容页模版信息(后台所设置的信息)

    <!--{if $post['first']}-->
                            <!--{if !$_G[forum_thread][special]}-->
                                    <table cellspacing="0" cellpadding="0"><tr><td class="t_f" id="postmessage_$post[pid]">
                                    <!--{if !$_G['inajax']}-->
                                            <!--{if $ad_a_pr}-->
                                                    $ad_a_pr
                                            <!--{/if}-->
                                    <!--{/if}-->
                                    $post[message]</td></tr></table>
                            <!--{elseif $_G[forum_thread][special] == 1}-->
                                    <!--{template forum/viewthread_poll}-->
                            <!--{elseif $_G[forum_thread][special] == 2}-->
                                    <!--{template forum/viewthread_trade}-->
                            <!--{elseif $_G[forum_thread][special] == 3}-->
                                    <!--{template forum/viewthread_reward}-->
                            <!--{elseif $_G[forum_thread][special] == 4}-->
                                    <!--{template forum/viewthread_activity}-->
                            <!--{elseif $_G[forum_thread][special] == 5}-->
                                    <!--{template forum/viewthread_debate}-->
                            <!--{elseif $_G[forum_thread][special] == 127}-->
                                    $threadplughtml
                                    <table cellspacing="0" cellpadding="0"><tr><td class="t_f" id="postmessage_$post[pid]">$post[message]</td></tr></table>
                            <!--{/if}-->
                    <!--{else}-->
                            <table cellspacing="0" cellpadding="0"><tr><td class="t_f" id="postmessage_$post[pid]">
                            <!--{if !$_G['inajax']}-->
                                    <!--{if $ad_a_pr}-->
                                            $ad_a_pr
                                    <!--{/if}-->
                            <!--{/if}-->
                            <!--{if $post['invisible'] != '-2' || $_G['forum']['ismoderator']}-->$post[message]<!--{else}--><span class="xg1">{lang moderate_need}</span><!--{/if}--></td></tr></table>
                    <!--{/if}-->


    此段调用于如果是特殊主题所显示的方式
                            <!--{elseif $_G[forum_thread][special] == 1}-->
                                    <!--{template forum/viewthread_poll}-->
                            <!--{elseif $_G[forum_thread][special] == 2}-->
                                    <!--{template forum/viewthread_trade}-->
                            <!--{elseif $_G[forum_thread][special] == 3}-->
                                    <!--{template forum/viewthread_reward}-->
                            <!--{elseif $_G[forum_thread][special] == 4}-->
                                    <!--{template forum/viewthread_activity}-->
                            <!--{elseif $_G[forum_thread][special] == 5}-->
                                    <!--{template forum/viewthread_debate}-->
    1调用投票模版
    2调用商品模版
    3调用悬赏模版
    4调用活动模版
    5调用辩论模版

                                    <!--{if $ad_a_pr}-->
                                            $ad_a_pr
                                    <!--{/if}-->
    调用于后台设置的廣告帖子內容页头部位置

    <!--{if $post['invisible'] != '-2' || $_G['forum']['ismoderator']}-->$post[message]<!--{else}--><span class="xg1">{lang moderate_need}</span><!--{/if}--></td></tr></table>
                    <!--{/if}-->
    如果帖子需要審核版主便显示此信息 待審核

                            <div class="attach_nopermission">
                                    <div>
                                            <h3>{lang attach_nopermission_notice}</h3>
                                            <p><!--{if $_G['uid']}-->{lang attach_nopermission}<!--{elseif $_G['connectguest']}-->{lang attach_nopermission_connect_fill_profile}<!--{else}-->{lang attach_nopermission_login} <!--{hook/global_login_text}--><!--{/if}--></p>
                                    </div>
                            </div>


    调用如果用戶不能查看图片等 显示需要登入的信息

    <!--{elseif $post['imagelist'] || $post['attachlist']}-->
                            <div class="pattl">
                                    <!--{if $post['imagelist'] && $_G['setting']['imagelistthumb'] && $post['imagelistcount'] >= $_G['setting']['imagelistthumb']}-->
                                            <!--{if !isset($imagelistkey)}-->
                                                    <!--{eval $imagelistkey = rawurlencode(md5($_G[tid].'|100|100'))}-->
                                                    <script type="text/javascript" reload="1">var imagelistkey = '$imagelistkey';</script>
                                            <!--{/if}-->
                                            <!--{eval $post['imagelistthumb'] = true;}-->
                                            <div class="bbda cl mtw mbm pbm">
                                                    <strong>{lang more_images}</strong>
                                                    <a href="javascript:;" class="xi2 attl_g">{lang image_small}</a>
                                                    <a href="javascript:;" class="xi2 attl_m">{lang image_big}</a>
                                            </div>
                                            <div id="imagelist_$post[pid]" class="cl" style="display:none"><!--{echo showattach($post, 1)}--></div>
                                            <div id="imagelistthumb_$post[pid]" class="pattl_c cl"><img src="{IMGDIR}/loading.gif" width="16" height="16" class="vm" /> {lang image_list_openning}</div>
                                    <!--{else}-->
                                            <!--{echo showattach($post, 1)}-->
                                    <!--{/if}-->
                                    <!--{if $post['attachlist']}-->
                                            <!--{echo showattach($post)}-->
                                    <!--{/if}-->


    调用于帖子內容页多图片橫排显示的显示方式

            <!--{if $post['first'] && $sticklist}-->
            <div>
                    <h3 class="psth xs1">{lang replies_recommended}</h3>
                    <!--{loop $sticklist $rpost}-->
                            <div class="pstl xs1">
                                    <div class="psta"><a href="home.php?mod=space&uid=$rpost[authorid]" c="1">$rpost[avatar]</a></div>
                                    <div class="psti">
                                            <p>
                                                    <a href="home.php?mod=space&uid=$rpost[authorid]" class="xi2 xw1">$rpost[author]</a> <a href="javascript:;" class="xi2">{lang published_in_floor}</a>
                                                    <!--{if $_G['group']['allowstickreply'] || $_G['forum_thread']['authorid'] == $_G['uid']}--> <a href="javascript:;" class="xi2">{lang admin_unstickreply}</a><!--{/if}-->
                                            </p>
                                            <div class="mtn">$rpost[message]</div>
                                    </div>
                            </div>
                    <!--{/loop}-->
            </div>
            <!--{/if}-->


    调用于 作者 管理回帖者 置顶回帖的內容 所显示的 回帖推薦

            <div id="comment_$post[pid]" class="cm">
            <!--{if $_G['setting']['commentnumber'] && !empty($comments[$post[pid]])}-->
                    <h3 class="psth xs1">{lang comments}</h3>
                    <!--{if $totalcomment[$post[pid]]}--><div class="pstl">$totalcomment[$post[pid]]</div><!--{/if}-->
                    <!--{loop $comments[$post[pid]] $comment}-->
                            <div class="pstl xs1">
                                    <div class="psta"><a href="home.php?mod=space&uid=$comment[authorid]" c="1">$comment[avatar]</a></div>
                                    <div class="psti">
                                            <!--{if $comment['authorid']}-->
                                            <a href="home.php?mod=space&uid=$comment[authorid]" class="xi2 xw1">$comment[author]</a>
                                            <!--{else}-->
                                            {lang guest}
                                            <!--{/if}-->
                                             $comment[comment] 
                                            <!--{if $comment[rpid]}-->
                                                    <a href="forum.php?mod=redirect&goto=findpost&pid=$comment[rpid]&ptid=$_G[tid]" class="xi2">{lang detail}</a>
                                                    <a href="forum.php?mod=post&action=reply&fid=$_G[fid]&tid=$_G[tid]&repquote=$comment[rpid]&extra=$_GET[extra]&page=$page{if $_GET[from]}&from=$_GET[from]{/if}" class="xi2">{lang reply}</a>
                                            <!--{/if}-->
                                            <span class="xg1">
                                                    {lang poston} <!--{date($comment[dateline], 'u')}-->
                                                    <!--{if $comment['useip'] && $_G['group']['allowviewip']}--> IPcomment[useip]<!--{/if}-->
                                                    <!--{if $_G['forum']['ismoderator'] && $_G['group']['allowdelpost']}--> <a href="javascript:;">{lang delete}</a><!--{/if}-->
                                            </span>
                                    </div>
                            </div>
                    <!--{/loop}-->
                    <!--{if $commentcount[$post[pid]] > $_G['setting']['commentnumber']}--><div class="pgs mbm cl"><div class="pg"><a href="javascript:;" class="nxt">{lang next_page}</a></div></div><!--{/if}-->
            <!--{/if}-->
            </div>


    调用于 点评功能 中 有点评时所显示的方式

            <!--{if !empty($post['ratelog'])}-->
                    <dl id="ratelog_$post[pid]" class="rate{if !empty($_G['cookie']['ratecollapse'])} rate_collapse{/if}">
                            <!--{if $_G['setting']['ratelogon']}-->
                                    <dd style="margin:0">
                            <!--{else}-->
                                    <dt>
                                            <!--{if !empty($postlist[$post[pid]]['totalrate'])}-->
                                                    <strong><a href="forum.php?mod=misc&action=viewratings&tid=$_G[tid]&pid=$post[pid]" title="{lang have}{echo count($postlist[$post[pid]][totalrate]);}{lang people_score}, {lang rate_view}"><!--{echo count($postlist[$post[pid]][totalrate]);}--></a></strong>
                                                    <p><a href="forum.php?mod=misc&action=viewratings&tid=$_G[tid]&pid=$post[pid]">{lang rate_view}</a></p>
                                            <!--{/if}-->
                                    </dt>
                                    <dd>
                            <!--{/if}-->
                                    <div id="post_rate_$post[pid]"></div>
                                    <!--{if $_G['setting']['ratelogon']}-->
                                            <table class="ratl">
                                                    <tr>
                                                            <th class="xw1" width="120"><a href="forum.php?mod=misc&action=viewratings&tid=$_G[tid]&pid=$post[pid]" title="{lang rate_view}">{lang have} <span class="xi1"><!--{echo count($postlist[$post[pid]][totalrate]);}--></span> {lang people_score}</a></th>
                                                            <!--{loop $post['ratelogextcredits'] $id $score}-->
                                                            <th width="50"><i>{$_G['setting']['extcredits'][$id][title]}</i></th>
                                                            <!--{/loop}-->
                                                            <th>
                                                                    <a href="javascript:;" class="y xi2 op"><!--{if !empty($_G['cookie']['ratecollapse'])}-->{lang open}<!--{else}-->{lang pack}<!--{/if}--></a>
                                                                    <i>{lang reason}</i>
                                                            </th>
                                                    </tr>
                                                    <tbody class="ratl_l">
                                                            <!--{loop $post['ratelog'] $uid $ratelog}-->
                                                            <tr id="rate_{$post[pid]}_{$uid}">
                                                                    <td>
                                                                            <a href="home.php?mod=space&uid=$uid" target="_blank"><!--{echo avatar($uid, 'small');}--></a> <a href="home.php?mod=space&uid=$uid" target="_blank">$ratelog[username]</a>
                                                                    </td>
                                                                    <!--{loop $post['ratelogextcredits'] $id $score}-->
                                                                            <!--{if $ratelog['score'][$id] > 0}-->
                                                                                    <td class="xi1"> + $ratelog[score][$id]</td>
                                                                            <!--{else}-->
                                                                                    <td class="xg1">$ratelog[score][$id]</td>
                                                                            <!--{/if}-->
                                                                    <!--{/loop}-->
                                                                    <td class="xg1">$ratelog[reason]</td>
                                                            </tr>
                                                            <!--{/loop}-->
                                                    </tbody>
                                            </table>
                                            <p class="ratc">
                                                    {lang rate_total}: 
                                                    <!--{loop $post['ratelogextcredits'] $id $score}-->
                                                            <!--{if $score > 0}-->
                                                                    <span class="xi1">{$_G['setting']['extcredits'][$id][title]} + $score</span> 
                                                            <!--{else}-->
                                                                    <span class="xg1">{$_G['setting']['extcredits'][$id][title]} $score</span> 
                                                            <!--{/if}-->
                                                    <!--{/loop}-->
                                                     <a href="forum.php?mod=misc&action=viewratings&tid=$_G[tid]&pid=$post[pid]" title="{lang rate_view}" class="xi2">{lang rate_view}</a>
                                            </p>
                                    <!--{else}-->
                                            <ul class="cl">
                                                    <!--{loop $post['ratelog'] $uid $ratelog}-->
                                                            <li>
                                                                    <p id="rate_{$post[pid]}_{$uid}" tip="<strong>$ratelog[reason]</strong> 
                                                                                    <!--{loop $ratelog['score'] $id $score}-->
                                                                                            <!--{if $score > 0}-->
                                                                                                    <em class='xi1'>{$_G['setting']['extcredits'][$id][title]} + $score $_G['setting']['extcredits'][$id][unit]</em>
                                                                                            <!--{else}-->
                                                                                                    <span>{$_G['setting']['extcredits'][$id][title]} $score $_G['setting']['extcredits'][$id][unit]</span>
                                                                                            <!--{/if}-->
                                                                                    <!--{/loop}-->" class="mtn mbn"><a href="home.php?mod=space&uid=$uid" target="_blank" class="avt"><!--{echo avatar($uid, 'small');}--></a></p>
                                                                    <p><a href="home.php?mod=space&uid=$uid" target="_blank">$ratelog[username]</a></p>
                                                            </li>
                                                    <!--{/loop}-->
                                            </ul>
                                    <!--{/if}-->
                            </dd>
                    </dl>
            <!--{else}-->
                    <div id="post_rate_div_$post[pid]"></div>
            <!--{/if}-->
            <!--{/if}-->


    此段直接调用 于 帖子有 评分 所显示的方式及內容显示等等(包括显示评分理由及不显示评分理由的版本)

    好了这次的模版代码解脫就完了!!!

  • 相关阅读:
    ubuntu系统上常用的开发工具
    wamp环境下安装pear
    PHP中preg_match_all函数用法使用详解
    晚睡对策
    iphone相关
    090213 阴
    月曜日の予定(10:30までREVIEW  10:00まで完成予定)
    一个通知
    我还没走
    星期5
  • 原文地址:https://www.cnblogs.com/alleyonline/p/7499799.html
Copyright © 2011-2022 走看看