From e85c6eab0d9e5a4c4b7feeb52fb6add2f2be211f Mon Sep 17 00:00:00 2001 From: qkqpttgf <45693631+qkqpttgf@users.noreply.github.com> Date: Thu, 21 May 2020 17:56:45 +0800 Subject: [PATCH] try to change theme at front --- common.php | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/common.php b/common.php index 36f9053..38a532a 100644 --- a/common.php +++ b/common.php @@ -175,6 +175,8 @@ function main($path) $_SERVER['timezone'] = getConfig('timezone'); if (isset($_COOKIE['timezone'])&&$_COOKIE['timezone']!='') $_SERVER['timezone'] = $_COOKIE['timezone']; if ($_SERVER['timezone']=='') $_SERVER['timezone'] = 0; + if (isset($_COOKIE['theme'])&&$_COOKIE['theme']!='') $_SERVER['theme'] = $_COOKIE['theme']; + else $_SERVER['theme'] = getConfig('theme'); $_SERVER['PHP_SELF'] = path_format($_SERVER['base_path'] . $path); if (getConfig('admin')=='') return install(); @@ -1748,7 +1750,8 @@ function render_list($path = '', $files = '') Github: https://github.com/qkqpttgf/OneManager-php -->'; - $theme = getConfig('theme'); + //$theme = getConfig('theme'); + $theme = $_SERVER['theme']; if ( $theme=='' || !file_exists('theme/'.$theme) ) $theme = 'classic.html'; if (substr($theme,-4)=='.php') { @ob_start(); @@ -2430,6 +2433,26 @@ function render_list($path = '', $files = '') $html .= $tmp[1]; while (strpos($html, '')) $html = str_replace('', $_SERVER['timezone'], $html); + $theme_arr = scandir('theme'); + $html .= ' +