aboutsummaryrefslogtreecommitdiffhomepage
path: root/inc/poche/Poche.class.php
diff options
context:
space:
mode:
authorThomas Citharel <tcit@tcit.fr>2015-03-08 14:47:22 +0100
committerThomas Citharel <tcit@tcit.fr>2015-03-08 14:47:22 +0100
commitab87a7fe6934b5fa0f06964c67a27826774126b4 (patch)
treee8f20b190b69ff47276731446544d98ac8c84dea /inc/poche/Poche.class.php
parent512ff18015919bf3119509d1a8b8cf87b3b86f5f (diff)
downloadwallabag-ab87a7fe6934b5fa0f06964c67a27826774126b4.tar.gz
wallabag-ab87a7fe6934b5fa0f06964c67a27826774126b4.tar.zst
wallabag-ab87a7fe6934b5fa0f06964c67a27826774126b4.zip
tag cloud is present, #1122 is implemented
Diffstat (limited to 'inc/poche/Poche.class.php')
-rwxr-xr-xinc/poche/Poche.class.php20
1 files changed, 20 insertions, 0 deletions
diff --git a/inc/poche/Poche.class.php b/inc/poche/Poche.class.php
index bf323c49..4ec724f9 100755
--- a/inc/poche/Poche.class.php
+++ b/inc/poche/Poche.class.php
@@ -466,6 +466,26 @@ class Poche
466 } 466 }
467 $tags = $this->store->retrieveTagsByEntry($id); 467 $tags = $this->store->retrieveTagsByEntry($id);
468 $all_tags = $this->store->retrieveAllTags($this->user->getId()); 468 $all_tags = $this->store->retrieveAllTags($this->user->getId());
469 $maximus = 0;
470 foreach ($all_tags as $eachtag) { // search for the most times a tag is present
471 if ($eachtag["entriescount"] > $maximus) $maximus = $eachtag["entriescount"];
472 }
473 foreach ($all_tags as $key => $eachtag) { // get the percentage of presence of each tag
474 $percent = floor(($eachtag["entriescount"] / $maximus) * 100);
475
476 if ($percent < 20): // assign a css class, depending on the number of entries count
477 $cssclass = 'smallesttag';
478 elseif ($percent >= 20 and $percent < 40):
479 $cssclass = 'smalltag';
480 elseif ($percent >= 40 and $percent < 60):
481 $cssclass = 'mediumtag';
482 elseif ($percent >= 60 and $percent < 80):
483 $cssclass = 'largetag';
484 else:
485 $cssclass = 'largesttag';
486 endif;
487 $all_tags[$key]['cssclass'] = $cssclass;
488 }
469 $tpl_vars = array( 489 $tpl_vars = array(
470 'entry_id' => $id, 490 'entry_id' => $id,
471 'tags' => $tags, 491 'tags' => $tags,