mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-08 03:01:43 +09:00
게시물 이동시 썸네일 생성이 안되던 문제를 근본적으로 해결. 썸네일 생성시 DB에서 데이터를 가져와서 처리하도록 변경. 부하가 클수 있겠지만 캐싱이 되기에 데이터의 안정성을 우선시 하도록 함
git-svn-id: http://xe-core.googlecode.com/svn/sandbox@2609 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
2c9656ff0a
commit
f9647abc98
2 changed files with 12 additions and 9 deletions
|
|
@ -40,6 +40,8 @@
|
|||
* @brief 특정 게시물들의 소속 모듈 변경 (게시글 이동시에 사용)
|
||||
**/
|
||||
function moveDocumentModule($document_srl_list, $module_srl, $source_module_srl) {
|
||||
if(!count($document_srl_list)) return;
|
||||
|
||||
$args->document_srls = implode(',',$document_srl_list);
|
||||
$args->module_srl = $module_srl;
|
||||
|
||||
|
|
|
|||
|
|
@ -299,17 +299,18 @@
|
|||
FileHandler::writeFile($thumbnail_file, '', 'w');
|
||||
|
||||
// 첨부파일이 있는지 확인하고 있으면 썸네일 만듬
|
||||
$file_list = FileHandler::readDir($document_path);
|
||||
$oFile = &getModel('file');
|
||||
$file_list = $oFile->getFiles($this->document_srl);
|
||||
if(count($file_list)) {
|
||||
foreach($file_list as $key => $val) {
|
||||
if(eregi("^thumbnail_([0-9]+)\.(jpg|gif)$",$val)) continue;
|
||||
if(!eregi("\.(jpg|gif|png|jpeg)$", $val)) continue;
|
||||
foreach($file_list as $file) {
|
||||
if($file->direct_download!='Y') continue;
|
||||
if(!eregi("(jpg|png|jpeg|gif)$",$file->source_filename)) continue;
|
||||
|
||||
$filename = sprintf("%s%s",$document_path,$val);
|
||||
if(file_exists($filename)) {
|
||||
FileHandler::createImageFile($filename, $thumbnail_file, $width, $width, 'jpg');
|
||||
if(file_exists($thumbnail_file)) return Context::getRequestUri().$thumbnail_file;
|
||||
}
|
||||
$filename = $file->uploaded_filename;
|
||||
if(!file_exists($filename)) continue;
|
||||
|
||||
FileHandler::createImageFile($filename, $thumbnail_file, $width, $width, 'jpg');
|
||||
if(file_exists($thumbnail_file)) return Context::getRequestUri().$thumbnail_file;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue