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 ) { ?>