aboutsummaryrefslogtreecommitdiffhomepage
path: root/index.php
diff options
context:
space:
mode:
authorLucas Cimon <lucas.cimon@gmail.com>2017-05-18 20:28:11 +0200
committerLucas Cimon <lucas.cimon@gmail.com>2017-05-24 13:09:35 +0200
commit6ccd0b218fbd34de750f55b78f3dc43bb3d9fa8e (patch)
treeae99823d461435577abd25b8bb24ef07692b99a1 /index.php
parent61c15aa5554431893ea5ebe800a9a625dca5aff9 (diff)
downloadShaarli-6ccd0b218fbd34de750f55b78f3dc43bb3d9fa8e.tar.gz
Shaarli-6ccd0b218fbd34de750f55b78f3dc43bb3d9fa8e.tar.zst
Shaarli-6ccd0b218fbd34de750f55b78f3dc43bb3d9fa8e.zip
Adding ability to display subtags in 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);