Changeset 17677 for extensions/SmartAlbums/include
- Timestamp:
- Aug 31, 2012, 12:58:56 PM (12 years ago)
- Location:
- extensions/SmartAlbums/include
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/SmartAlbums/include/count_images.php
r16104 r17677 11 11 if (!is_admin()) die('Hacking attempt!'); 12 12 13 include_once(PHPWG_ROOT_PATH.'admin/include/functions.php');14 include_once(SMART_PATH.'include/functions.inc.php');15 16 load_language('plugin.lang', SMART_PATH);17 $conf['SmartAlbums'] = unserialize($conf['SmartAlbums']);18 13 19 14 if (isset($_POST['filters'])) -
extensions/SmartAlbums/include/functions.inc.php
r17013 r17677 254 254 } 255 255 256 // album 257 case 'album': 258 { 259 switch ($filter['cond']) 260 { 261 // search images existing in all albums 262 case 'all': 263 { 264 $albums_arr = explode(',', $filter['value']); 265 foreach($albums_arr as $value) 266 { 267 $sub_query = ' 268 SELECT image_id 269 FROM '.IMAGE_CATEGORY_TABLE.' 270 WHERE category_id = '.$value.' 271 '; 272 $where[] = 'i.id IN ('.$sub_query.')'; 273 } 274 275 break; 276 } 277 // search images existing in one of these albums 278 case 'one': 279 { 280 $sub_query = ' 281 SELECT image_id 282 FROM '.IMAGE_CATEGORY_TABLE.' 283 WHERE category_id IN('.$filter['value'].') 284 '; 285 $where[] = 'i.id IN ('.$sub_query.')'; 286 287 break; 288 } 289 // exclude images existing in one of these albums 290 case 'none': 291 { 292 $sub_query = ' 293 SELECT image_id 294 FROM '.IMAGE_CATEGORY_TABLE.' 295 WHERE category_id IN('.$filter['value'].') 296 '; 297 $where[] = 'i.id NOT IN ('.$sub_query.')'; 298 299 break; 300 } 301 // exclude images existing on other albums, and search images existing in all albums 302 case 'only': 303 { 304 $sub_query = ' 305 SELECT image_id 306 FROM '.IMAGE_CATEGORY_TABLE.' 307 WHERE category_id NOT IN('.$filter['value'].') 308 '; 309 $where[] = 'i.id NOT IN ('.$sub_query.')'; 310 311 $albums_arr = explode(',', $filter['value']); 312 foreach($albums_arr as $value) 313 { 314 $sub_query = ' 315 SELECT image_id 316 FROM '.IMAGE_CATEGORY_TABLE.' 317 WHERE category_id = '.$value.' 318 '; 319 $where[] = 'i.id IN ('.$sub_query.')'; 320 } 321 322 break; 323 } 324 } 325 326 break; 327 } 328 256 329 // author 257 330 case 'author': … … 398 471 $error = true; 399 472 array_push($page['errors'], l10n('Name is empty')); 473 } 474 } 475 # album 476 else if ($filter['type'] == 'album') 477 { 478 if (@$filter['value'] == null) 479 { 480 $error = true; 481 array_push($page['errors'], l10n('No album selected')); 482 } 483 else 484 { 485 $filter['value'] = implode(',', $filter['value']); 400 486 } 401 487 }
Note: See TracChangeset
for help on using the changeset viewer.