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

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

Warning undefined function get_tag_ids() on quick count button

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