#177 상품이미지 썸네일 삭제 코드 추가

This commit is contained in:
chicpro
2013-05-14 18:30:05 +09:00
parent 6f3518e21c
commit 9c032b13e2
2 changed files with 98 additions and 31 deletions

View File

@ -912,6 +912,23 @@ function get_sns_share_link($sns, $url, $title, $img)
return $str;
}
// 상품이미지 썸네일 삭제
function delete_item_thumbnail($dir, $file)
{
if(!$dir || !$file)
return;
$filename = preg_replace("/\.[^\.]+$/i", "", $file); // 확장자제거
$files = glob($dir.'/thumb-'.$filename.'*');
if(is_array($files)) {
foreach($files as $thumb_file) {
@unlink($thumb_file);
}
}
}
//==============================================================================
// 쇼핑몰 함수 모음 끝
//==============================================================================