diff options
| author | Greg Roach <fisharebest@gmail.com> | 2017-11-25 21:27:14 +0000 |
|---|---|---|
| committer | Greg Roach <fisharebest@gmail.com> | 2017-11-25 21:27:14 +0000 |
| commit | 7f6d5696ae2bdcc40efc4da56265761fa7485eb6 (patch) | |
| tree | cf52f8cae58b420b926c0ce06dd14afbc900ab6c /admin_media_upload.php | |
| parent | 3652be65cd8716e23fbdcd26714694cc71088c60 (diff) | |
| download | webtrees-7f6d5696ae2bdcc40efc4da56265761fa7485eb6.tar.gz webtrees-7f6d5696ae2bdcc40efc4da56265761fa7485eb6.tar.bz2 webtrees-7f6d5696ae2bdcc40efc4da56265761fa7485eb6.zip | |
Remove old thumbnail code
Diffstat (limited to 'admin_media_upload.php')
| -rw-r--r-- | admin_media_upload.php | 35 |
1 files changed, 1 insertions, 34 deletions
diff --git a/admin_media_upload.php b/admin_media_upload.php index 033f41d448..f66d31662a 100644 --- a/admin_media_upload.php +++ b/admin_media_upload.php @@ -35,7 +35,7 @@ $action = Filter::post('action'); if ($action == 'upload') { for ($i = 1; $i < 6; $i++) { - if (!empty($_FILES['mediafile' . $i]['name']) || !empty($_FILES['thumbnail' . $i]['name'])) { + if (!empty($_FILES['mediafile' . $i]['name'])) { $folder = Filter::post('folder' . $i); // Validate the media folder @@ -86,19 +86,6 @@ if ($action == 'upload') { } } - // A thumbnail file with no main image? - if (!empty($_FILES['thumbnail' . $i]['name']) && empty($_FILES['mediafile' . $i]['name'])) { - // Assume the user used the wrong field, and treat this as a main image - $_FILES['mediafile' . $i] = $_FILES['thumbnail' . $i]; - unset($_FILES['thumbnail' . $i]); - } - - // Thumbnail files must contain images. - if (!empty($_FILES['thumbnail' . $i]['name']) && !preg_match('/^image\/(png|gif|jpeg)/', $_FILES['thumbnail' . $i]['type'])) { - FlashMessages::addMessage(I18N::translate('Thumbnail files must contain images.')); - break; - } - // User-specified filename? $filename = Filter::post('filename' . $i); // Use the name of the uploaded file? @@ -144,17 +131,6 @@ if ($action == 'upload') { $filename = ''; break; } - - // Now copy the (optional thumbnail) - if (!empty($_FILES['thumbnail' . $i]['name']) && preg_match('/^image\/(png|gif|jpeg)/', $_FILES['thumbnail' . $i]['type'], $match)) { - $extension = $match[1]; - $thumbFile = preg_replace('/\.[a-z0-9]{3,5}$/', '.' . $extension, $fileName); - $serverFileName = WT_DATA_DIR . $MEDIA_DIRECTORY . 'thumbs/' . $folderName . $thumbFile; - if (move_uploaded_file($_FILES['thumbnail' . $i]['tmp_name'], $serverFileName)) { - FlashMessages::addMessage(I18N::translate('The file %s has been uploaded.', Html::filename($serverFileName))); - Log::addMediaLog('Thumbnail file ' . $serverFileName . ' uploaded'); - } - } } } } @@ -198,15 +174,6 @@ for ($i = 1; $i < 6; $i++) { echo '<td>'; echo '<input name="mediafile', $i, '" type="file" size="40">'; echo '</td></tr>'; - echo '<tr><td>'; - echo I18N::translate('Thumbnail to upload'); - echo '</td>'; - echo '<td>'; - echo '<input name="thumbnail', $i, '" type="file" size="40">'; - if ($i === 1) { - echo '<p class="small text-muted">', I18N::translate('Choose the thumbnail image that you want to upload. Although thumbnails can be generated automatically for images, you may wish to generate your own thumbnail, especially for other media types. For example, you can provide a still image from a video, or a photograph of the individual who made an audio recording.'), '</p>'; - } - echo '</td></tr>'; if (Auth::isManager($WT_TREE)) { echo '<tr><td>'; |
