diff -r 03c7f5ec1e4c -r 80facec76d9f includes/tagcloud.php --- a/includes/tagcloud.php Sun Aug 05 17:10:17 2007 -0400 +++ b/includes/tagcloud.php Mon Aug 06 10:09:48 2007 -0400 @@ -51,7 +51,7 @@ function add_word($word) { - $word = strtolower($word); + $word = sanitize_tag($word); if ( isset($this->words[$word]) ) $this->words[$word] += 1; @@ -125,25 +125,33 @@ /** * Generates and returns HTML for the cloud. + * @param string Optional. The CSS class applied to all tags. Can be "normal" or "small". Defaults to "normal". + * @param string Optional. The alignment for the div. Defaults to "center". * @return string */ - function make_html() + function make_html($span_class = 'normal', $div_align = 'center') { $html = array(); $max = max($this->words); $size = $this->get_cloud_size(); + $inc = 0; if ( count($this->words) > 0 ) { foreach ( $this->words as $word => $popularity ) { + $inc++; $word = htmlspecialchars($word); $percent = ( $popularity / $max ) * 100; $index = $this->get_scale_class($percent); - $html[] = "$word"; + $newline = ( $inc == 5 ) ? "
" : ''; + ( $inc == 5 ) ? $inc = 0 : null; + $url = makeUrlNS('Special', 'TagCloud/' . htmlspecialchars($word)); + $s = ( $popularity != 1 ) ? 's' : ''; + $html[] = "$word"; // $newline"; } } - $html = implode("\n", $html); + $html = '
' . implode("\n", $html) . '
'; return $html; }