aboutsummaryrefslogtreecommitdiffhomepage
path: root/index.php
diff options
context:
space:
mode:
authorArthurHoaro <arthur@hoa.ro>2017-05-25 13:39:31 +0200
committerGitHub <noreply@github.com>2017-05-25 13:39:31 +0200
commit7481dd6e66c132ae064613de19e73dab0ca2de19 (patch)
treeae99823d461435577abd25b8bb24ef07692b99a1 /index.php
parent61c15aa5554431893ea5ebe800a9a625dca5aff9 (diff)
parent6ccd0b218fbd34de750f55b78f3dc43bb3d9fa8e (diff)
downloadShaarli-7481dd6e66c132ae064613de19e73dab0ca2de19.tar.gz
Shaarli-7481dd6e66c132ae064613de19e73dab0ca2de19.tar.zst
Shaarli-7481dd6e66c132ae064613de19e73dab0ca2de19.zip
Merge pull request #878 from Lucas-C/master
Adding the ability to display subtags in the tagcloud
Diffstat (limited to 'index.php')
-rw-r--r--index.php9
1 files changed, 6 insertions, 3 deletions
diff --git a/index.php b/index.php
index 468dd091..fb8b96b5 100644
--- a/index.php
+++ b/index.php
@@ -790,7 +790,9 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history)
790 // -------- Tag cloud 790 // -------- Tag cloud
791 if ($targetPage == Router::$PAGE_TAGCLOUD) 791 if ($targetPage == Router::$PAGE_TAGCLOUD)
792 { 792 {
793 $tags= $LINKSDB->allTags(); 793 $visibility = ! empty($_SESSION['privateonly']) ? 'private' : 'all';
794 $filteringTags = isset($_GET['searchtags']) ? explode(' ', $_GET['searchtags']) : array();
795 $tags = $LINKSDB->linksCountPerTag($filteringTags, $visibility);
794 796
795 // We sort tags alphabetically, then choose a font size according to count. 797 // We sort tags alphabetically, then choose a font size according to count.
796 // First, find max value. 798 // First, find max value.
@@ -824,6 +826,7 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history)
824 } 826 }
825 827
826 $data = array( 828 $data = array(
829 'search_tags' => implode(' ', $filteringTags),
827 'tags' => $tagList, 830 'tags' => $tagList,
828 ); 831 );
829 $pluginManager->executeHooks('render_tagcloud', $data, array('loggedin' => isLoggedIn())); 832 $pluginManager->executeHooks('render_tagcloud', $data, array('loggedin' => isLoggedIn()));
@@ -1351,7 +1354,7 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history)
1351 'link' => $link, 1354 'link' => $link,
1352 'link_is_new' => false, 1355 'link_is_new' => false,
1353 'http_referer' => (isset($_SERVER['HTTP_REFERER']) ? escape($_SERVER['HTTP_REFERER']) : ''), 1356 'http_referer' => (isset($_SERVER['HTTP_REFERER']) ? escape($_SERVER['HTTP_REFERER']) : ''),
1354 'tags' => $LINKSDB->allTags(), 1357 'tags' => $LINKSDB->linksCountPerTag(),
1355 ); 1358 );
1356 $pluginManager->executeHooks('render_editlink', $data); 1359 $pluginManager->executeHooks('render_editlink', $data);
1357 1360
@@ -1420,7 +1423,7 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history)
1420 'link_is_new' => $link_is_new, 1423 'link_is_new' => $link_is_new,
1421 'http_referer' => (isset($_SERVER['HTTP_REFERER']) ? escape($_SERVER['HTTP_REFERER']) : ''), 1424 'http_referer' => (isset($_SERVER['HTTP_REFERER']) ? escape($_SERVER['HTTP_REFERER']) : ''),
1422 'source' => (isset($_GET['source']) ? $_GET['source'] : ''), 1425 'source' => (isset($_GET['source']) ? $_GET['source'] : ''),
1423 'tags' => $LINKSDB->allTags(), 1426 'tags' => $LINKSDB->linksCountPerTag(),
1424 'default_private_links' => $conf->get('privacy.default_private_links', false), 1427 'default_private_links' => $conf->get('privacy.default_private_links', false),
1425 ); 1428 );
1426 $pluginManager->executeHooks('render_editlink', $data); 1429 $pluginManager->executeHooks('render_editlink', $data);