summary refs log tree commit diff stats
path: root/includes
diff options
context:
space:
mode:
authorStarla Insigna <hatkirby@fourisland.com>2008-12-09 20:53:27 -0500
committerStarla Insigna <hatkirby@fourisland.com>2008-12-09 20:53:27 -0500
commit6079598aeba3b0569de36074c46a77262d98fe88 (patch)
treeec403d917165da2f3049afda323873f8c9329395 /includes
parent1560a8bb34f44895bd4a2a8cac97fdcd1b9d84a4 (diff)
downloadfourisland-6079598aeba3b0569de36074c46a77262d98fe88.tar.gz
fourisland-6079598aeba3b0569de36074c46a77262d98fe88.tar.bz2
fourisland-6079598aeba3b0569de36074c46a77262d98fe88.zip
Enhanced tag cloud
Diffstat (limited to 'includes')
-rwxr-xr-xincludes/footer.php13
1 files changed, 7 insertions, 6 deletions
diff --git a/includes/footer.php b/includes/footer.php index b400bbb..4fe5ec5 100755 --- a/includes/footer.php +++ b/includes/footer.php
@@ -206,7 +206,7 @@ if (!isset($noRightbar))
206 'USERNAME' => $getuser3['username'])); 206 'USERNAME' => $getuser3['username']));
207 } 207 }
208 208
209 $gettags = "SELECT DISTINCT tag FROM tags"; 209 $gettags = "SELECT DISTINCT tag FROM tags WHERE post_type = \"published\"";
210 $gettags2 = mysql_query($gettags); 210 $gettags2 = mysql_query($gettags);
211 $i=0; 211 $i=0;
212 while ($gettags3[$i] = mysql_fetch_array($gettags2)) 212 while ($gettags3[$i] = mysql_fetch_array($gettags2))
@@ -224,13 +224,14 @@ if (!isset($noRightbar))
224 $spread = max($counts) - $min_count; 224 $spread = max($counts) - $min_count;
225 $spread = ($spread <= 0) ? 1 : $spread; 225 $spread = ($spread <= 0) ? 1 : $spread;
226 $font_step = 8 / $spread; 226 $font_step = 8 / $spread;
227
228 uksort($counts, 'strnatcasecmp');
229
230 foreach ($counts as $tag => $count) 227 foreach ($counts as $tag => $count)
231 { 228 {
232 $template->adds_block('TAGCLOUD', array( 'TAG' => $tag, 229 if ($count != $min_count)
233 'SIZE' => (8 + (($count - $min_count) * $font_step)))); 230 {
231 $template->adds_block('TAGCLOUD', array( 'TAG' => $tag,
232 'SIZE' => (8 + (($count - $min_count) * $font_step)),
233 'COUNT' => $count));
234 }
234 } 235 }
235} 236}
236 237