mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-07 10:41:40 +09:00
썸네일 생성시 빈 이미지라든지 zbxe 기본 이미지의 경우 썸네일이 없다고 판단하도록 코드 수정
git-svn-id: http://xe-core.googlecode.com/svn/sandbox@2899 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
e61624998f
commit
96bf5673f2
1 changed files with 14 additions and 12 deletions
|
|
@ -382,25 +382,27 @@
|
|||
// 첨부파일이 없으면 내용에서 추출
|
||||
$content = $this->get('content');
|
||||
|
||||
$target_src = null;
|
||||
preg_match_all("!http:\/\/([^ ^\"^']*?)\.(jpg|png|gif|jpeg)!is", $content, $matches, PREG_SET_ORDER);
|
||||
for($i=0;$i<count($matches);$i++) {
|
||||
$src = $matches[$i][0];
|
||||
if(strpos($src,"/common/tpl")!==false || strpos($src,"/modules")!==false) continue;
|
||||
break;
|
||||
if(ereg('\/(common|modules|widgets|addons|layouts)\/', $src)) continue;
|
||||
else {
|
||||
$target_src = $src;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$tmp_file = sprintf('%sthumbnail_%d.tmp.jpg', $document_path, $width);
|
||||
|
||||
if($src) FileHandler::getRemoteFile($src, $tmp_file);
|
||||
else {
|
||||
FileHandler::writeFile($thumbnail_file,'');
|
||||
return;
|
||||
if($target_src) {
|
||||
$tmp_file = sprintf('%sthumbnail_%d.tmp.jpg', $document_path, $width);
|
||||
FileHandler::getRemoteFile($target_src, $tmp_file);
|
||||
FileHandler::createImageFile($tmp_file, $thumbnail_file, $width, $height, 'jpg', $config->thumbnail_type);
|
||||
@unlink($tmp_file);
|
||||
return Context::getRequestUri().$thumbnail_file;
|
||||
}
|
||||
|
||||
FileHandler::createImageFile($tmp_file, $thumbnail_file, $width, $height, 'jpg', $config->thumbnail_type);
|
||||
@unlink($tmp_file);
|
||||
|
||||
return Context::getRequestUri().$thumbnail_file;
|
||||
FileHandler::writeFile($thumbnail_file,'');
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue