Skip to content

Commit

Permalink
Feature Issue ID 0000601: Filter all public pages with only recent el…
Browse files Browse the repository at this point in the history
…ements

Fix problem with 0 category on filtered result

git-svn-id: http://piwigo.org/svn/trunk@1684 68402e56-0260-453c-a942-63ccdbb3a9ee
  • Loading branch information
rub committed Dec 30, 2006
1 parent bec5bbe commit 39d974b
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions include/filter.inc.php
Expand Up @@ -70,7 +70,15 @@
// 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
Expand All @@ -87,7 +95,16 @@
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
{
Expand Down

0 comments on commit 39d974b

Please sign in to comment.