From ef4fd0ad2715026bf12fd41e9c1c888e5a278687 Mon Sep 17 00:00:00 2001 From: mensonge Date: Mon, 1 Dec 2008 17:10:36 +0000 Subject: [PATCH] Interface fix: add tags cloud from all users into add bookmark window git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@182 b3834d28-1941-0410-a4f8-b48e95affb8f --- templates/dynamictags.inc.php | 81 ++++++++++++++++++++++------------- 1 file changed, 51 insertions(+), 30 deletions(-) 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 ) { ?>