Пример #1
0
 function deleteFileThumbnail($filename, $small = 0, $medium = 0, $large = 0)
 {
     //Get folder variables from Helper
     $path = PhocaGalleryHelper::getPathSet();
     $filename_orig_path = str_replace(DS, '/', JPath::clean($path['orig_abs_ds'] . $filename));
     $filename_orig = PhocaGalleryHelper::getTitleFromFilenameWithExt($filename);
     if ($small == 1) {
         $filename_thumbs = PhocaGalleryHelper::getThumbnailName($filename, 'small');
         //$filename_thumbs = str_replace ($filename_orig, 'thumbs/' . $filename_thumbs, $filename_orig_path);
         if (JFile::exists($filename_thumbs['abs'])) {
             JFile::delete($filename_thumbs['abs']);
         }
     }
     if ($medium == 1) {
         $filename_thumbm = PhocaGalleryHelper::getThumbnailName($filename, 'medium');
         //$filename_thumbm = str_replace ($filename_orig, 'thumbs/' . $filename_thumbm, $filename_orig_path);
         if (JFile::exists($filename_thumbm['abs'])) {
             JFile::delete($filename_thumbm['abs']);
         }
     }
     if ($large == 1) {
         $filename_thumbl = PhocaGalleryHelper::getThumbnailName($filename, 'large');
         //$filename_thumbl = str_replace ($filename_orig, 'thumbs/' . $filename_thumbl, $filename_orig_path);
         if (JFile::exists($filename_thumbl['abs'])) {
             JFile::delete($filename_thumbl['abs']);
         }
     }
     return true;
 }