Changeset 6625 for trunk/admin/photos_add_direct.php
- Timestamp:
- Jun 29, 2010, 8:42:11 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/photos_add_direct.php
r6622 r6625 63 63 // +-----------------------------------------------------------------------+ 64 64 65 if (isset($_ POST['submit_upload']))65 if (isset($_GET['processed'])) 66 66 { 67 67 // echo '<pre>POST'."\n"; print_r($_POST); echo '</pre>'; … … 69 69 // echo '<pre>SESSION'."\n"; print_r($_SESSION); echo '</pre>'; 70 70 // exit(); 71 72 // sometimes, you have submitted the form but you have nothing in $_POST 73 // and $_FILES. This may happen when you have an HTML upload and you 74 // exceeded the post_max_size (but not the upload_max_size) 75 if (!isset($_POST['submit_upload'])) 76 { 77 array_push( 78 $page['errors'], 79 sprintf( 80 l10n('The uploaded files exceed the post_max_size directive in php.ini: %sB'), 81 ini_get('post_max_size') 82 ) 83 ); 84 } 71 85 72 86 $category_id = null; 73 if ('existing' == $_POST['category_type']) 87 if (!isset($_POST['category_type'])) 88 { 89 // nothing to do, we certainly have the post_max_size issue 90 } 91 elseif ('existing' == $_POST['category_type']) 74 92 { 75 93 $category_id = $_POST['category']; … … 194 212 } 195 213 } 214 else 215 { 216 $error_message = file_upload_error_message($error); 217 218 array_push( 219 $page['errors'], 220 sprintf( 221 l10n('Error on file "%s" : %s'), 222 $_FILES['image_upload']['name'][$idx], 223 $error_message 224 ) 225 ); 226 } 196 227 } 197 228 … … 205 236 { 206 237 // we're on a multiple upload, with uploadify and so on 207 $image_ids = $_SESSION['uploads'][ $_POST['upload_id'] ]; 208 209 associate_images_to_categories( 210 $image_ids, 211 array($category_id) 212 ); 213 214 $query = ' 238 if (isset($_SESSION['uploads_error'][ $_POST['upload_id'] ])) 239 { 240 foreach ($_SESSION['uploads_error'][ $_POST['upload_id'] ] as $error) 241 { 242 array_push($page['errors'], $error); 243 } 244 } 245 246 if (isset($_SESSION['uploads'][ $_POST['upload_id'] ])) 247 { 248 $image_ids = $_SESSION['uploads'][ $_POST['upload_id'] ]; 249 250 associate_images_to_categories( 251 $image_ids, 252 array($category_id) 253 ); 254 255 $query = ' 215 256 UPDATE '.IMAGES_TABLE.' 216 257 SET level = '.$_POST['level'].' 217 258 WHERE id IN ('.implode(', ', $image_ids).') 218 259 ;'; 219 pwg_query($query);260 pwg_query($query); 220 261 221 invalidate_user_cache(); 262 invalidate_user_cache(); 263 } 222 264 } 223 265 … … 326 368 'F_ADD_ACTION'=> PHOTOS_ADD_BASE_URL, 327 369 'uploadify_path' => $uploadify_path, 370 'upload_max_filesize' => min( 371 get_ini_size('upload_max_filesize'), 372 get_ini_size('post_max_size') 373 ), 328 374 ) 329 375 ); … … 346 392 array( 347 393 'upload_mode' => $upload_mode, 394 'form_action' => PHOTOS_ADD_BASE_URL.'&upload_mode='.$upload_mode.'&processed=1', 348 395 'switch_url' => PHOTOS_ADD_BASE_URL.'&upload_mode='.$upload_switch, 349 396 'upload_id' => md5(rand()), 350 397 'session_id' => session_id(), 351 398 'pwg_token' => get_pwg_token(), 399 'another_upload_link' => PHOTOS_ADD_BASE_URL.'&upload_mode='.$upload_mode, 352 400 ) 353 401 ); … … 465 513 } 466 514 515 if (get_ini_size('upload_max_filesize') > get_ini_size('post_max_size')) 516 { 517 array_push( 518 $setup_warnings, 519 sprintf( 520 l10n('In your php.ini file, the upload_max_filesize (%sB) is bigger than post_max_size (%sB), you should change this setting'), 521 get_ini_size('upload_max_filesize', false), 522 get_ini_size('post_max_size', false) 523 ) 524 ); 525 } 526 467 527 $template->assign( 468 528 array(
Note: See TracChangeset
for help on using the changeset viewer.