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

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

updated for Piwigo 2.4
new filters : name, author, level, hits

File size: 1.0 KB
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');
10
11if (!is_admin()) die('Hacking attempt!');
12
13include_once(PHPWG_ROOT_PATH.'admin/include/functions.php');
14include_once(SMART_PATH.'include/functions.inc.php');
15
16load_language('plugin.lang', SMART_PATH);
17$conf['SmartAlbums'] = unserialize($conf['SmartAlbums']);
18
19if (isset($_POST['filters']))
20{
21  $filters = array();
22  $page['errors'] = array();
23  $limit_is_set = false;
24 
25  foreach ($_POST['filters'] as $filter)
26  {
27    if (($filter = smart_check_filter($filter)) != false)
28    {
29      array_push($filters, $filter);
30    }
31    else
32    {
33      echo '<span class="filter_error">'.$page['errors'][ count($page['errors'])-1 ].'</span>';
34      exit;
35    }
36  }
37
38  $associated_images = smart_get_pictures($_POST['cat_id'], $filters);
39}
40else
41{
42  $associated_images = array();
43}
44
45echo '<span class="count_image">'.l10n_dec('%d photo', '%d photos', count($associated_images)).'</span>';
46
47?>
Note: See TracBrowser for help on using the repository browser.