diff --git a/e107_admin/image.php b/e107_admin/image.php index 1567f2417..276552860 100644 --- a/e107_admin/image.php +++ b/e107_admin/image.php @@ -225,6 +225,8 @@ class media_admin_ui extends e_admin_ui protected $pid = "media_id"; protected $perPage = 10; protected $batchDelete = true; + // protected $defaultOrder = 'desc'; + protected $listOrder = 'm.media_id desc'; // show newest images first. //TODO - finish 'user' type, set 'data' to all editable fields, set 'noedit' for all non-editable fields /* @@ -596,6 +598,7 @@ class media_admin_ui extends e_admin_ui $mes = e107::getMessage(); $sql = e107::getDb(); $tp = e107::getParser(); + if(!count($_POST['batch_selected'])) { @@ -603,10 +606,32 @@ class media_admin_ui extends e_admin_ui return; } + + require(e_HANDLER.'phpthumb/ThumbLib.inc.php'); // For resizing on import. + list($img_import_w,$img_import_h) = explode("x",e107::getPref('img_import_resize')); foreach($_POST['batch_selected'] as $file) { + $oldpath = e_MEDIA."temp/".$file; + + // Resize on Import Routine ------------------------ + if(vartrue($img_import_w) && vartrue($img_import_h)) + { + try + { + $thumb = PhpThumbFactory::create($oldpath); + $thumb->setOptions(array('correctPermissions' => true)); + } + catch (Exception $e) + { + $mes->addError($e->getMessage()); + // return $this; + } + $thumb->resize($img_import_w,$img_import_h)->save($oldpath); + + } + // End Resize routine. --------------------- $f = $fl->get_file_info($oldpath); @@ -883,6 +908,11 @@ if (isset($_POST['update_options'])) $tmp['image_post_class'] = intval($_POST['image_post_class']); $tmp['image_post_disabled_method'] = intval($_POST['image_post_disabled_method']); $tmp['enable_png_image_fix'] = intval($_POST['enable_png_image_fix']); + + if($_POST['img_import_resize_w'] && $_POST['img_import_resize_h']) + { + $tmp['img_import_resize'] = intval($_POST['img_import_resize_w'])."x".intval($_POST['img_import_resize_h']); + } if ($admin_log->logArrayDiffs($tmp, $pref, 'IMALAN_04')) { @@ -1233,7 +1263,7 @@ if (isset($_POST['check_avatar_sizes'])) } $text = " -