连接的js的openDiy()函数由下列代码实现的- function openDiy(){if(DYNAMICURL) {window.location.href = SITEURL+DYNAMICURL + (DYNAMICURL.indexOf('?') < 0 ? '?' : '&') + ('diy=yes');} else {window.location.href = ((window.location.href + '').replace(/[\?\&]diy=yes/g, '').split('#')[0] + ( window.location.search && window.location.search.indexOf('?diy=yes') < 0 ? '&diy=yes' : '?diy=yes'));}}
复制代码 发现官方模版当中存在下列变量- <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]', JSPATH = '$_G[setting][jspath]', DYNAMICURL = '$_G[dynamicurl]';</script>
复制代码 而安装的模版不存在DYNAMICURL = '$_G[dynamicurl]'变量,而直接导致模版无法解析diy按钮的连接所以给新安装的模版当中加入了DYNAMICURL = '$_G[dynamicurl]'变量后解决问题
以上分析的出DYNAMICURL = '$_G[dynamicurl]'变量声明是放在header_common.htm这个页面的如果安装的模板没有这个页面我感觉应该不会出现这个问题,相反如果有这文件而文件的这个变量没有声明的话diy按钮就找不到连接,导致打不开了! |
|