fixes #1102 limit the number of tags shown in the menubar

This commit is contained in:
plegall
2019-10-15 16:02:14 +02:00
parent c4142c2a51
commit 41b4230b39
3 changed files with 17 additions and 20 deletions
+1 -20
View File
@@ -6,25 +6,6 @@
// | file that was distributed with this source code. |
// +-----------------------------------------------------------------------+
// +-----------------------------------------------------------------------+
// | functions |
// +-----------------------------------------------------------------------+
function counter_compare($a, $b)
{
if ($a['counter'] == $b['counter'])
{
return id_compare($a, $b);
}
return ($a['counter'] < $b['counter']) ? +1 : -1;
}
function id_compare($a, $b)
{
return ($a['id'] < $b['id']) ? -1 : 1;
}
// +-----------------------------------------------------------------------+
// | initialization |
// +-----------------------------------------------------------------------+
@@ -145,7 +126,7 @@ else
// we want only the first most represented tags, so we sort them by counter
// and take the first tags
usort($tags, 'counter_compare');
usort($tags, 'tags_counter_compare');
$tags = array_slice($tags, 0, $conf['full_tag_cloud_items_number']);
// depending on its counter and the other tags counter, each tag has a level