aboutsummaryrefslogtreecommitdiffstats
path: root/include/functions_tag.inc.php
diff options
context:
space:
mode:
authorrvelices <rv-github@modusoptimus.com>2013-03-24 06:46:35 +0000
committerrvelices <rv-github@modusoptimus.com>2013-03-24 06:46:35 +0000
commitea10c19ac5a1f6e89627497e5a6bfdefa37b5053 (patch)
tree7b59e8ae7a426b524ba8a13a6e2be38bffe6e791 /include/functions_tag.inc.php
parent55275efb66cf6a2b0c874a1d05915fdc83d9cc48 (diff)
feature 2836: display the number of comments/tags in the menubar
git-svn-id: http://piwigo.org/svn/trunk@21817 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'include/functions_tag.inc.php')
-rw-r--r--include/functions_tag.inc.php15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/functions_tag.inc.php b/include/functions_tag.inc.php
index 5766b9509..17ae996ab 100644
--- a/include/functions_tag.inc.php
+++ b/include/functions_tag.inc.php
@@ -22,6 +22,21 @@
// +-----------------------------------------------------------------------+
+/** returns the number of available tags for the connected user */
+function get_nb_available_tags()
+{
+ global $user;
+ if (!isset($user['nb_available_tags']))
+ {
+ $user['nb_available_tags'] = count(get_available_tags());
+ single_update(USER_CACHE_TABLE,
+ array('nb_available_tags'=>$user['nb_available_tags']),
+ array('user_id'=>$user['id'])
+ );
+ }
+ return $user['nb_available_tags'];
+}
+
/**
* Tags available. Each return tag is represented as an array with its id,
* its name, its weight (count), its url name. Tags are not sorted.