頁頭文件路徑:template/default/common/header.htm
header.htm文件二次加載的文件有:
template/default/common/header_common.htm
全局公共文件
|--該文件中包含了頁面TITLE,對瀏覽器的申明,以及全局必須存在的基本代碼,因此不建議新手修改此文件
template/default/common/header_diy.htm
DIY模式時加載的DIY浮層菜單
template/default/common/member/login_simple.htm
右上角迷你登錄框(未登陸時調用該文件)
</head>以上的代碼必須保留,此段代碼爲全部頁面必須使用的腳本、樣式載入,去掉後頁面將會錯誤顯示!!
除了保留</head>以上的代碼,如下代碼也是必須存在的
頁面中的ajax交互功能必須依賴的代碼:
- <div id="append_parent"></div><div id="ajaxwaitid"></div>
DIY功能必須的代碼:
- <!--{if $_GET['diy'] == 'yes' && (CURMODULE == 'topic' || $_G['group']['allowdiy']) && !empty($_G['style']['tplfile'])}-->
- <!--{template common/header_diy}-->
- <!--{/if}-->
- <!--{if CURMODULE == 'topic' && $topic && empty($topic['useheader']) && !empty($_G['style']['tplfile']) && ($_G['group']['allowdiy'] || $_G['group']['allowaddtopic'] && $topic['uid'] == $_G['uid'] || $_G['group']['allowmanagetopic'])}-->
- <a id="diy-tg" href="javascript:openDiy();" title="{lang open_diy}" class="y"><img src="{STATICURL}image/diy/panel-toggle.png" alt="DIY" /></a>
- <!--{/if}-->
頁頭廣告調用代碼:放置於<div id="hd">上面
- <!--{ad/headerbanner/wp a_h}-->
導航條當前位置獲取代碼,必須放置於logo代碼前面
- <!--{eval $mnid = getcurrentnav();}-->
二級導航調用代碼:放置於二級導航代碼後面
- <!--{ad/subnavbanner/a_mu}-->
頁頭搜索條代碼,根據本身模板的結構設計放到須要的位置便可
- <!--{subtemplate common/pubsearchform}-->
全局框架代碼,該代碼的閉合在footer.htm文件第一行</div>中
此外頁頭文件包含幾個插件嵌入點代碼,做爲一個完整的discuz模板,插件鉤子是必須存在的:
頂部導航左嵌入點:
- <!--{hook/global_cpnav_extra1}-->
頂部導航右嵌入點:
- <!--{hook/global_cpnav_extra2}-->
右上角登陸狀態嵌入點(我的設置前面):
- <!--{hook/global_usernav_extra1}-->
右上角登陸狀態嵌入點(退出按鈕前面):
- <!--{hook/global_usernav_extra2}-->
右上角登陸狀態嵌入點(第二行第一位):
- <!--{hook/global_usernav_extra3}-->
全局頁尾
頁尾文件路徑:template/default/common/footer.htm
頁尾文件擔負整個模板的重要的收尾工做,若是缺乏必須的代碼,一樣也會致使整個程序各個功能不能正常使用!
javascript
頁尾文件第一句(必須存在):
- </div>
- PS:這個閉合的標籤是頁頭文件的<div id="wp" class="wp">
站長推薦功能調用代碼:
- <!--{eval $focusid = getfocus_rand($_G[basescript]);}-->
- <!--{if $focusid !== null}-->
- <!--{eval $focus = $_G['cache']['focus']['data'][$focusid];}-->
- <div class="focus" id="sitefocus">
- <div class="bm">
- <div class="bm_h cl">
- <a href="javascript:;" onclick="setcookie('nofocus_$focusid', 1, $_G['cache']['focus']['cookie']*3600);$('sitefocus').style.display='none'" class="y" title="{lang close}">{lang close}</a>
- <h2><!--{if $_G['cache']['focus']['title']}-->{$_G['cache']['focus']['title']}<!--{else}-->{lang focus_hottopics}<!--{/if}--></h2>
- </div>
- <div class="bm_c">
- <dl class="xld cl bbda">
- <dt><a href="{$focus['url']}" class="xi2" target="_blank">$focus['subject']</a></dt>
- <!--{if $focus[image]}-->
- <dd class="m"><a href="{$focus['url']}" target="_blank"><img src="{$focus['image']}" alt="$focus['subject']" /></a></dd>
- <!--{/if}-->
- <dd>$focus['summary']</dd>
- </dl>
- <p class="ptn hm"><a href="{$focus['url']}" class="xi2" target="_blank">{lang focus_show} »</a></p>
- </div>
- </div>
- </div>
- <!--{/if}-->
全局頁尾廣告代碼調用(必須存在):
- <!--{ad/footerbanner/wp a_f/1}--><!--{ad/footerbanner/wp a_f/2}--><!--{ad/footerbanner/wp a_f/3}-->
- <!--{ad/float/a_fl/1}--><!--{ad/float/a_fr/2}-->
- <!--{ad/couplebanner/a_fl a_cb/1}--><!--{ad/couplebanner/a_fr a_cb/2}-->
- <!--{ad/cornerbanner/a_cn}-->
頁尾插件嵌入點:(必須存在!)
- <!--{hook/global_footer}-->
頁尾左框架版權信息(必須存在)
- <div id="frt">
- <p>Powered by <strong><a href="http://www.discuz.net" target="_blank">Discuz!</a></strong> <em>$_G['setting']['version']</em><!--{if !empty($_G['setting']['boardlicensed'])}--> <a href="http://license.comsenz.com/?pid=1&host=$_SERVER[HTTP_HOST]" target="_blank">Licensed</a><!--{/if}--></p>
- <p class="xs0">© 2001-2011 <a href="http://www.comsenz.com" target="_blank">Comsenz Inc.</a></p>
- </div>
頁尾有框架菜單、備案、執行時間、統計代碼
- <div id="flk" class="y">
- <p>
- <!--{loop $_G['setting']['footernavs'] $nav}--><!--{if $nav['available'] && ($nav['type'] && (!$nav['level'] || ($nav['level'] == 1 && $_G['uid']) || ($nav['level'] == 2 && $_G['adminid'] > 0) || ($nav['level'] == 3 && $_G['adminid'] == 1)) ||
- !$nav['type'] && ($nav['id'] == 'stat' && $_G['group']['allowstatdata'] || $nav['id'] == 'report' && $_G['uid'] || $nav['id'] == 'archiver' || $nav['id'] == 'mobile'))}--><!--{if $nav['id'] == 'mobile' && $_G['setting']['mobile']['allowmobile'] != 1}--><!--{eval continue;}--><!--{/if}-->$nav[code]<span class="pipe">|</span><!--{/if}--><!--{/loop}-->
- <strong><a href="$_G['setting']['siteurl']" target="_blank">$_G['setting']['sitename']</a></strong>
- <!--{if $_G['setting']['icp']}-->( <a href="http://www.miitbeian.gov.cn/" target="_blank">$_G['setting']['icp']</a> )<!--{/if}-->
- <!--{hook/global_footerlink}-->
- <!--{if $_G['setting']['statcode']}-->$_G['setting']['statcode']<!--{/if}-->
- </p>
- <p class="xs0">
- {lang time_now}
- <span id="debuginfo">
- <!--{if debuginfo()}-->, Processed in $_G[debuginfo][time] second(s), $_G[debuginfo][queries] queries
- <!--{if $_G['gzipcompress']}-->, Gzip On<!--{/if}--><!--{if $_G['memory']}-->, <!--{echo ucwords($_G['memory'])}--> On<!--{/if}-->.
- <!--{/if}-->
- </span>
- </p>
- </div>
用戶活動信息記錄代碼(必須存在):
- <!--{eval updatesession();}-->
- PS:缺乏該代碼直接致使用戶在線時間等信息沒法記錄
用戶升級信息彈出層:(頁頭右上角用戶組鏈接彈出)
- <!--{if $upgradecredit !== false}-->
- <div id="g_upmine_menu" class="tip tip_3" style="display:none;">
- <div class="tip_c">
- {lang credits} $_G[member][credits], {lang thread_groupupgrade} $upgradecredit {lang credits}
- </div>
- <div class="tip_horn"></div>
- </div>
- <!--{/if}-->
用戶短消息、站點郵件發送觸發代碼(必須存在)
- <!--{if !$_G['setting']['bbclosed']}-->
- <!--{if $_G[uid] && !isset($_G['cookie']['checkpm'])}-->
- <script type="text/javascript" src="home.php?mod=spacecp&ac=pm&op=checknewpm&rand=$_G[timestamp]"></script>
- <!--{/if}-->
- <!--{if !isset($_G['cookie']['sendmail'])}-->
- <script type="text/javascript" src="home.php?mod=misc&ac=sendmail&rand=$_G[timestamp]"></script>
- <!--{/if}-->
- <!--{/if}-->
使用DIY功能時必須的腳本(必須存在):
- <!--{if $_GET['diy'] == 'yes'}-->
- <!--{if (CURMODULE == 'topic' || $_G['group']['allowdiy']) && (empty($do) || $do != 'index') && !empty($_G['style']['tplfile'])}-->
- <script type="text/javascript" src="{$_G[setting][jspath]}common_diy.js?{VERHASH}"></script>
- <script type="text/javascript" src="{$_G[setting][jspath]}portal_diy.js?{VERHASH}"></script>
- <!--{/if}-->
- <!--{if $space['self'] && CURMODULE == 'space' && $do == 'index'}-->
- <script type="text/javascript" src="{$_G[setting][jspath]}common_diy.js?{VERHASH}"></script>
- <script type="text/javascript" src="{$_G[setting][jspath]}space_diy.js?{VERHASH}"></script>
- <!--{/if}-->
- <!--{/if}-->
用戶提醒功能狀態變動(必須存在):
- <!--{if $_G['member']['newprompt'] && (empty($_G['cookie']['promptstate_'.$_G[uid]]) || $_G['cookie']['promptstate_'.$_G[uid]] != $_G['member']['newprompt']) && $_G['gp_do'] != 'notice'}-->
- <script type="text/javascript">noticeTitle();</script>
- <!--{/if}-->
漫遊通知觸發代碼:(管理員下彈出漫遊通知)
- <!--{eval userappprompt();}-->
返回頂部浮動菜單
- <!--{if $_G['basescript'] != 'userapp'}-->
- <span id="scrolltop" onclick="window.scrollTo('0','0')">{lang scrolltop}</span>
- <script type="text/javascript">_attachEvent(window, 'scroll', function(){showTopLink();});</script>
- <!--{/if}-->
程序功能最後處理代碼(必須存在)
- <!--{eval output();}-->
- PS:僞靜態、模塊更新、Gzip等等