aboutsummaryrefslogtreecommitdiffhomepage
path: root/application/LinkDB.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 /application/LinkDB.php
parent61c15aa5554431893ea5ebe800a9a625dca5aff9 (diff)
downloadShaarli-6ccd0b218fbd34de750f55b78f3dc43bb3d9fa8e.tar.gz
Shaarli-6ccd0b218fbd34de750f55b78f3dc43bb3d9fa8e.tar.zst
Shaarli-6ccd0b218fbd34de750f55b78f3dc43bb3d9fa8e.zip
Adding ability to display subtags in tagcloud
Diffstat (limited to 'application/LinkDB.php')
-rw-r--r--application/LinkDB.php11
1 files changed, 7 insertions, 4 deletions
diff --git a/application/LinkDB.php b/application/LinkDB.php
index 0d3c85bd..7802cc8a 100644
--- a/application/LinkDB.php
+++ b/application/LinkDB.php
@@ -452,14 +452,17 @@ You use the community supported version of the original Shaarli project, by Seba
452 } 452 }
453 453
454 /** 454 /**
455 * Returns the list of all tags 455 * Returns the list tags appearing in the links with the given tags
456 * Output: associative array key=tags, value=0 456 * @param $filteringTags: tags selecting the links to consider
457 * @param $visibility: process only all/private/public links
458 * @return: a tag=>linksCount array
457 */ 459 */
458 public function allTags() 460 public function linksCountPerTag($filteringTags = [], $visibility = 'all')
459 { 461 {
462 $links = empty($filteringTags) ? $this->links : $this->filterSearch(['searchtags' => $filteringTags], false, $visibility);
460 $tags = array(); 463 $tags = array();
461 $caseMapping = array(); 464 $caseMapping = array();
462 foreach ($this->links as $link) { 465 foreach ($links as $link) {
463 foreach (preg_split('/\s+/', $link['tags'], 0, PREG_SPLIT_NO_EMPTY) as $tag) { 466 foreach (preg_split('/\s+/', $link['tags'], 0, PREG_SPLIT_NO_EMPTY) as $tag) {
464 if (empty($tag)) { 467 if (empty($tag)) {
465 continue; 468 continue;