source:
extensions/SmartAlbums/include/count_images.php
@
20948
Last change on this file since 20948 was 17821, checked in by , 12 years ago | |
---|---|
File size: 896 bytes |
Rev | Line | |
---|---|---|
[10871] | 1 | <?php |
[10980] | 2 | /** |
3 | * Count images for AJAX info | |
4 | */ | |
5 | ||
[10871] | 6 | define('PHPWG_ROOT_PATH','./../../../'); |
7 | define('IN_ADMIN', true); | |
[16104] | 8 | |
[10871] | 9 | include_once(PHPWG_ROOT_PATH.'include/common.inc.php'); |
[17821] | 10 | include_once(PHPWG_ROOT_PATH.'admin/include/functions.php'); |
[16104] | 11 | |
12 | if (!is_admin()) die('Hacking attempt!'); | |
13 | ||
[10871] | 14 | |
[11290] | 15 | if (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] | 36 | else |
37 | { | |
38 | $associated_images = array(); | |
39 | } | |
[10871] | 40 | |
[16104] | 41 | echo '<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.