이모티콘의 경로 위치 변경

git-svn-id: http://xe-core.googlecode.com/svn/sandbox@2544 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
zero 2007-09-06 02:12:12 +00:00
parent d1d2d63a11
commit 7980219f8c
2 changed files with 5 additions and 5 deletions

View file

@ -22,7 +22,7 @@
/** /**
* @brief 재귀적으로 이모티콘이 법한 파일들을 하위 디렉토리까지 전부 검색한다. 8,000개까지는 테스트 해봤는데 스택오버프로우를 일으킬지 어떨지는 모르겠음.(2007.9.6, 베니) * @brief 재귀적으로 이모티콘이 법한 파일들을 하위 디렉토리까지 전부 검색한다. 8,000개까지는 테스트 해봤는데 스택오버프로우를 일으킬지 어떨지는 모르겠음.(2007.9.6, 베니)
**/ **/
function getEmoticons($path) { function getEmoticons($path, $source_path) {
$path = ereg_replace('\/$','',$path); $path = ereg_replace('\/$','',$path);
$output = array(); $output = array();
@ -33,11 +33,11 @@
$new_path = $path.'/'.$file; $new_path = $path.'/'.$file;
if(is_dir($new_path)) { if(is_dir($new_path)) {
$sub_output = $this->getEmoticons($new_path); $sub_output = $this->getEmoticons($new_path, $source_path);
if(is_array($sub_output) && count($sub_output)) $output = array_merge($output, $sub_output); if(is_array($sub_output) && count($sub_output)) $output = array_merge($output, $sub_output);
} }
if(eregi('(jpg|jpeg|gif|png)$',$new_path)) $output[] = $new_path; if(eregi('(jpg|jpeg|gif|png)$',$new_path)) $output[] = str_replace($source_path.'/', '', $new_path);
} }
$oDir->close(); $oDir->close();
@ -58,7 +58,7 @@
// 이모티콘을 모두 가져옴 // 이모티콘을 모두 가져옴
$emoticon_path = sprintf('%s%s/images',eregi_replace('^\.\/','',$this->component_path),'tpl','images'); $emoticon_path = sprintf('%s%s/images',eregi_replace('^\.\/','',$this->component_path),'tpl','images');
$emoticon_list = $this->getEmoticons($emoticon_path); $emoticon_list = $this->getEmoticons($emoticon_path, $emoticon_path);
Context::set('emoticon_list', $emoticon_list); Context::set('emoticon_list', $emoticon_list);
$oTemplate = &TemplateHandler::getInstance(); $oTemplate = &TemplateHandler::getInstance();

View file

@ -8,7 +8,7 @@
<div id="popBody"> <div id="popBody">
<!--@foreach($emoticon_list as $emoticon)--> <!--@foreach($emoticon_list as $emoticon)-->
<img src="{getUrl()}/{$emoticon}" alt="emoticon" onclick="insertEmoticon(this); return false;" class="emoticon" /> <img src="images/{$emoticon}" alt="emoticon" onclick="insertEmoticon(this); return false;" class="emoticon" />
<!--@end--> <!--@end-->
</div> </div>