Changeset 7284 for extensions/gvideo/admin/thumbnails.php
- Timestamp:
- Oct 19, 2010, 11:57:57 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/gvideo/admin/thumbnails.php
r3609 r7284 112 112 { 113 113 $video['thumb_url'] = str_replace('&', '&', $video['thumb_url']); 114 if (($ path = mkget_thumbnail_dir($catpath[$cat], $error)) == false)114 if (($thumb_dir = mkget_thumbnail_dir(dirname($file_path), $error)) == false) 115 115 { 116 116 array_push($page['errors'], l10n('py_error9')); … … 118 118 else 119 119 { 120 $ path .= '/' . $conf['prefix_thumbnail'] . $video['name'] . '.jpg';121 if (file_exists($ path))120 $thumb_path = file_path_for_type($file_path, 'thumb'); 121 if (file_exists($thumb_path)) 122 122 { 123 123 array_push($page['errors'], sprintf(l10n('py_error11'), $path), l10n('py_error9')); … … 125 125 else 126 126 { 127 if (Py_RatioResizeImg($video['thumb_url'], $ path, $_POST['thumb_width'], $_POST['thumb_hight']))127 if (Py_RatioResizeImg($video['thumb_url'], $thumb_path, $_POST['thumb_width'], $_POST['thumb_hight'])) 128 128 { 129 129 array_push($page['infos'], l10n('py_info2')); 130 $thumb_extension = ' "jpg"';130 $thumb_extension = 'jpg'; 131 131 } 132 132 else … … 148 148 { 149 149 $ext = get_extension($_FILES['picture']['name']); 150 if (($ path = mkget_thumbnail_dir($catpath[$cat], $error)) == false)150 if (($thumb_dir = mkget_thumbnail_dir(dirname($file_path), $error)) == false) 151 151 { 152 152 array_push($page['errors'], l10n('py_error9')); … … 154 154 else 155 155 { 156 $ path .= '/' . $conf['prefix_thumbnail'] . $video['name'] . '.' .$ext;157 if (file_exists($ path))156 $thumb_path = get_filename_wo_extension(file_path_for_type($file_path, 'thumb')).'.'.$ext; 157 if (file_exists($thumb_path)) 158 158 { 159 array_push($page['errors'], sprintf(l10n('py_error11'), $ path), l10n('py_error9'));159 array_push($page['errors'], sprintf(l10n('py_error11'), $thumb_path), l10n('py_error9')); 160 160 } 161 161 else 162 162 { 163 if (Py_RatioResizeImg($_FILES['picture']['tmp_name'], $ path, $_POST['thumb_width'], $_POST['thumb_hight']))163 if (Py_RatioResizeImg($_FILES['picture']['tmp_name'], $thumb_path, $_POST['thumb_width'], $_POST['thumb_hight'])) 164 164 { 165 $thumb_extension = "\"$ext\"";165 $thumb_extension = $ext; 166 166 array_push($page['infos'], l10n('py_info2')); 167 167 }
Note: See TracChangeset
for help on using the changeset viewer.