aboutsummaryrefslogtreecommitdiffstats
path: root/include/filter.inc.php
diff options
context:
space:
mode:
authorrub <rub@piwigo.org>2006-12-30 22:45:52 +0000
committerrub <rub@piwigo.org>2006-12-30 22:45:52 +0000
commit48879ca17794cb929b0a999a02d39041a7687ca6 (patch)
tree1bf0c5aa17413589fbfa96dc2e3410c290250658 /include/filter.inc.php
parent39d974b250ea4f3bd5e0057f2a1fe667274c0860 (diff)
Feature Issue ID 0000601: Filter all public pages with only recent elements
Fix problem with 0 category on filtered result Big error on my last commit for $filter['visible_images'] git-svn-id: http://piwigo.org/svn/trunk@1685 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'include/filter.inc.php')
-rw-r--r--include/filter.inc.php16
1 files changed, 6 insertions, 10 deletions
diff --git a/include/filter.inc.php b/include/filter.inc.php
index dd70774a5..cca046050 100644
--- a/include/filter.inc.php
+++ b/include/filter.inc.php
@@ -70,11 +70,9 @@ 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']);
- if (count($filter['categories']) > 0)
- {
- $filter['visible_categories'] = implode(',', array_keys($filter['categories']));
- }
- else
+
+ $filter['visible_categories'] = implode(',', array_keys($filter['categories']));
+ if (empty($filter['visible_categories']))
{
// Must be not empty
$filter['visible_categories'] = -1;
@@ -95,11 +93,9 @@ WHERE ';
date_available > SUBDATE(
CURRENT_DATE,INTERVAL '.$user['recent_period'].' DAY)';
- if (count($filter['visible_images']) > 0)
- {
- $filter['visible_images'] = implode(',', array_from_query($query, 'image_id'));
- }
- else
+ $filter['visible_images'] = implode(',', array_from_query($query, 'image_id'));
+
+ if (empty($filter['visible_images']))
{
// Must be not empty
$filter['visible_images'] = -1;