Ignore:
Timestamp:
07/30/11 06:49:02 (9 years ago)
Author:
rvelices
Message:

feature 2387: addd a filter by tag in the batch manager

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/batch_manager.php

    r11039 r11853  
    6767      $_SESSION['bulk_manager_filter']['category_recursive'] = true; 
    6868    } 
     69  } 
     70 
     71  if (isset($_POST['filter_tags_use'])) 
     72  { 
     73    $_SESSION['bulk_manager_filter']['tags'] = get_tag_ids($_POST['filter_tags'], false); 
    6974  } 
    7075 
     
    291296} 
    292297 
     298if (!empty($_SESSION['bulk_manager_filter']['tags'])) 
     299{ 
     300        $query = ' 
     301SELECT image_id 
     302        FROM '.IMAGE_TAG_TABLE. 
     303        'WHERE tag_id IN('.implode(',',$_SESSION['bulk_manager_filter']['tags']).') 
     304        GROUP BY image_id 
     305        HAVING COUNT(tag_id)='.count($_SESSION['bulk_manager_filter']['tags']); 
     306        array_push( 
     307    $filter_sets, 
     308                get_image_ids_for_tags($_SESSION['bulk_manager_filter']['tags']) 
     309                ); 
     310} 
     311 
    293312$current_set = array_shift($filter_sets); 
    294313foreach ($filter_sets as $set) 
     
    366385 
    367386$query = ' 
    368 SELECT 
    369     id AS tag_id, 
    370     name AS tag_name 
     387SELECT id, name 
    371388  FROM '.TAGS_TABLE.' 
    372389;'; 
Note: See TracChangeset for help on using the changeset viewer.