diff --git a/templates/dynamictags.inc.php b/templates/dynamictags.inc.php index 4bc0421..b317e9f 100644 --- a/templates/dynamictags.inc.php +++ b/templates/dynamictags.inc.php @@ -1,35 +1,61 @@ getCurrentUserId(); +//tags from current user $userPopularTags =& $b2tservice->getPopularTags($logged_on_userid, 25, $logged_on_userid); -$userPopularTagsCloud =& $b2tservice->tagCloud($userPopularTags, 5, 90, 175); +$userPopularTagsCloud =& $b2tservice->tagCloud($userPopularTags, 5, 90, 175); $userPopularTagsCount = count($userPopularTags); -if ($userPopularTagsCount > 0) { -?> +//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) { + echo 'document.write(\'
\');'; + echo 'document.write(\'

'. $title .'<\/h3>\');'; + echo 'document.write(\'

\');'; + + $taglist = ''; + foreach(array_keys($tagsCloud) as $key) { + $row =& $tagsCloud[$key]; + $entries = T_ngettext('bookmark', 'bookmarks', $row['bCount']); + $taglist .= ''. filter($row['tag']) .'<\/span> '; + } + + echo 'document.write(\''. $taglist .'\');'; + echo 'document.write(\'<\/p>\');'; + echo 'document.write(\'<\/div>\');'; + +} + + +if ($allPopularTagsCount > 0 || $userPopularTagsCount > 0 ) { ?>