aboutsummaryrefslogtreecommitdiffstats
path: root/include/functions_tag.inc.php
diff options
context:
space:
mode:
authorrub <rub@piwigo.org>2006-12-21 21:38:20 +0000
committerrub <rub@piwigo.org>2006-12-21 21:38:20 +0000
commitcab8f98c4ab88a0ad05f2359099c883675319084 (patch)
treea8224615d63c1330fd8744e3abd5195eb5763476 /include/functions_tag.inc.php
parenta7ce26153185c274a08fb52b07402c8afba6f128 (diff)
Feature Issue ID 0000601: Filter all public pages with only recent elements
It's a finalized version. Obsolete code of draft are removed. You can filter categories and images with recent date period on your screen selection. In the future, filter could be easy done on other type data (plugin?) You can flat categories and sub-categories with a recent date period of your choice. Next, perhaps, a panel to choice recent date for the 2 features. On draft, there have problem with MySql 5, be careful! Css problem not resolved: - Menu "Categories" is bad centered - Icon on dark too on the top git-svn-id: http://piwigo.org/svn/trunk@1677 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'include/functions_tag.inc.php')
-rw-r--r--include/functions_tag.inc.php18
1 files changed, 15 insertions, 3 deletions
diff --git a/include/functions_tag.inc.php b/include/functions_tag.inc.php
index b330041ca..c01bb2fc7 100644
--- a/include/functions_tag.inc.php
+++ b/include/functions_tag.inc.php
@@ -37,7 +37,7 @@
* @param array forbidden categories
* @return array
*/
-function get_available_tags($forbidden_categories = null)
+function get_available_tags()
{
// we can find top fatter tags among reachable images
$tags_query = '
@@ -45,13 +45,25 @@ SELECT tag_id, name, url_name, count(*) counter
FROM '.IMAGE_TAG_TABLE.'
INNER JOIN '.TAGS_TABLE.' ON tag_id = id';
- if (!is_null($forbidden_categories))
+ $where_tag_img =
+ get_sql_condition_FandF
+ (
+ array
+ (
+ 'forbidden_categories' => 'category_id',
+ 'visible_categories' => 'category_id',
+ 'visible_images' => 'image_id'
+ ),
+ 'WHERE'
+ );
+
+ if (!is_null($where_tag_img))
{
// first we need all reachable image ids
$images_query = '
SELECT DISTINCT image_id
FROM '.IMAGE_CATEGORY_TABLE.'
- WHERE category_id NOT IN ('.implode(',', $forbidden_categories).')
+ '.$where_tag_img.'
;';
$image_ids = array_from_query($images_query, 'image_id');
if ( empty($image_ids) )