From 6de340fef5f1324c4ab4559ae56e38594bcaf6d6 Mon Sep 17 00:00:00 2001 From: zero Date: Mon, 23 Apr 2007 02:41:15 +0000 Subject: [PATCH] git-svn-id: http://xe-core.googlecode.com/svn/trunk@1270 201d5d3c-b55e-5fd7-737f-ddc643e51545 --- classes/context/Context.class.php | 1 + classes/display/DisplayHandler.class.php | 2 +- classes/template/TemplateHandler.class.php | 56 +++++++++++++++------- common/js/xml_js_filter.js | 2 +- modules/board/lang/ko.lang.php | 2 +- 5 files changed, 42 insertions(+), 21 deletions(-) diff --git a/classes/context/Context.class.php b/classes/context/Context.class.php index 3c3a3ddee..585518896 100644 --- a/classes/context/Context.class.php +++ b/classes/context/Context.class.php @@ -191,6 +191,7 @@ * @brief 지정된 언어파일 로드 **/ function loadLang($path) { + return; $oContext = &Context::getInstance(); $oContext->_loadLang($path); } diff --git a/classes/display/DisplayHandler.class.php b/classes/display/DisplayHandler.class.php index d40f85c47..d06d11e22 100644 --- a/classes/display/DisplayHandler.class.php +++ b/classes/display/DisplayHandler.class.php @@ -171,7 +171,7 @@ // 기타 로그 작성 if(__DEBUG__==3) { $buff .= sprintf("\tclass file load elapsed time \t: %0.5f sec\n", $GLOBALS['__elapsed_class_load__']); - $buff .= sprintf("\tTemplate compile elapsed time\t: %0.5f sec\n", $GLOBALS['__template_elapsed__']); + $buff .= sprintf("\tTemplate compile elapsed time\t: %0.5f sec (%d called)\n", $GLOBALS['__template_elapsed__'], $GLOBALS['__TemplateHandlerCalled__']); $buff .= sprintf("\tXmlParse compile elapsed time\t: %0.5f sec\n", $GLOBALS['__xmlparse_elapsed__']); $buff .= sprintf("\tPHP elapsed time \t\t: %0.5f sec\n", $end-__StartTime__-$GLOBALS['__template_elapsed__']-$GLOBALS['__xmlparse_elapsed__']-$GLOBALS['__db_elapsed_time__']-$GLOBALS['__elapsed_class_load__']); diff --git a/classes/template/TemplateHandler.class.php b/classes/template/TemplateHandler.class.php index b9d25b64c..63b2aa0ab 100644 --- a/classes/template/TemplateHandler.class.php +++ b/classes/template/TemplateHandler.class.php @@ -19,7 +19,14 @@ * @brief TemplateHandler의 기생성된 객체를 return **/ function &getInstance() { - if(!$GLOBALS['__TemplateHandler__']) $GLOBALS['__TemplateHandler__'] = new TemplateHandler(); + if(__DEBUG__==3) { + if(!isset($GLOBALS['__TemplateHandlerCalled__'])) $GLOBALS['__TemplateHandlerCalled__']=1; + else $GLOBALS['__TemplateHandlerCalled__']++; + } + + if(!$GLOBALS['__TemplateHandler__']) { + $GLOBALS['__TemplateHandler__'] = new TemplateHandler(); + } return $GLOBALS['__TemplateHandler__']; } @@ -78,6 +85,9 @@ $buff = FileHandler::readFile($tpl_file); if(!$buff) return; + // include 변경 + $buff = preg_replace_callback('!<\!--#include\(([^\)]*?)\)-->!is', array($this, '_compileIncludeToCode'), $buff); + // 이미지 태그 img의 src의 값이 http:// 나 / 로 시작하지 않으면 제로보드의 root경로부터 시작하도록 변경 $buff = preg_replace_callback('!img([^>]*)src=[\'"]{1}(.*?)[\'"]{1}!is', array($this, '_compileImgPath'), $buff); @@ -90,9 +100,6 @@ // 의 변경 $buff = preg_replace_callback('!<\!--@(.*?)-->!is', array($this, '_compileFuncToCode'), $buff); - // include 변경 - $buff = preg_replace_callback('!<\!--#include\(([^\)]*?)\)-->!is', array($this, '_compileIncludeToCode'), $buff); - // import xml filter/ css/ js/ 언어파일 $buff = preg_replace_callback('!<\!--%import\(\"([^\"]*?)\"\)-->!is', array($this, '_compileImportCode'), $buff); @@ -194,30 +201,43 @@ if(substr($arg,0,2)=='./') $arg = substr($arg,2); // 1단계로 해당 tpl 내의 파일을 체크 - $filename = sprintf("%s/%s", dirname($this->tpl_file), $arg); + $source_filename = sprintf("%s/%s", dirname($this->tpl_file), $arg); // 2단계로 root로부터 경로를 체크 - if(!file_exists($filename)) $filename = './'.$arg; - if(!file_exists($filename)) return; + if(!file_exists($source_filename)) $source_filename = './'.$arg; + if(!file_exists($source_filename)) return; // path, filename으로 분리 - $tmp_arr = explode('/', $filename); + $tmp_arr = explode('/', $source_filename); $filename = array_pop($tmp_arr); $path = implode('/', $tmp_arr).'/'; + // 원본 파일을 읽음 + $include_buff = FileHandler::readFile($source_filename); + // include 시도 $output = sprintf( - 'compile(\'%s\',\'%s\');%s'. - '?>%s', - "\n", - "\n", - $path, - $filename, - "\n", - "\n" + ''. + '%s%s'. + 'compile(\'%s\',\'%s\');%s'. + ' } ?>%s', + + "\n", + + $source_filename, time(), "\n", + + $include_buff, "\n", + + "\n", + + $path, $filename, "\n", + + "\n" ); + return $output; } diff --git a/common/js/xml_js_filter.js b/common/js/xml_js_filter.js index 130ca56fd..0dfe1b9be 100644 --- a/common/js/xml_js_filter.js +++ b/common/js/xml_js_filter.js @@ -181,7 +181,7 @@ function XmlJsFilterExecuteFilter(filter, value) { return regx.test(value); break; case "alpha_number" : - var regx = /^[a-zA-Z0-9]*$/; + var regx = /^[a-zA-Z0-9\_]*$/; return regx.test(value); break; case "number" : diff --git a/modules/board/lang/ko.lang.php b/modules/board/lang/ko.lang.php index ffb4fd808..b0f2a5204 100644 --- a/modules/board/lang/ko.lang.php +++ b/modules/board/lang/ko.lang.php @@ -26,7 +26,7 @@ $lang->skin_maker_homepage = '홈페이지'; // 주절 주절.. - $lang->about_mid = '모듈이름은 http://주소/?mid=모듈이름 처럼 직접 호출할 수 있는 값입니다. (영문+숫자만 가능)'; + $lang->about_mid = '모듈이름은 http://주소/?mid=모듈이름 처럼 직접 호출할 수 있는 값입니다. (영문+숫자+_ 만 가능)'; $lang->about_category = '분류를 통한 관리를 할 수 있도록 합니다. 모듈 분류의 관리는 모듈관리 > 모듈카테고리에서 하실 수 있습니다.'; $lang->about_browser_title = '브라우저의 제목에 나타나는 값입니다. RSS/Trackback에서도 사용됩니다.'; $lang->about_description= '관리용으로 사용되는 설명입니다';