diff options
author | rub <rub@piwigo.org> | 2006-12-10 22:48:32 +0000 |
---|---|---|
committer | rub <rub@piwigo.org> | 2006-12-10 22:48:32 +0000 |
commit | 222afe2caa357d6d31efdef87e2444d3e042880d (patch) | |
tree | 12386628081ccc334971eb7a8cf3456386e110d1 /include/functions_category.inc.php | |
parent | 906d9bd7951a77356b9caa04073a7d1c02d44bef (diff) |
Feature Issue ID 0000601: Filter all public pages with only recent elements
It's a draft of the feature witch allows to show only recent elements.
Development are not finished.
Queries and special pages (best rates, tags, etc.) are not modified.
Only main php files about images and categories are ok.
Before to continue, I prefer to determinate a solution between modify cache implementation or hide counters.
Go to http://forum.phpwebgallery.net/viewtopic.php?pid=50015#p50015
git-svn-id: http://piwigo.org/svn/trunk@1648 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'include/functions_category.inc.php')
-rw-r--r-- | include/functions_category.inc.php | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/include/functions_category.inc.php b/include/functions_category.inc.php index 706d9c401..8113064d6 100644 --- a/include/functions_category.inc.php +++ b/include/functions_category.inc.php @@ -67,15 +67,25 @@ SELECT '; $query.= ' FROM '.CATEGORIES_TABLE.' INNER JOIN '.USER_CACHE_CATEGORIES_TABLE.' ON id = cat_id and user_id = '.$user['id']; - if (!$user['expand']) + if ($page['filter_mode']) { $query.= ' - WHERE (id_uppercat is NULL'; - if (isset($page['category'])) +where max_date_last > SUBDATE( + CURRENT_DATE,INTERVAL '.$user['recent_period'].' DAY)'; + } + else + { + // Always expand when filter_mode is activated + if (!$user['expand']) { - $query.= ' OR id_uppercat IN ('.$page['uppercats'].')'; + $query.= ' + WHERE (id_uppercat is NULL'; + if (isset($page['category'])) + { + $query.= ' OR id_uppercat IN ('.$page['uppercats'].')'; + } + $query.= ')'; } - $query.= ')'; } $query.= ' ;'; |