mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-07-05 01:12:29 +02:00
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:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user