From 5ba53394fcda4ae9cfa9af52b37fb67517deeb5a Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Wed, 25 May 2011 19:43:36 +0200 Subject: implement request #1989987: theme support. merge themes branch with --squash --- data/templates/default/dynamictags.inc.php | 148 +++++++++++++++++++++++++++++ 1 file changed, 148 insertions(+) create mode 100644 data/templates/default/dynamictags.inc.php (limited to 'data/templates/default/dynamictags.inc.php') diff --git a/data/templates/default/dynamictags.inc.php b/data/templates/default/dynamictags.inc.php new file mode 100644 index 0000000..8cf07c1 --- /dev/null +++ b/data/templates/default/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', $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