Changeset 8404 for trunk/admin/batch_manager.php
- Timestamp:
- Dec 31, 2010, 1:34:01 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/batch_manager.php
r8403 r8404 55 55 if (isset($_POST['filter_prefilter_use'])) 56 56 { 57 $prefilters = array('caddie', 'last import', 'with no album', 'with no tag', 'with no virtual album' );57 $prefilters = array('caddie', 'last import', 'with no album', 'with no tag', 'with no virtual album', 'duplicates'); 58 58 if (in_array($_POST['filter_prefilter'], $prefilters)) 59 59 { … … 174 174 $filter_sets, 175 175 array_diff($all_elements, $linked_to_virtual) 176 ); 177 } 178 179 if ('duplicates' == $_SESSION['bulk_manager_filter']['prefilter']) 180 { 181 // we could use the group_concat MySQL function to retrieve the list of 182 // image_ids but it would not be compatible with PostgreSQL, so let's 183 // perform 2 queries instead. We hope there are not too many duplicates. 184 185 $query = ' 186 SELECT file 187 FROM '.IMAGES_TABLE.' 188 GROUP BY file 189 HAVING COUNT(*) > 1 190 ;'; 191 $duplicate_files = array_from_query($query, 'file'); 192 193 $query = ' 194 SELECT id 195 FROM '.IMAGES_TABLE.' 196 WHERE file IN (\''.implode("','", $duplicate_files).'\') 197 ;'; 198 199 array_push( 200 $filter_sets, 201 array_from_query($query, 'id') 176 202 ); 177 203 }
Note: See TracChangeset
for help on using the changeset viewer.