From 222afe2caa357d6d31efdef87e2444d3e042880d Mon Sep 17 00:00:00 2001 From: rub Date: Sun, 10 Dec 2006 22:48:32 +0000 Subject: 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 --- include/category_default.inc.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'include/category_default.inc.php') diff --git a/include/category_default.inc.php b/include/category_default.inc.php index b1f7bc46a..ae2dc4dce 100644 --- a/include/category_default.inc.php +++ b/include/category_default.inc.php @@ -46,8 +46,14 @@ if (count($selection) > 0) $query = ' SELECT * FROM '.IMAGES_TABLE.' - WHERE id IN ('.implode(',', $selection).') -;'; + WHERE id IN ('.implode(',', $selection).')'; + if ($page['filter_mode']) + { + $query.= ' + AND date_available > SUBDATE( + CURRENT_DATE,INTERVAL '.$user['recent_period'].' DAY)'; + } + $query.= ';'; $result = pwg_query($query); while ($row = mysql_fetch_assoc($result)) { -- cgit v1.2.3