Changeset 18988 for trunk/admin/batch_manager.php
- Timestamp:
- Nov 10, 2012, 9:10:01 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/batch_manager.php
r18758 r18988 101 101 } 102 102 } 103 } 104 105 if (isset($_POST['filter_ratio_use'])) 106 { 107 foreach (array('min','max') as $type) 108 { 109 if ( preg_match('#^[0-9\.,]+$#', $_POST['filter_ratio_'. $type ]) ) 103 foreach (array('min_ratio','max_ratio') as $type) 104 { 105 if ( preg_match('#^[0-9\.]+$#', $_POST['filter_dimension_'. $type ]) ) 110 106 { 111 $_SESSION['bulk_manager_filter'][' ratio'][$type] = str_replace(',','.',$_POST['filter_ratio_'. $type ]);107 $_SESSION['bulk_manager_filter']['dimension'][$type] = $_POST['filter_dimension_'. $type ]; 112 108 } 113 109 } … … 350 346 } 351 347 352 if (isset($_SESSION['bulk_manager_filter']['dimension']) or isset($_SESSION['bulk_manager_filter']['ratio']))348 if (isset($_SESSION['bulk_manager_filter']['dimension'])) 353 349 { 354 350 $where_clauses = array(); … … 369 365 $where_clause[] = 'height <= '.$_SESSION['bulk_manager_filter']['dimension']['max_height']; 370 366 } 371 if (isset($_SESSION['bulk_manager_filter'][' ratio']['min']))372 { 373 $where_clause[] = 'width/height >= '.$_SESSION['bulk_manager_filter'][' ratio']['min'];374 } 375 if (isset($_SESSION['bulk_manager_filter'][' ratio']['max']))376 { 377 $where_clause[] = 'width/height <= '.$_SESSION['bulk_manager_filter'][' ratio']['max'];367 if (isset($_SESSION['bulk_manager_filter']['dimension']['min_ratio'])) 368 { 369 $where_clause[] = 'width/height >= '.$_SESSION['bulk_manager_filter']['dimension']['min_ratio']; 370 } 371 if (isset($_SESSION['bulk_manager_filter']['dimension']['max_ratio'])) 372 { 373 $where_clause[] = 'width/height <= '.$_SESSION['bulk_manager_filter']['dimension']['max_ratio']; 378 374 } 379 375 … … 444 440 445 441 // +-----------------------------------------------------------------------+ 442 // | dimensions | 443 // +-----------------------------------------------------------------------+ 444 $query = ' 445 SELECT 446 MIN(width) as min_width, 447 MAX(width) as max_width, 448 MIN(height) as min_height, 449 MAX(height) as max_height, 450 MIN(width/height) as min_ratio, 451 MAX(width/height) as max_ratio 452 FROM '.IMAGES_TABLE.' 453 ;'; 454 $dimensions['bounds'] = pwg_db_fetch_assoc(pwg_query($query)); 455 $dimensions['bounds']['min_ratio'] = floor($dimensions['bounds']['min_ratio']*100)/100; 456 $dimensions['bounds']['max_ratio'] = ceil($dimensions['bounds']['max_ratio']*100)/100; 457 458 foreach (array_keys($dimensions['bounds']) as $type) 459 { 460 $dimensions['selected'][$type] = isset($_SESSION['bulk_manager_filter']['dimension'][$type]) ? $_SESSION['bulk_manager_filter']['dimension'][$type] : $dimensions['bounds'][$type]; 461 } 462 $template->assign('dimensions', $dimensions); 463 464 465 // +-----------------------------------------------------------------------+ 446 466 // | open specific mode | 447 467 // +-----------------------------------------------------------------------+
Note: See TracChangeset
for help on using the changeset viewer.