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
This commit is contained in:
rvelices
2013-03-24 06:46:35 +00:00
parent 55275efb66
commit ea10c19ac5
6 changed files with 100 additions and 17 deletions
+15
View File
@@ -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.