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

Last change on this file since 17821 was 17821, checked in by mistic100, 12 years ago

Warning undefined function get_tag_ids() on quick count button

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