";
$max = 0;
if ($context != 'tags') {
$title = elgg_echo('tagcloud');
$cloud .= "
$title
";
}
$cloud .= '';
foreach($vars['tagcloud'] as $tag) {
if ($tag->total > $max) {
$max = $tag->total;
}
}
$list = '';
foreach($vars['tagcloud'] as $tag) {
if ($list != '') {
$list .= ', ';
}
// protecting against division by zero warnings
$size = round((log($tag->total) / log($max + .0001)) * 100) + 30;
if ($size < 100) {
$size = 100;
}
$url = elgg_get_site_url()."pg/search/?q=". urlencode($tag->tag) . "&search_type=tags$type$subtype";
$list .= "
tag)." ($tag->total)\" style=\"text-decoration:none;\">" . htmlspecialchars($tag->tag, ENT_QUOTES, 'UTF-8') . "";
}
$cloud .= "$list
";
if ($context != 'tags') {
$cloud .= '';
$cloud .= "All site tags";
$cloud .= '
';
}
$cloud .= elgg_view('tagcloud/extend');
$cloud .= '';
echo $cloud;
}