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

Last change on this file since 26442 was 26442, checked in by mistic100, 10 years ago

update for Piwigo 2.6

File size: 867 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
12is_admin() or 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      $filters[] = $filter;
26    }
27    else
28    {
29      echo '<span class="filter_error">'. array_pop($page['errors']) .'</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.