Changeset 4897 for extensions/upload_form
- Timestamp:
- Feb 16, 2010, 11:32:20 PM (14 years ago)
- Location:
- extensions/upload_form
- Files:
-
- 4 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/upload_form/include/functions_upload.inc.php
r4875 r4897 18 18 // 4) register in database 19 19 20 $page['max_width'] = 800;21 $page['max_height'] = 800;22 23 $page['thumb_width'] = 128;24 $page['thumb_height'] = 96;25 26 $page['source_file'] = '/home/pierrick/public_html/test/resize/phpthumb/examples/statue_small.jpg';27 28 20 function add_uploaded_file($source_filepath, $original_filename=null, $categories=null, $level=null) 29 21 { 30 global $ page;22 global $conf; 31 23 32 24 // current date … … 59 51 } 60 52 61 if (need_resize($file_path, $page['max_width'], $page['max_height'])) 53 if ($conf['upload_form_websize_resize'] 54 and need_resize($file_path, $conf['upload_form_websize_maxwidth'], $conf['upload_form_websize_maxheight'])) 62 55 { 63 56 $high_path = file_path_for_type($file_path, 'high'); … … 68 61 $high_infos = pwg_image_infos($high_path); 69 62 70 pwg_image_resize($high_path, $file_path, $page['max_width'], $page['max_height']); 63 pwg_image_resize( 64 $high_path, 65 $file_path, 66 $conf['upload_form_websize_maxwidth'], 67 $conf['upload_form_websize_maxheight'], 68 $conf['upload_form_websize_quality'] 69 ); 71 70 } 72 71 … … 76 75 $thumb_dir = dirname($thumb_path); 77 76 prepare_directory($thumb_dir); 78 pwg_image_resize($file_path, $thumb_path, $page['thumb_width'], $page['thumb_height']); 77 78 pwg_image_resize( 79 $file_path, 80 $thumb_path, 81 $conf['upload_form_thumb_maxwidth'], 82 $conf['upload_form_thumb_maxheight'], 83 $conf['upload_form_thumb_quality'] 84 ); 85 79 86 $thumb_infos = pwg_image_infos($thumb_path); 80 87 … … 163 170 } 164 171 165 function pwg_image_resize($source_filepath, $destination_filepath, $max_width, $max_height )172 function pwg_image_resize($source_filepath, $destination_filepath, $max_width, $max_height, $quality) 166 173 { 167 174 if (!function_exists('gd_info')) … … 230 237 ); 231 238 232 imagejpeg($destination_image, $destination_filepath, 95);239 imagejpeg($destination_image, $destination_filepath, $quality); 233 240 // freeing memory ressources 234 241 imagedestroy($source_image); -
extensions/upload_form/language/en_UK/plugin.lang.php
r4895 r4897 42 42 $lang['... or switch to the old style form'] = '... or switch to the old style form'; 43 43 $lang['... or switch to the multiple files form'] = '... or switch to the multiple files form'; 44 45 $lang['The websize maximum width must be a number between %d and %d'] = 'The websize maximum width must be a number between %d and %d'; 46 $lang['The websize maximum height must be a number between %d and %d'] = 'The websize maximum height must be a number between %d and %d'; 47 $lang['The websize image quality must be a number between %d and %d'] = 'The websize image quality must be a number between %d and %d'; 48 $lang['The thumbnail maximum width must be a number between %d and %d'] = 'The thumbnail maximum width must be a number between %d and %d'; 49 $lang['The thumbnail maximum height must be a number between %d and %d'] = 'The thumbnail maximum height must be a number between %d and %d'; 50 $lang['The thumbnail image quality must be a number between %d and %d'] = 'The thumbnail image quality must be a number between %d and %d'; 51 $lang['Settings'] = 'Settings'; 52 $lang['Web size photo'] = 'Web size photo'; 53 $lang['Resize'] = 'Resize'; 54 $lang['Maximum Width'] = 'Maximum Width'; 55 $lang['pixels'] = 'pixels'; 56 $lang['Maximum Height'] = 'Maximum Height'; 57 $lang['Image Quality'] = 'Image Quality'; 58 $lang['Thumbnail'] = 'Thumbnail'; 59 $lang['Save Settings'] = 'Save Settings'; 60 $lang['Your configuration settings are saved'] = 'Your configuration settings are saved'; -
extensions/upload_form/language/fr_FR/plugin.lang.php
r4895 r4897 42 42 $lang['... or switch to the old style form'] = '... ou passer sur le formulaire "à l\'ancienne"'; 43 43 $lang['... or switch to the multiple files form'] = '... ou passer sur le formulaire multi-fichier'; 44 45 $lang['The websize maximum width must be a number between %d and %d'] = 'La largeur maximum pour la photo taille web doit être un chiffre compris entre %d et %d'; 46 $lang['The websize maximum height must be a number between %d and %d'] = 'La hauteur maximum pour la photo taille web doit être un chiffre compris entre %d et %d'; 47 $lang['The websize image quality must be a number between %d and %d'] = 'La qualité d\'image pour la photo taille web doit être un chiffre compris entre %d et %d'; 48 $lang['The thumbnail maximum width must be a number between %d and %d'] = 'La largeur maximum pour la miniature doit être un chiffre compris entre %d et %d'; 49 $lang['The thumbnail maximum height must be a number between %d and %d'] = 'La hauteur maximum pour la miniature doit être un chiffre compris entre %d et %d'; 50 $lang['The thumbnail image quality must be a number between %d and %d'] = 'La qualité d\'image pour la miniature doit être un chiffre compris entre %d et %d'; 51 52 $lang['Settings'] = 'Configuration'; 53 $lang['Web size photo'] = 'Photo taille web'; 54 $lang['Resize'] = 'Redimensionner'; 55 $lang['Maximum Width'] = 'Largeur maximum'; 56 $lang['pixels'] = 'pixels'; 57 $lang['Maximum Height'] = 'Hauteur maximum'; 58 $lang['Image Quality'] = 'Qualité d\'image'; 59 $lang['Thumbnail'] = 'Miniature'; 60 $lang['Save Settings'] = 'Enregistrer les paramètres'; 61 $lang['Your configuration settings are saved'] = 'Vos paramètres de configurations sont enregistrés'; -
extensions/upload_form/main.inc.php
r4739 r4897 25 25 array( 26 26 'NAME' => 'Upload Form', 27 'URL' => get_admin_plugin_menu_link(dirname(__FILE__).'/ upload.php')27 'URL' => get_admin_plugin_menu_link(dirname(__FILE__).'/base.php') 28 28 ) 29 29 ); -
extensions/upload_form/upload.php
r4895 r4897 20 20 // +-----------------------------------------------------------------------+ 21 21 22 if ( !defined("PHPWG_ROOT_PATH"))22 if (!defined('UPLOAD_FORM_BASE_URL')) 23 23 { 24 24 die ("Hacking attempt!"); 25 25 } 26 27 include_once(PHPWG_ROOT_PATH.'admin/include/functions.php');28 include_once(UPLOAD_FORM_PATH.'include/functions_upload.inc.php');29 load_language('plugin.lang', UPLOAD_FORM_PATH);30 31 $admin_base_url = get_root_url().'admin.php?page=plugin§ion=upload_form%2Fupload.php';32 33 // +-----------------------------------------------------------------------+34 // | Check Access and exit when user status is not ok |35 // +-----------------------------------------------------------------------+36 check_status(ACCESS_ADMINISTRATOR);37 26 38 27 // +-----------------------------------------------------------------------+ … … 323 312 } 324 313 325 $page['batch_link'] = $admin_base_url.'&batch='.implode(',', $image_ids);314 $page['batch_link'] = UPLOAD_FORM_BASE_URL.'&batch='.implode(',', $image_ids); 326 315 } 327 316 } … … 330 319 // | template init | 331 320 // +-----------------------------------------------------------------------+ 332 333 $template->set_filenames(334 array(335 'plugin_admin_content' => dirname(__FILE__).'/upload.tpl'336 )337 );338 321 339 322 $template->assign( 340 323 array( 341 'F_ADD_ACTION'=> $admin_base_url,324 'F_ADD_ACTION'=> UPLOAD_FORM_BASE_URL, 342 325 'plugin_path' => UPLOAD_FORM_PATH, 343 326 ) … … 360 343 array( 361 344 'upload_mode' => $upload_mode, 362 'switch_url' => $admin_base_url.'&upload_mode='.$upload_switch,345 'switch_url' => UPLOAD_FORM_BASE_URL.'&upload_mode='.$upload_switch, 363 346 'upload_id' => md5(rand()), 364 347 'session_id' => session_id(), -
extensions/upload_form/upload.tpl
r4895 r4897 56 56 {/if} 57 57 58 {literal} 59 <style> 60 #uploadBoxes P { 61 margin:0; 62 margin-bottom:2px; 63 padding:0; 64 } 65 66 #batchLink { 67 text-align:center; 68 } 69 70 .category_selection { 71 min-height:65px; 72 margin-top:5px; 73 } 74 75 .category_selection TABLE { 76 margin:0; 77 } 78 79 .formField { 80 width:650px; 81 margin:0 auto 20px auto; 82 padding:10px; 83 border: 2px solid #292929; 84 } 85 86 .formFieldTitle { 87 font-weight:bold; 88 margin-bottom:10px; 89 } 90 91 .formField P { 92 margin:0; 93 } 94 </style> 95 {/literal} 96 97 <div class="titrePage" style="height:0"> 58 <div class="titrePage" style="height:25px"> 98 59 <h2>{'Upload Form'|@translate}</h2> 99 60 </div> … … 128 89 <input name="upload_id" value="{$upload_id}" type="hidden"> 129 90 {/if} 130 <fieldset>131 <legend>{'Upload Photos'|@translate}</legend>132 91 133 92 <div class="formField"> … … 157 116 <td>{'Category name'|@translate}</td> 158 117 <td> 159 <input type="text" name="category_name" value="{$F_CATEGORY_NAME}" 118 <input type="text" name="category_name" value="{$F_CATEGORY_NAME}" style="width:400px"> 160 119 </td> 161 120 </tr> … … 209 168 </p> 210 169 {/if} 211 </fieldset>212 170 </form> 213 171 {/if}
Note: See TracChangeset
for help on using the changeset viewer.