diff options
Diffstat (limited to 'includes/footer.php')
-rwxr-xr-x | includes/footer.php | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/includes/footer.php b/includes/footer.php index 204aaf5..b400bbb 100755 --- a/includes/footer.php +++ b/includes/footer.php | |||
@@ -205,6 +205,33 @@ if (!isset($noRightbar)) | |||
205 | 'POST' => $getpost3[$i]['post_id'], | 205 | 'POST' => $getpost3[$i]['post_id'], |
206 | 'USERNAME' => $getuser3['username'])); | 206 | 'USERNAME' => $getuser3['username'])); |
207 | } | 207 | } |
208 | |||
209 | $gettags = "SELECT DISTINCT tag FROM tags"; | ||
210 | $gettags2 = mysql_query($gettags); | ||
211 | $i=0; | ||
212 | while ($gettags3[$i] = mysql_fetch_array($gettags2)) | ||
213 | { | ||
214 | $cnttag = "SELECT COUNT(*) FROM tags WHERE tag = \"" . $gettags3[$i]['tag'] . "\""; | ||
215 | $cnttag2 = mysql_query($cnttag); | ||
216 | $cnttag3 = mysql_fetch_array($cnttag2); | ||
217 | |||
218 | $counts[$gettags3[$i]['tag']] = $cnttag3[0]; | ||
219 | |||
220 | $i++; | ||
221 | } | ||
222 | |||
223 | $min_count = min($counts); | ||
224 | $spread = max($counts) - $min_count; | ||
225 | $spread = ($spread <= 0) ? 1 : $spread; | ||
226 | $font_step = 8 / $spread; | ||
227 | |||
228 | uksort($counts, 'strnatcasecmp'); | ||
229 | |||
230 | foreach ($counts as $tag => $count) | ||
231 | { | ||
232 | $template->adds_block('TAGCLOUD', array( 'TAG' => $tag, | ||
233 | 'SIZE' => (8 + (($count - $min_count) * $font_step)))); | ||
234 | } | ||
208 | } | 235 | } |
209 | 236 | ||
210 | $template->add('REDIRPAGE',rawurlencode($_SERVER['REQUEST_URI'])); | 237 | $template->add('REDIRPAGE',rawurlencode($_SERVER['REQUEST_URI'])); |