Discuz Tutorial: The interface structure that you must understand before you create a site template (header footer template file)

Source: Internet
Author: User


Page header file path:
template/default/common/header.htm

header.htm file two times the files loaded are:

Template/default/common/header_common.htm Global public File
|--This file contains the page title, the browser declaration, and the basic code that must exist globally, so it is not recommended that the novice modify this file

Template/default/common/header_diy.htm DIY floating Layer menu loaded
Template/default/common/member/login_simple.htm Top right corner mini-Login box (call this file when not logged in)



in addition to retaining

The code that the Ajax interactivity in the page must rely on:
    1. <div id= "append_parent" ></div><div id= "Ajaxwaitid" ></div>
The code required for the DIY feature:
    1. <!--{if $_get[' diy '] = = ' Yes ' && (curmodule = = ' topic ' | | $_g[' group ' [' Allowdiy ']) &&!empty ($_g[' sty Le ' [' tplfile '])}-->
    2. <!--{Template common/header_diy}-->
    3. <!--{/if}-->
    4. <!--{if curmodule = = ' topic ' && $topic && empty ($topic [' Useheader ') &&!empty ($_g[' style '] [ ' Tplfile ') && ($_g[' group '] [' Allowdiy '] | | $_g[' group ' [' Allowaddtopic '] && $topic [' uid '] = = $_g[' uid '] | | $_g[' group ' [' Allowmanagetopic '])}-->
    5. <a id= "DIY-TG" href= "Javascript:opendiy ();" title= "{lang open_diy}" class= "y" ></a>
    6. <!--{/if}-->

Page Header ad Calling code: placed on <div id= "HD" > above
    1. <!--{ad/headerbanner/wp a_h}-->

The current position of the navigation bar gets the code, must be placed in front of the logo code
    1. <!--{eval $mnid = Getcurrentnav ();} -

Second-level navigation call code: placed behind level two navigation code
    1. <!--{ad/subnavbanner/a_mu}-->
Page Header Search bar code, according to the structure of your template to put in the desired location
    1. <!--{Subtemplate common/pubsearchform}-->

Global Framework code, closed in the first line of the footer.htm file </div>
    1. <div id= "WP" class= "WP" >

In addition, the header file contains several plug-in embedded point code, as a complete discuz template, plug-in hooks must exist:

Top navigation left inset point:
    1. <!--{hook/global_cpnav_extra1}-->
Top Navigation right embedded point:
    1. <!--{hook/global_cpnav_extra2}-->
Top right sign-in status embed point (front of personal settings):
    1. <!--{hook/global_usernav_extra1}-->
Top right sign-in status embedding Point (Exit button front):
    1. <!--{hook/global_usernav_extra2}-->
Upper right Sign-in status embedding point (second row first bit):
    1. <!--{hook/global_usernav_extra3}-->



Global Footer

End-of- page file path:template/default/common/footer.htm

The footer file takes on the important finishing work of the whole template, and if the necessary code is missing, it will also cause the whole program to not function properly!


Footer file First sentence (must exist):
    1. </div>
    2. PS: This closed tag is the page header file of the <div id= "WP" class= "WP" >
Webmaster Recommendation function Call Code:
  1. <!--{eval $focusid = Getfocus_rand ($_g[basescript]);} -
  2. <!--{if $focusid!== null}-->
  3. <!--{eval $focus = $_g[' cache ' [' Focus '] [' data '] [$FOCUSID];} -
  4. <div class= "Focus" id= "Sitefocus" >
  5. <div class= "BM" >
  6. <div class= "Bm_h cl" >
  7. <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>
  8. </div>
  9. <div class= "Bm_c" >
  10. <DL class= "XLD cl Bbda" >
  11. <dt><a href= "{$focus [' url ']}" class= "Xi2" target= "_blank" > $focus [' Subject ']</a></dt>
  12. <!--{if $focus [image]}-->
  13. <dd class= "M" ><a href= "{$focus [' url ']}" target= "_blank" ></a></dd>
  14. <!--{/if}-->
  15. <dd> $focus [' Summary ']</dd>
  16. </dl>
  17. <p class= "Ptn HM" ><a href= "{$focus [' url ']}" class= "Xi2" target= "_blank" >{lang focus_show} &raquo;< /a></p>
  18. </div>
  19. </div>
  20. </div>
  21. <!--{/if}-->
Global footer AD Code invocation (must exist):
    1. <!--{ad/footerbanner/wp a_f/1}--><!--{ad/footerbanner/wp a_f/2}--><!--{ad/footerbanner/wp a_f/3}-- >
    2. <!--{ad/float/a_fl/1}--><!--{ad/float/a_fr/2}-->
    3. <!--{Ad/couplebanner/a_fl a_cb/1}--><!--{ad/couplebanner/a_fr a_cb/2}-->
    4. <!--{ad/cornerbanner/a_cn}-->
Footer Plugin Embedding point: (Must exist!) )
    1. <!--{hook/global_footer}-->
Page Footer Left frame copyright information (must exist)
    1. <div id= "Frt" >
    2. <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>
    3. <p class= "Xs0" >&copy; 2001-2011 <a href= "http://www.comsenz.com" target= "_blank" >comsenz inc.</a></p>
    4. </div>
Footer with frame menu, record, execution time, statistical code
  1. <div id= "Flk" class= "Y" >
  2. <p>
  3. <!--{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)) ||
  4. $nav [' type '] && ($nav [' id '] = = ' stat ' && $_g[' group ' [' Allowstatdata '] | | $nav [' id '] = = ' report ' &&A mp $_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}-->
  5. <strong><a href= "$_g[' setting ' [' SiteURL ']" target= "_blank" >$_g[' setting ' [' SiteName ']</a><] /strong>
  6. <!--{if $_g[' setting ' [' ICP ']}--> (<a href= "http://www.miitbeian.gov.cn/" target= "_blank" >$_g["setting ' [' ICP ']</a>] <!--{/if}-->
  7. <!--{hook/global_footerlink}-->
  8. <!--{if $_g[' setting '] [' statcode ']}-->$_g[' setting ' [' Statcode ']<!--{/if}-->
  9. </p>
  10. <p class= "Xs0" >
  11. {lang Time_now}
  12. <span id= "Debuginfo" >
  13. <!--{if debuginfo ()}-->, processed in $_g[debuginfo][time] second (s), $_g[debuginfo][queries] Queries
  14. <!--{if $_g[' gzipcompress ']}-->, Gzip on<!--{/if}--><!--{if $_g[' memory ']}-->, <!--{echo Ucwords ($_g[' memory ')}--> on<!--{/if}-->.
  15. <!--{/if}-->
  16. </span>
  17. </p>
  18. </div>
User activity information Record code (must exist):
    1. <!--{eval updatesession ();} -
    2. PS: The lack of this code directly results in the user's online time and other information cannot be recorded
User upgrade information pop-up layer: (Top right corner of the page user Group connection popup)
    1. <!--{if $upgradecredit!== false}-->
    2. <div id= "G_upmine_menu" class= "Tip tip_3" style= "Display:none;" >
    3. <div class= "Tip_c" >
    4. {lang credits} $_g[member][credits], {lang thread_groupupgrade} $upgradecredit {lang credits}
    5. </div>
    6. <div class= "Tip_horn" ></div>
    7. </div>
    8. <!--{/if}-->
User short message, site mail send trigger code (must exist)
    1. <!--{if!$_g[' setting ' [' bbclosed ']}-->
    2. <!--{if $_g[uid] &&!isset ($_g[' cookie '] [' checkpm '])}-->
    3. <script type= "Text/javascript" src= "Home.php?mod=spacecp&ac=pm&op=checknewpm&rand=$_g[timestamp]" ></script>
    4. <!--{/if}-->
    5. <!--{if!isset ($_g[' cookie '] [' sendmail '])}-->
    6. <script type= "Text/javascript" src= "Home.php?mod=misc&ac=sendmail&rand=$_g[timestamp]" ></script >
    7. <!--{/if}-->
    8. <!--{/if}-->
Scripts required to use the DIY feature (must exist):
  1. <!--{if $_get[' diy '] = = ' Yes '}-->
  2. <!--{if (Curmodule = = ' topic ' | | $_g[' group '] [' allowdiy ']) && (Empty ($do) | | $do! = ' index ') &&!empty ( $_g[' style ' [' tplfile '])}-->
  3. <script type= "Text/javascript" src= "{$_g[setting][jspath]}common_diy.js? {Verhash} "></script>
  4. <script type= "Text/javascript" src= "{$_g[setting][jspath]}portal_diy.js? {Verhash} "></script>
  5. <!--{/if}-->
  6. <!--{if $space [' self '] && curmodule = = ' Space ' && $do = = ' Index '}-->
  7. <script type= "Text/javascript" src= "{$_g[setting][jspath]}common_diy.js? {Verhash} "></script>
  8. <script type= "Text/javascript" src= "{$_g[setting][jspath]}space_diy.js? {Verhash} "></script>
  9. <!--{/if}-->
  10. <!--{/if}-->
User Alert function Status change (must exist):
    1. <!--{if $_g[' member ' [' Newprompt '] && (empty ($_g[' cookie '] [' promptstate_ '. $_g[uid]]) | | $_g[' cookie ' [' Promptstate_ '. $_g[uid]]! = $_g[' member ' [' Newprompt ']) && $_g[' Gp_do ']! = ' notice '}-->
    2. <script type= "Text/javascript" >noticetitle ();</script>
    3. <!--{/if}-->
Roaming notification Trigger code: (Administrator popup roaming notification)
    1. <!--{eval userappprompt ();} -
Return to top floating menu
    1. <!--{if $_g[' basescript ']! = ' Userapp '}-->
    2. <span id= "scrolltop" onclick= "Window.scrollto (' 0 ', ' 0 ')" >{lang scrolltop}</span>
    3. <script type= "text/javascript" >_attachevent (window, ' scroll ', function () {Showtoplink ();}); </script>
    4. <!--{/if}-->
program function last processing code (must exist)
      1. <!--{eval output ();} -
      2. PS: Pseudo-static, module update, gzip, etc.

(GO) discuz Tutorial: The interface structure you must know before you create a site template (header footer template file)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.