mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-09 20:12:14 +09:00
글을 수정하거나 삭제시에 썸네일 디렉토리를 제거하도록 수정
git-svn-id: http://xe-core.googlecode.com/svn/sandbox@4372 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
60f8e724b9
commit
943b242827
2 changed files with 9 additions and 7 deletions
|
|
@ -265,6 +265,9 @@
|
||||||
// commit
|
// commit
|
||||||
$oDB->commit();
|
$oDB->commit();
|
||||||
|
|
||||||
|
// 썸네일 파일 제거
|
||||||
|
FileHandler::removeDir(sprintf('files/cache/thumbnails/%s',getNumberingPath($obj->document_srl, 3)));
|
||||||
|
|
||||||
$output->add('document_srl',$obj->document_srl);
|
$output->add('document_srl',$obj->document_srl);
|
||||||
return $output;
|
return $output;
|
||||||
}
|
}
|
||||||
|
|
@ -316,6 +319,9 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 썸네일 파일 제거
|
||||||
|
FileHandler::removeDir(sprintf('files/cache/thumbnails/%s',getNumberingPath($document_srl, 3)));
|
||||||
|
|
||||||
// commit
|
// commit
|
||||||
$oDB->commit();
|
$oDB->commit();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -453,14 +453,10 @@
|
||||||
$thumbnail_file = sprintf('%s%dx%d.%s.jpg', $thumbnail_path, $width, $height, $thumbnail_type);
|
$thumbnail_file = sprintf('%s%dx%d.%s.jpg', $thumbnail_path, $width, $height, $thumbnail_type);
|
||||||
$thumbnail_url = Context::getRequestUri().$thumbnail_file;
|
$thumbnail_url = Context::getRequestUri().$thumbnail_file;
|
||||||
|
|
||||||
// 썸네일 파일이 있을 경우 글의 시간과 비교하고 크기를 비교하여 true | false를 return
|
// 썸네일 파일이 있을 경우 파일의 크기가 0 이면 return false 아니면 경로 return
|
||||||
if(file_exists($thumbnail_file)) {
|
if(file_exists($thumbnail_file)) {
|
||||||
$file_created_time = date("YmdHis",filemtime($thumbnail_file));
|
if(filesize($thumbnail_file)<1) return false;
|
||||||
$modified_time = $this->get('last_update');
|
else return $thumbnail_url;
|
||||||
|
|
||||||
// 만약 글의 수정시간보다 이후에 만들어진 썸네일이라면 썸네일 크기에 따라서 경로 또는 빈 문자열을 return
|
|
||||||
if($modified_time < $file_created_time && filesize($thumbnail_file)>0) return $thumbnail_url;
|
|
||||||
else return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 대상 파일
|
// 대상 파일
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue