From a7772498e2148859add9968a100476afbb43e97e Mon Sep 17 00:00:00 2001 From: chicpro Date: Mon, 15 Apr 2013 10:39:21 +0900 Subject: [PATCH 1/5] =?UTF-8?q?get=5Fskin=5Fjavascript=20=ED=95=A8?= =?UTF-8?q?=EC=88=98=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 | 37 ++++++++++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/lib/common.lib.php b/lib/common.lib.php index 3da1f3716..2a140bb3d 100644 --- a/lib/common.lib.php +++ b/lib/common.lib.php @@ -1798,13 +1798,16 @@ function delete_editor_thumbnail($contents) } // 스킨 style sheet 파일 얻기 -function get_skin_stylesheet($skin_path) +function get_skin_stylesheet($skin_path, $dir='') { 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)) { @@ -1825,4 +1828,36 @@ function get_skin_stylesheet($skin_path) 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); + } + } + + return $str; +} ?> \ No newline at end of file From 5b7f0932f1cbd5f3ffa955f0b00d8746916bbadb Mon Sep 17 00:00:00 2001 From: chicpro Date: Mon, 15 Apr 2013 10:50:51 +0900 Subject: [PATCH 2/5] =?UTF-8?q?=EC=8A=A4=ED=82=A8=20js=20=ED=8F=B4?= =?UTF-8?q?=EB=8D=94=EC=9D=98=20=EC=8A=A4=ED=81=AC=EB=A6=BD=ED=8A=B8=20?= =?UTF-8?q?=ED=8C=8C=EC=9D=BC=20=EB=A1=9C=EB=94=A9=ED=95=98=EB=8A=94=20?= =?UTF-8?q?=EA=B8=B0=EB=8A=A5=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- head.sub.php | 16 ++++++++++++++++ lib/common.lib.php | 2 +- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/head.sub.php b/head.sub.php index 27ea33d45..61f378b6d 100644 --- a/head.sub.php +++ b/head.sub.php @@ -80,6 +80,22 @@ var g4_cookie_domain = ""; + '."\n"; + $str .= ''."\n"; } closedir($dh); } From 98dc8a67166e73737e27d549f40793911db21912 Mon Sep 17 00:00:00 2001 From: gnuboard Date: Mon, 15 Apr 2013 11:04:38 +0900 Subject: [PATCH 3/5] =?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 From 2108aa9eb5d3814d6d8cf242475fdbb82d14fd4c Mon Sep 17 00:00:00 2001 From: chicpro Date: Mon, 15 Apr 2013 11:08:34 +0900 Subject: [PATCH 4/5] =?UTF-8?q?=EC=8A=A4=ED=82=A8=20javascript=20=EB=A1=9C?= =?UTF-8?q?=EB=94=A9=20=EC=BD=94=EB=93=9C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- head.sub.php | 12 ++++++------ lib/common.lib.php | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/head.sub.php b/head.sub.php index 61f378b6d..9bb1a4cca 100644 --- a/head.sub.php +++ b/head.sub.php @@ -83,17 +83,17 @@ var g4_cookie_domain = ""; diff --git a/lib/common.lib.php b/lib/common.lib.php index 9fb3042f5..1609726b6 100644 --- a/lib/common.lib.php +++ b/lib/common.lib.php @@ -1830,7 +1830,7 @@ function get_skin_stylesheet($skin_path, $dir='') } // 스킨 javascript 파일 얻기 -function get_skin_javascript($skin_path, $dir='js') +function get_skin_javascript($skin_path, $dir='') { if(!$skin_path) return ""; From 318ed7920ed5474ff638ca080c8a4503a4dfad9c Mon Sep 17 00:00:00 2001 From: chicpro Date: Mon, 15 Apr 2013 11:16:50 +0900 Subject: [PATCH 5/5] =?UTF-8?q?js=20=EB=A1=9C=EB=93=9C=20=EC=B2=98?= =?UTF-8?q?=EB=A6=AC=20=EC=BD=94=EB=93=9C=20=EC=98=A4=EB=A5=98=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- head.sub.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/head.sub.php b/head.sub.php index 9bb1a4cca..a104d424a 100644 --- a/head.sub.php +++ b/head.sub.php @@ -87,13 +87,13 @@ if (!defined('G4_IS_ADMIN')) { if(isset($member_skin_path)) echo get_skin_javascript($member_skin_path, 'js'); if(isset($new_skin_path)) - echo get_skin_javascript($new_skin_path 'js'); + echo get_skin_javascript($new_skin_path, 'js'); if(isset($search_skin_path)) - echo get_skin_javascript($search_skin_path 'js'); + echo get_skin_javascript($search_skin_path, 'js'); if(isset($connect_skin_path)) - echo get_skin_javascript($connect_skin_path 'js'); + echo get_skin_javascript($connect_skin_path, 'js'); if(isset($poll_skin_path)) - echo get_skin_javascript($poll_skin_path 'js'); + echo get_skin_javascript($poll_skin_path, 'js'); } ?>