From 64ba898944da2aaf0a7f5ebe07d96036b88dea68 Mon Sep 17 00:00:00 2001 From: plegall Date: Wed, 17 Aug 2011 19:56:07 +0000 Subject: feature 2406 added: if the user wants a new album in the upload form, the album is created before the start of the upload. The ergonomy is now simpler, the page is smaller and cleaner. bug 2373 fixed: now that album is created before upload, uploadify.php gets the category_id and the level: as soon as it is uploaded (function add_uploaded_file) the photo gets its final privacy level and is directly associated to the album. This way, we can have an error on a photo without making orphan all photos of the same upload group. feature 2405 added: as soon as a photo is uploaded, its thumbnail is displayed in the "Uploaded Photos" fieldset, without waiting for other photos to be uploaded. The latest photos comes first. I have slighlty changed the integration of colorbox in core. Now we have 2 styles available and by default, we use style2 (overlay in black, title and control icons outside the popup). It is also used for zooming on bulk manager in unit mode. display change: on each uploading photos, instead of showing the transfer speed, we display the transfer progression in % bug fixed: the color of the "Start Upload" button was not correct because the button was not a submit button but a simple type=button. language: "Upload" button becomes "Start Upload" button. git-svn-id: http://piwigo.org/svn/trunk@11962 68402e56-0260-453c-a942-63ccdbb3a9ee --- admin/include/uploadify/uploadify.php | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) (limited to 'admin/include/uploadify') diff --git a/admin/include/uploadify/uploadify.php b/admin/include/uploadify/uploadify.php index 8b3f49bb5..948280d90 100644 --- a/admin/include/uploadify/uploadify.php +++ b/admin/include/uploadify/uploadify.php @@ -19,7 +19,7 @@ echo '$user'."\n"; print_r($user); $tmp = ob_get_contents(); ob_end_clean(); -// error_log($tmp, 3, "/tmp/php-".date('YmdHis').'-'.sprintf('%020u', rand()).".log"); +error_log($tmp, 3, "/tmp/php-".date('YmdHis').'-'.sprintf('%020u', rand()).".log"); if ($_FILES['Filedata']['error'] !== UPLOAD_ERR_OK) { @@ -43,8 +43,8 @@ ob_start(); $image_id = add_uploaded_file( $_FILES['Filedata']['tmp_name'], $_FILES['Filedata']['name'], - null, - 8 + array($_POST['category_id']), + $_POST['level'] ); if (!isset($_SESSION['uploads'])) @@ -62,12 +62,31 @@ array_push( $image_id ); +$query = ' +SELECT + id, + path, + tn_ext + FROM '.IMAGES_TABLE.' + WHERE id = '.$image_id.' +;'; +$image_infos = pwg_db_fetch_assoc(pwg_query($query)); + +$thumbnail_url = preg_replace('#^'.PHPWG_ROOT_PATH.'#', './', get_thumbnail_url($image_infos)); + +$return = array( + 'image_id' => $image_id, + 'category_id' => $_POST['category_id'], + 'thumbnail_url' => $thumbnail_url, + ); + $output = ob_get_contents(); ob_end_clean(); if (!empty($output)) { add_upload_error($_POST['upload_id'], $output); + $return['error_message'] = $output; } -echo "1"; +echo json_encode($return); ?> \ No newline at end of file -- cgit v1.2.3