aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorrub <rub@piwigo.org>2006-12-30 22:34:38 +0000
committerrub <rub@piwigo.org>2006-12-30 22:34:38 +0000
commit39d974b250ea4f3bd5e0057f2a1fe667274c0860 (patch)
tree3672771b7e212ead7159faa572821a08804c5713 /include
parentbec5bbec36e565ca8793d5006cbd7db572d7511f (diff)
Feature Issue ID 0000601: Filter all public pages with only recent elements
Fix problem with 0 category on filtered result git-svn-id: http://piwigo.org/svn/trunk@1684 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r--include/filter.inc.php21
1 files changed, 19 insertions, 2 deletions
diff --git a/include/filter.inc.php b/include/filter.inc.php
index fd3bf0cda..dd70774a5 100644
--- a/include/filter.inc.php
+++ b/include/filter.inc.php
@@ -70,7 +70,15 @@ if ($filter['enabled'])
// Need to compute dats
$filter['check_key'] = get_filter_check_key();
$filter['categories'] = get_computed_categories($user['id'], $user['forbidden_categories'], true, $user['recent_period']);
- $filter['visible_categories'] = implode(',', array_keys($filter['categories']));
+ if (count($filter['categories']) > 0)
+ {
+ $filter['visible_categories'] = implode(',', array_keys($filter['categories']));
+ }
+ else
+ {
+ // Must be not empty
+ $filter['visible_categories'] = -1;
+ }
$query ='
SELECT
@@ -87,7 +95,16 @@ WHERE ';
date_available > SUBDATE(
CURRENT_DATE,INTERVAL '.$user['recent_period'].' DAY)';
- $filter['visible_images'] = implode(',', array_from_query($query, 'image_id'));
+ if (count($filter['visible_images']) > 0)
+ {
+ $filter['visible_images'] = implode(',', array_from_query($query, 'image_id'));
+ }
+ else
+ {
+ // Must be not empty
+ $filter['visible_images'] = -1;
+ }
+
}
else
{