From: sparky4 Date: Thu, 24 Feb 2011 11:46:49 +0000 (-0600) Subject: modified: lib/lib_common.php X-Git-Url: http://4ch.mooo.com/gitweb/?a=commitdiff_plain;h=690d7e835fe94464df0b4ad477ef5396ea1b98f8;p=test.git modified: lib/lib_common.php new file: lib/lib_css.php --- diff --git a/lib/lib_common.php b/lib/lib_common.php index 1461497..f4f3854 100755 --- a/lib/lib_common.php +++ b/lib/lib_common.php @@ -25,47 +25,7 @@ function PMCCore_errorHandler($errno, $errstr, $errfile, $errline){ } } -/* css data */ -// http://www.magmagateau.com/fuukaba/ is the source of the code below -$style_load = false; -$style_bar = ''; - -if(file_exists(DATA_DIR.CSV_SS)){ // Load FuuR4 CSS data - $style_data = DATA_DIR.CSV_SS; - $style_bar .= '['; - $lines = explode("\n", file_get_contents($style_data)); - foreach($lines as $null => $line){ - if($line != ''){ - list($style_name, $style_short, $style_path, $style_rel) = explode (',', $line); - $style_path = CSS_DIR.$style_path; - if(file_exists($style_path)){ - if($style_rel) $style_rel = 'stylesheet'; - else $style_rel = 'alternate stylesheet'; - $style_load .= ''."\n"; - $style_js = format_js_var($style_name); - $style_title = str_replace('[what]', $style_name, _T('style_tooltip')); - $style_bar .= ' '.$style_short.' |'; - } - } - } - - $style_bar .= ']'; - - // Tidy up trailing seperators and empty brackets - $style_bar = str_replace('|]', ']', $style_bar); - $style_bar = str_replace('[] ', '', $style_bar); - $style_bar = str_replace('[]', '', $style_bar); -} - -// Load stylesheet setting from config.php -// if either of the datafiles are missing or empty -if(str_replace('[]', '', $style_bar) == '') $style_load .= ''; - -// style sheet js loader -$jsdonk = 'var style_cookie = "'; -$jsdonk .= ($style_bar) ? 'yo_style' : ''; -$jsdonk .= '";'; -////++++ +include_once(PHP_DIRECTORY.'lib/lib_css.php'); // load CSS data /* 輸出表頭 */ /* ヘッダ */ diff --git a/lib/lib_css.php b/lib/lib_css.php new file mode 100644 index 0000000..a9edad3 --- /dev/null +++ b/lib/lib_css.php @@ -0,0 +1,52 @@ + $line){ + if($line != ''){ + list($style_name, $style_short, $style_path, $style_rel) = explode (',', $line); + $style_path = CSS_DIR.$style_path; + if(file_exists($style_path)){ + if($style_rel) $style_rel = 'stylesheet'; + else $style_rel = 'alternate stylesheet'; + $style_load .= ''."\n"; + $style_js = format_js_var($style_name); + $style_title = str_replace('[what]', $style_name, _T('style_tooltip')); + $style_bar .= ' '.$style_short.' |'; + } + } + } + $style_bar .= ']'; + // Tidy up trailing seperators and empty brackets + $style_bar = str_replace('|]', ']', $style_bar); + $style_bar = str_replace('[] ', '', $style_bar); + $style_bar = str_replace('[]', '', $style_bar); +} + +// Load stylesheet setting from config.php +// if either of the datafiles are missing or empty +if(str_replace('[]', '', $style_bar) == '') $style_load .= ''; + +// style sheet js loader +$jsdonk = 'var style_cookie = "'; +$jsdonk .= ($style_bar) ? 'yo_style' : ''; +$jsdonk .= '";'; +////++++ +// CSS data is loaded And we proceed with head() +?>