现象:如果您的网站将版块设置了二级域名,则在X2下访问这个二级域名而访问到对应版块的主题列表时,主题的链接地址也为二级域名的地址了。
正确的地址应该为网站在后台 → 域名设置 → 应用域名中设置的“默认”域名。
修改办法:(正式版解决办法)
找到 source/function/cache/cache_setting.php 文件的第 389 行附近
- $repflag = $apps['portal'] || $apps['forum'] || $apps['group'] || $apps['home'];
复制代码 修改为
- $repflag = $apps['portal'] || $apps['forum'] || $apps['group'] || $apps['home'] || $apps['default'];
复制代码 注:按照“临时方法”修改过的,请您还原代码。
===========================================================================
修改方法:(此为临时方法,稍后会有更加专业的修改办法)
找到 source/function/function_core.php 文件的第 1140 行附近- function output_replace($content) {
- global $_G;
- if(defined('IN_MODCP') || defined('IN_ADMINCP')) return $content;
- $temp = parse_url($_G['siteurl']);
- if(!empty($_G['setting']['output']['str']['search'])) {
- if(empty($_G['setting']['domain']['app']['default'])) {
- $_G['setting']['output']['str']['replace'] = str_replace('{CURHOST}', $temp['host'], $_G['setting']['output']['str']['replace']);
- }
- $content = str_replace($_G['setting']['output']['str']['search'], $_G['setting']['output']['str']['replace'], $content);
- }
- if(!empty($_G['setting']['output']['preg']['search'])) {
- if(empty($_G['setting']['domain']['app']['default'])) {
- $_G['setting']['output']['preg']['search'] = str_replace('\{CURHOST\}', preg_quote($temp['host']), $_G['setting']['output']['preg']['search']);
- $_G['setting']['output']['preg']['replace'] = str_replace('{CURHOST}', $temp['host'], $_G['setting']['output']['preg']['replace']);
- }
- $content = preg_replace($_G['setting']['output']['preg']['search'], $_G['setting']['output']['preg']['replace'], $content);
- }
- return $content;
- }
复制代码 修改为如下代码
- function output_replace($content) {
- global $_G;
- if(defined('IN_MODCP') || defined('IN_ADMINCP')) return $content;
- $temp = parse_url($_G['siteurl']);
- /*
- if(!empty($_G['setting']['output']['str']['search'])) {
- if(empty($_G['setting']['domain']['app']['default'])) {
- $_G['setting']['output']['str']['replace'] = str_replace('{CURHOST}', $temp['host'], $_G['setting']['output']['str']['replace']);
- }
- $content = str_replace($_G['setting']['output']['str']['search'], $_G['setting']['output']['str']['replace'], $content);
- }
- */
- if(!empty($_G['setting']['output']['str']['search'])) {
- if(empty($_G['setting']['domain']['app']['default'])) {
- $_G['setting']['output']['str']['replace'] = str_replace('{CURHOST}', $temp['host'], $_G['setting']['output']['str']['replace']);
- } else {
- $_G['setting']['output']['str']['replace'] = str_replace('{CURHOST}', $_G['setting']['domain']['app']['default'], $_G['setting']['output']['str']['replace']);
- $_G['setting']['output']['str']['search'][] = $temp['host'];
- $_G['setting']['output']['str']['replace'][] = $_G['setting']['domain']['app']['default'];
- }
- } elseif(!empty($_G['setting']['domain']['app']['default'])) {
- $_G['setting']['output']['str']['search'] = $temp['host'];
- $_G['setting']['output']['str']['replace'] = $_G['setting']['domain']['app']['default'];
- }
- if(!empty($_G['setting']['output']['str']['search'])) {
- $content = str_replace($_G['setting']['output']['str']['search'], $_G['setting']['output']['str']['replace'], $content);
- }
- if(!empty($_G['setting']['output']['preg']['search'])) {
- if(empty($_G['setting']['domain']['app']['default'])) {
- $_G['setting']['output']['preg']['search'] = str_replace('\{CURHOST\}', preg_quote($temp['host']), $_G['setting']['output']['preg']['search']);
- $_G['setting']['output']['preg']['replace'] = str_replace('{CURHOST}', $temp['host'], $_G['setting']['output']['preg']['replace']);
- }
- $content = preg_replace($_G['setting']['output']['preg']['search'], $_G['setting']['output']['preg']['replace'], $content);
- }
- return $content;
- }
复制代码
|