crx349 发表于 2013-8-21 02:32:35

Discuz!x3 Diy按键点击无法显示解决方案之一

连接的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('#') + ( 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', cookiepre = '{$_G}', cookiedomain = '{$_G}', cookiepath = '{$_G}', showusercard = '{$_G}', attackevasive = '{$_G}', disallowfloat = '{$_G}', creditnotice = '<!--{if $_G['setting']['creditnotice']}-->$_G['setting']['creditnames']<!--{/if}-->', defaultstyle = '$_G', REPORTURL = '$_G', SITEURL = '$_G', JSPATH = '$_G', DYNAMICURL = '$_G';</script>而安装的模版不存在DYNAMICURL = '$_G'变量,而直接导致模版无法解析diy按钮的连接所以给新安装的模版当中加入了DYNAMICURL = '$_G'变量后解决问题

以上分析的出DYNAMICURL = '$_G'变量声明是放在header_common.htm这个页面的如果安装的模板没有这个页面我感觉应该不会出现这个问题,相反如果有这文件而文件的这个变量没有声明的话diy按钮就找不到连接,导致打不开了!
页: [1]
查看完整版本: Discuz!x3 Diy按键点击无法显示解决方案之一