From 98dc8a67166e73737e27d549f40793911db21912 Mon Sep 17 00:00:00 2001 From: gnuboard Date: Mon, 15 Apr 2013 11:04:38 +0900 Subject: [PATCH] =?UTF-8?q?PHP5=20=EC=A0=84=EC=9A=A9=ED=95=A8=EC=88=98?= =?UTF-8?q?=EC=9D=B8=20file=5Fput=5Fcontents=20=EB=A5=BC=20PHP4=20?= =?UTF-8?q?=EC=97=90=EC=84=9C=20=EC=82=AC=EC=9A=A9=ED=95=98=EA=B8=B0=20?= =?UTF-8?q?=EC=9C=84=ED=95=B4=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/common.lib.php | 43 ++++++++++++------------------------------- 1 file changed, 12 insertions(+), 31 deletions(-) diff --git a/lib/common.lib.php b/lib/common.lib.php index 9fb3042f5..5003036c2 100644 --- a/lib/common.lib.php +++ b/lib/common.lib.php @@ -1798,16 +1798,13 @@ function delete_editor_thumbnail($contents) } // 스킨 style sheet 파일 얻기 -function get_skin_stylesheet($skin_path, $dir='') +function get_skin_stylesheet($skin_path) { if(!$skin_path) return ""; $str = ""; - if($dir) - $skin_path .= '/'.$dir; - $skin_url = G4_URL.str_replace("\\", "/", str_replace(G4_PATH, "", $skin_path)); if(is_dir($skin_path)) { @@ -1829,35 +1826,19 @@ function get_skin_stylesheet($skin_path, $dir='') return $str; } -// 스킨 javascript 파일 얻기 -function get_skin_javascript($skin_path, $dir='js') -{ - if(!$skin_path) - return ""; - $str = ""; - - if($dir) - $skin_path .= '/'.$dir; - - $skin_url = G4_URL.str_replace("\\", "/", str_replace(G4_PATH, "", $skin_path)); - - if(is_dir($skin_path)) { - if($dh = opendir($skin_path)) { - while(($file = readdir($dh)) !== false) { - if($file == "." || $file == "..") - continue; - - if(is_dir($skin_path.'/'.$file)) - continue; - - if(preg_match("/\.(js)$/i", $file)) - $str .= ''."\n"; - } - closedir($dh); +// file_put_contents 는 PHP5 전용 함수이므로 PHP4 하위버전에서 사용하기 위함 +// http://www.phpied.com/file_get_contents-for-php4/ +if (!function_exists('file_put_contents')) { + function file_put_contents($filename, $data) { + $f = @fopen($filename, 'w'); + if (!$f) { + return false; + } else { + $bytes = fwrite($f, $data); + fclose($f); + return $bytes; } } - - return $str; } ?> \ No newline at end of file