Changeset 2579 for trunk/admin/element_set.php
- Timestamp:
- 09/24/08 03:27:49 (5 years ago)
- Files:
-
- 1 modified
-
trunk/admin/element_set.php (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/element_set.php
r2299 r2579 25 25 * Management of elements set. Elements can belong to a category or to the 26 26 * user caddie. 27 * 27 * 28 28 */ 29 29 30 30 if (!defined('PHPWG_ROOT_PATH')) 31 31 { … … 103 103 // To element_set_(global|unit).php, we must provide the elements id of the 104 104 // managed category in $page['cat_elements_id'] array. 105 105 $page['cat_elements_id'] = array(); 106 106 if (is_numeric($_GET['cat'])) 107 107 { … … 112 112 false 113 113 ); 114 114 115 115 $query = ' 116 116 SELECT image_id … … 123 123 { 124 124 $page['title'] = l10n('caddie'); 125 125 126 126 $query = ' 127 127 SELECT element_id … … 134 134 { 135 135 $page['title'] = l10n('Elements_not_linked'); 136 136 137 137 // we are searching elements not linked to any virtual category 138 138 $query = ' … … 160 160 $page['cat_elements_id'] = array_diff($all_elements, $linked_to_virtual); 161 161 } 162 else163 {164 $page['cat_elements_id'] = array();165 }166 162 } 167 163 else if ('duplicates' == $_GET['cat']) 168 164 { 169 165 $page['title'] = l10n('Duplicates'); 170 166 171 167 // we are searching related elements twice or more to physical categories 172 168 // 1 - Retrieve Files 173 169 $query = ' 174 170 SELECT DISTINCT(file) 175 FROM '.IMAGES_TABLE.' 176 GROUP BY file 177 HAVING COUNT(DISTINCT storage_category_id) > 1 178 ;'; 171 FROM '.IMAGES_TABLE.' 172 GROUP BY file 173 HAVING COUNT(DISTINCT storage_category_id) > 1 174 ;'; 179 175 180 176 $duplicate_files = array_from_query($query, 'file'); … … 183 179 $query = ' 184 180 SELECT id, file 185 FROM '.IMAGES_TABLE.' 181 FROM '.IMAGES_TABLE.' 186 182 WHERE file IN (\''.implode("','", $duplicate_files).'\') 187 183 ORDER BY file, id … … 189 185 190 186 $page['cat_elements_id'] = array_from_query($query, 'id'); 191 $page['cat_elements_id'][] = 0; 192 } 187 } 188 elseif ('recent'== $_GET['cat']) 189 { 190 $page['title'] = l10n('recent_pics_cat'); 191 $query = 'SELECT MAX(date_available) AS date 192 FROM '.IMAGES_TABLE; 193 if ($row=mysql_fetch_array( pwg_query($query) ) ) 194 { 195 $query = 'SELECT id 196 FROM '.IMAGES_TABLE.' 197 WHERE date_available BETWEEN DATE_SUB("'.$row['date'].'", INTERVAL 1 DAY) AND "'.$row['date'].'"'; 198 $page['cat_elements_id'] = array_from_query($query, 'id'); 199 } 200 } 201 193 202 // +-----------------------------------------------------------------------+ 194 203 // | first element to display |
![(please configure the [header_logo] section in trac.ini)](http://piwigo.org/screenshots/piwigo_logo_on_white.png)