diff options
author | rvelices <rv-github@modusoptimus.com> | 2006-04-08 19:42:11 +0000 |
---|---|---|
committer | rvelices <rv-github@modusoptimus.com> | 2006-04-08 19:42:11 +0000 |
commit | 86a90feddf8a9f6918bac25c52f31f1f5d6e17c7 (patch) | |
tree | 2c631d2c10db4f619737fe75841243bebcaf6f2f /include/functions_tag.inc.php | |
parent | a892e6abf95a23219d76971890011646f7efeef4 (diff) |
merge -r1134 from branches/branch-1_6 into trunk
git-svn-id: http://piwigo.org/svn/trunk@1135 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'include/functions_tag.inc.php')
-rw-r--r-- | include/functions_tag.inc.php | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/include/functions_tag.inc.php b/include/functions_tag.inc.php index 5dd4884f4..3e3934669 100644 --- a/include/functions_tag.inc.php +++ b/include/functions_tag.inc.php @@ -54,7 +54,10 @@ SELECT DISTINCT image_id WHERE category_id NOT IN ('.implode(',', $forbidden_categories).') ;'; $image_ids = array_from_query($images_query, 'image_id'); - + if ( empty($image_ids) ) + { + return array(); + } $tags_query.= ' WHERE image_id IN ('. wordwrap( @@ -63,13 +66,13 @@ SELECT DISTINCT image_id "\n" ).')'; } - + $tags_query.= ' GROUP BY tag_id ;'; $result = pwg_query($tags_query); - + $tags = array(); while ($row = mysql_fetch_array($result)) @@ -93,7 +96,7 @@ SELECT id AS tag_id, name, url_name ORDER BY name ;'; $result = pwg_query($query); - + $tags = array(); while ($row = mysql_fetch_array($result)) @@ -123,7 +126,7 @@ function add_level_to_tags($tags) { return $tags; } - + $total_count = 0; foreach ($tags as $tag) @@ -146,7 +149,7 @@ function add_level_to_tags($tags) foreach (array_keys($tags) as $k) { $tags[$k]['level'] = 1; - + // based on threshold, determine current tag level for ($i = $conf['tags_levels'] - 1; $i >= 1; $i--) { @@ -177,7 +180,7 @@ function get_image_ids_for_tags($tag_ids, $mode = 'AND') { // strategy is to list images associated to each tag $tag_images = array(); - + foreach ($tag_ids as $tag_id) { $query = ' |