source: extensions/SmartAlbums/include/count_images.php @ 12523

Last change on this file since 12523 was 11334, checked in by mistic100, 13 years ago

private items are not displayed in SmartAlbums (according to user permissions)

File size: 737 bytes
Line 
1<?php
2/**
3 * Count images for AJAX info
4 */
5
6define('PHPWG_ROOT_PATH','./../../../');
7define('IN_ADMIN', true);
8include_once(PHPWG_ROOT_PATH.'include/common.inc.php');
9include_once(PHPWG_ROOT_PATH.'admin/include/functions.php');
10include_once(SMART_PATH.'include/functions.inc.php');
11
12if (isset($_POST['filters']))
13{
14  $filters = array();
15  $page['errors'] = array();
16  $limit_is_set = false;
17 
18  foreach ($_POST['filters'] as $filter)
19  {
20    if (($filter = smart_check_filter($filter)) != false)
21    {
22      array_push($filters, $filter);
23    }
24  }
25
26  $associated_images = smart_get_pictures($_POST['cat_id'], $filters);
27}
28else
29{
30  $associated_images = array();
31}
32
33echo l10n_dec('%d photo', '%d photos', count($associated_images));
34
35?>
Note: See TracBrowser for help on using the repository browser.