广

Discuz教程

  • 帝国cms教程
  • 织梦CMS教程
  • PHP CMS教程
  • ECSHOP教程
  • WordPress教程
  • Discuz教程
  • CMS学习

    discuz中的header和footer模板部分必要代码解析

    2018-04-02 20:46:21 次阅读 稿源:互联网
    广告

    Discuz! X1.5版本templatedefaultcommonhead_common.htm文件中:

    1. <title><!--{if !empty($navtitle)}-->$navtitle - <!--{/if}--><!--{if empty($nobbname)}--> $_G['setting']['bbname'] - <!--{/if}--> Powered by Discuz!</title><?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
      title部分和keywords、discription。在后台中的 搜索引擎优化设置$_G['setting']['seohead'] 对应后台的其他头部信息设置这代码是对样式文件的加载<!--{csstemplate}-->
      1. <script type="text/javascript">var STYLEID = '{STYLEID}', STATICURL = '{STATICURL}', IMGDIR = '{IMGDIR}', VERHASH = '{VERHASH}', charset = '{CHARSET}', discuz_uid = '$_G[uid]', cookiepre = '{$_G[config][cookie][cookiepre]}', cookiedomain = '{$_G[config][cookie][cookiedomain]}', cookiepath = '{$_G[config][cookie][cookiepath]}', showusercard = '{$_G[setting][showusercard]}', attackevasive = '{$_G[config][security][attackevasive]}', disallowfloat = '{$_G[setting][disallowfloat]}', creditnotice = '<!--{if $_G['setting']['creditnotice']}-->$_G['setting']['creditnames']<!--{/if}-->', defaultstyle = '$_G[style][defaultextstyle]', REPORTURL = '$_G[currenturl_encode]', SITEURL = '$_G[siteurl]';</script><?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />初始化必要的js变量
        1. <script type="text/javascript" src="{$_G[setting][jspath]}common.js?{VERHASH}"></script>templatedefaultcommon从第1行至20行
          通过判断加载相应的js和css文件

          templatedefaultcommontemplatedefaultcommon
          1. <!--{if $_GET['diy'] == 'yes' && ($_G[mod] == 'topic' || $_G[group][allowdiy]) && (empty($do) || $do != 'index') && !empty($_G['style']['tplfile'])}-->
            templatedefaultcommontemplatedefaultcommon

          一起学吧部分文章转载自互联网,供读者交流和学习,若有涉及作者版权等问题请及时与我们联系,以便更正、删除或按规定办理。感谢所有提供资讯的网站,欢迎各类媒体与一起学吧进行文章共享合作。

          广告