diff --git a/class/Api.php b/class/Api.php index 1a882a4..bb41ec6 100755 --- a/class/Api.php +++ b/class/Api.php @@ -980,7 +980,7 @@ class Api { if( file_exists("templates/".$template."/config.json") ) { $config_file = "templates/".$template."/config.json"; } - else if(data/templates/".$template."/config.json) { + else if( file_exists("data/templates/".$template."/config.json") ) { $config_file = "data/templates/".$template."/config.json"; } else if( file_exists("templates/".$template."/info.json") ) { @@ -995,12 +995,14 @@ class Api { //如果是info.json,则特殊处理下 if ( strstr($config_file,"info.json") ) { + $config_content = json_decode($config_content); $theme_config = $config_content->config; } else{ $theme_config = $config_content; + $theme_config = json_decode($theme_config); } - $theme_config = json_decode($theme_config); + $this->return_json(200,$theme_config,""); } /** diff --git a/controller/index.php b/controller/index.php index b655016..9ac9166 100755 --- a/controller/index.php +++ b/controller/index.php @@ -167,7 +167,7 @@ $site = unserialize($site); if( file_exists("templates/".$template."/config.json") ) { $config_file = "templates/".$template."/config.json"; } -else if(data/templates/".$template."/config.json) { +else if( file_exists("data/templates/".$template."/config.json") ) { $config_file = "data/templates/".$template."/config.json"; } else if( file_exists("templates/".$template."/info.json") ) { @@ -181,12 +181,14 @@ else { $config_content = @file_get_contents($config_file); //如果是info.json,则特殊处理下 if ( strstr($config_file,"info.json") ) { + $config_content = json_decode($config_content); $theme_config = $config_content->config; } else{ - $theme_config = $config_content; + $config_content = $config_content; + $theme_config = json_decode($config_content); } -$theme_config = json_decode($config_content); + //判断文件夹是否存在 if( is_dir('templates/'.$template) ){ diff --git a/templates/default/info.json b/templates/default/info.json index c36f0bd..6cd649e 100644 --- a/templates/default/info.json +++ b/templates/default/info.json @@ -10,6 +10,6 @@ "config": { "full_width_mode":"off", "link_description":"show", - "favicon": "offline" + "favicon": "online" } } \ No newline at end of file