]> git.immae.eu Git - github/shaarli/Shaarli.git/blobdiff - index.php
Tagcloud/list improvments
[github/shaarli/Shaarli.git] / index.php
index 2ff2505a5e7b27355d71b64d6b88478d2f87e7e2..85486eb50d72ea16be69fe59e261612356e2a435 100644 (file)
--- a/index.php
+++ b/index.php
@@ -805,6 +805,9 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history)
 
         $tagList = array();
         foreach($tags as $key => $value) {
+            if (in_array($key, $filteringTags)) {
+                continue;
+            }
             // Tag font size scaling:
             //   default 15 and 30 logarithm bases affect scaling,
             //   22 and 6 are arbitrary font sizes for max and min sizes.
@@ -829,12 +832,17 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history)
         exit;
     }
 
-    // -------- Tag cloud
+    // -------- Tag list
     if ($targetPage == Router::$PAGE_TAGLIST)
     {
         $visibility = ! empty($_SESSION['privateonly']) ? 'private' : 'all';
         $filteringTags = isset($_GET['searchtags']) ? explode(' ', $_GET['searchtags']) : [];
         $tags = $LINKSDB->linksCountPerTag($filteringTags, $visibility);
+        foreach ($filteringTags as $tag) {
+            if (array_key_exists($tag, $tags)) {
+                unset($tags[$tag]);
+            }
+        }
 
         if (! empty($_GET['sort']) && $_GET['sort'] === 'alpha') {
             alphabetical_sort($tags, false, true);