分类 PHP 下的文章

dede系统换LMXCMS 后模板风格切换不生效。经过分析调试
文件 lmxcms1.41\class\parse.class.php
构造函数

public function __construct(&$smarty){
    global $config;
    $this->config = $config;
    $this->smarty = $smarty;
    //修改smarty配置为前台
    defined('TEMDIR') || define('TEMDIR',$GLOBALS['public']['default_temdir']); //电脑模板目录
    defined('COMPILE_DIR') || define('COMPILE_DIR','index'); //电脑编译目录
    defined('COMPILE_CACHE_DIR') || define('COMPILE_CACHE_DIR','index'); //电脑编译缓存目录
    $this->smarty->template_dir = $this->config['template'].TEMDIR.'/'; //模板路径
    $this->smarty->compile_dir=$this->config['smy_compile_dir'].COMPILE_DIR.'/'; //编译文件路径
    $this->smarty->cache_dir = $this->config['smy_cache_dir'].COMPILE_CACHE_DIR.'/'; //缓存目录
}

是通过 defined('TEMDIR') 定义判断,已定义值有定义的值,否则取后台模板风格

查看首页文件 index.php
lmxcms1.41\index.php

define('LMXCMS',TRUE);
define('RUN_TYPE','index');
define('TEMDIR','default'); //电脑模板目录
define('COMPILE_DIR','index'); //电脑编译目录
define('COMPILE_CACHE_DIR','index'); //电脑编译缓存目录
require dirname(__FILE__).'/inc/config.inc.php';
require dirname(__FILE__).'/inc/run.inc.php';

第9行 define('TEMDIR','default'); //电脑模板目录
定义了默认风格导致后台切换无效。

处理方法 注释第9行代码
//define('TEMDIR','default'); //电脑模板目录
问题解决