매니안(manian)님의 의견에 따라 게시물 썸네일 생성 함수에 $height 값을 쓸 수 있도록 수정

git-svn-id: http://xe-core.googlecode.com/svn/sandbox@2633 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
zero 2007-09-20 05:48:00 +00:00
parent 8235bde05b
commit b616291e1a

View file

@ -270,12 +270,14 @@
return $oTrackbackModel->getTrackbackList($this->document_srl, $is_admin); return $oTrackbackModel->getTrackbackList($this->document_srl, $is_admin);
} }
function thumbnailExists($width) { function thumbnailExists($width, $height) {
if(!$this->getThumbnail($width)) return false; if(!$this->getThumbnail($width, $height)) return false;
return true; return true;
} }
function getThumbnail($width = 80) { function getThumbnail($width = 80, $height = 80) {
if(!$height) $height = $width;
// 문서의 이미지 첨부파일 위치를 구함 // 문서의 이미지 첨부파일 위치를 구함
$document_path = sprintf('./files/attach/images/%d/%d/',$this->get('module_srl'), $this->get('document_srl')); $document_path = sprintf('./files/attach/images/%d/%d/',$this->get('module_srl'), $this->get('document_srl'));
if(!is_dir($document_path)) FileHandler::makeDir($document_path); if(!is_dir($document_path)) FileHandler::makeDir($document_path);
@ -309,7 +311,7 @@
$filename = $file->uploaded_filename; $filename = $file->uploaded_filename;
if(!file_exists($filename)) continue; if(!file_exists($filename)) continue;
FileHandler::createImageFile($filename, $thumbnail_file, $width, $width, 'jpg'); FileHandler::createImageFile($filename, $thumbnail_file, $width, $height, 'jpg');
if(file_exists($thumbnail_file)) return Context::getRequestUri().$thumbnail_file; if(file_exists($thumbnail_file)) return Context::getRequestUri().$thumbnail_file;
} }
} }
@ -332,7 +334,7 @@
return; return;
} }
FileHandler::createImageFile($tmp_file, $thumbnail_file, $width, $width, 'jpg'); FileHandler::createImageFile($tmp_file, $thumbnail_file, $width, $height, 'jpg');
@unlink($tmp_file); @unlink($tmp_file);
return Context::getRequestUri().$thumbnail_file; return Context::getRequestUri().$thumbnail_file;