total > $max) { $max = $tag->total; } } $cloud = ''; foreach ($vars['tagcloud'] as $tag) { $tag->tag = htmlspecialchars($tag->tag, ENT_QUOTES, 'UTF-8', false); if ($cloud != '') { $cloud .= ', '; } // protecting against division by zero warnings $size = round((log($tag->total) / log($max + .0001)) * 100) + 30; if ($size < 100) { $size = 100; } $url = "search?q=". urlencode($tag->tag) . "&search_type=tags$type$subtype"; $cloud .= elgg_view('output/url', array( 'text' => $tag->tag, 'href' => $url, 'style' => "font-size: $size%;", 'title' => "$tag->tag ($tag->total)", 'rel' => 'tag' )); } $cloud .= elgg_view('tagcloud/extend'); echo "
$cloud
"; }