'; print_r($_FILES); echo ''; exit(); $starttime = get_moment(); foreach ($_FILES['image_upload']['error'] as $idx => $error) { if (UPLOAD_ERR_OK == $error) { $source_filepath = $_FILES['image_upload']['tmp_name'][$idx]; $original_filename = $_FILES['image_upload']['name'][$idx]; add_uploaded_file($source_filepath, $original_filename, array($_POST['category'])); } } $endtime = get_moment(); $elapsed = ($endtime - $starttime) * 1000; // printf('%.2f ms', $elapsed); } // +-----------------------------------------------------------------------+ // | template init | // +-----------------------------------------------------------------------+ $template->set_filenames( array( 'plugin_admin_content' => dirname(__FILE__).'/upload.tpl' ) ); $template->assign( array( 'F_ADD_ACTION'=> $admin_base_url, 'plugin_path' => UPLOAD_FORM_PATH, ) ); $query = ' SELECT id,name,uppercats,global_rank FROM '.CATEGORIES_TABLE.' ;'; display_select_cat_wrapper( $query, array(), 'category_options' ); // +-----------------------------------------------------------------------+ // | setup errors | // +-----------------------------------------------------------------------+ $setup_errors = array(); $upload_base_dir = 'upload'; $upload_dir = PHPWG_ROOT_PATH.$upload_base_dir; if (!is_dir($upload_dir)) { if (!is_writable(PHPWG_ROOT_PATH)) { array_push( $setup_errors, sprintf( l10n('Create the "%s" directory at the root of your Piwigo installation'), $upload_base_dir ) ); } } else { if (!is_writable($upload_dir)) { @chmod($upload_dir, 0777); if (!is_writable($upload_dir)) { array_push( $setup_errors, sprintf( l10n('Give write access (chmod 777) to "%s" directory at the root of your Piwigo installation'), $upload_base_dir ) ); } } } $template->assign( array( 'setup_errors'=> $setup_errors, ) ); // +-----------------------------------------------------------------------+ // | sending html code | // +-----------------------------------------------------------------------+ $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content'); ?>