From 15a30340e8867dfac3f88460fbd93b581e56f10f Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Tue, 11 Jun 2024 00:58:31 -0700 Subject: Initial steps towards a pico.css-based theme --- data/templates/pico/dynamictags.inc.php | 148 ++++++++++++++++++++++++++++++++ 1 file changed, 148 insertions(+) create mode 100644 data/templates/pico/dynamictags.inc.php (limited to 'data/templates/pico/dynamictags.inc.php') diff --git a/data/templates/pico/dynamictags.inc.php b/data/templates/pico/dynamictags.inc.php new file mode 100644 index 0000000..f731048 --- /dev/null +++ b/data/templates/pico/dynamictags.inc.php @@ -0,0 +1,148 @@ +getCurrentUserId(); + +//tags from current user +$userPopularTags = $b2tservice->getPopularTags($logged_on_userid, 25, $logged_on_userid); +$userPopularTagsCloud = $b2tservice->tagCloud($userPopularTags, 5, 90, 175); +$userPopularTagsCount = count($userPopularTags); + +//tags from all users +$allPopularTags = $b2tservice->getPopularTags(null, 5, $logged_on_userid); +$allPopularTagsCloud = $b2tservice->tagCloud($allPopularTags, 5, 90, 175); +$allPopularTagsCount = count($allPopularTags); + + +// function printing the cloud +function writeTagsProposition($tagsCloud, $title) +{ + static $id = 0; + ++$id; + + echo <<' ++ '

$title

' ++ '

' ++ ''); +JS; + + $taglist = ''; + foreach (array_keys($tagsCloud) as $key) { + $row = $tagsCloud[$key]; + $entries = T_ngettext('bookmark', 'bookmarks', (int)$row['bCount']); + $taglist .= '' + . filter($row['tag']) + . ' '; + } + echo '$(\'#edit-tagcloud-' . $id . ' p\').append(' + . json_encode($taglist) + . ");\n"; +} + + +if ($allPopularTagsCount > 0 || $userPopularTagsCount > 0 ) { ?> + +
+ -- cgit v1.2.3-54-g00ecf