Why can not I make the tags to the names? Help please!
function get_tag_clouds() {
global $site_db, $site_sess, $lang;
$output = "";
$max_to_show = 100; // max items to display
$max_size = 300; // max font size in %
$min_size = 70; // min font size in %
$max_qty = 0;
$min_qty = 0;
$sql = "SELECT image_id, image_name
FROM ".IMAGES_TABLE."
ORDER BY RAND()";
$result = $site_db->query($sql);
while ($row = $site_db->fetch_array($result)) {
$tags_hits[$row['image_id']] = $row['image_name'];
$tags[$row['image_id']] = $row['image_name'];
}
$max_qty = max(array_values($tags_hits));
$min_qty = min(array_values($tags_hits));
// find the range of values
$spread = $max_qty - $min_qty;
if ($spread == 0) { // we don't want to divide by zero
$spread = 1;
}
// set the font-size increment
$step = ($max_size - $min_size) / ($spread);
$i = 0;
foreach ($tags as $key => $value) {
if ((check_permission("auth_viewcat", $key)) && $i < $max_to_show) {
// calculate font-size
// find the $value in excess of $min_qty
// multiply by the font-size increment ($size)
// and add the $min_size set above
$size = round($min_size + (($tags_hits[$key] - $min_qty) * $step));
$css_color = 'rgb('.mt_rand(64,128).', '.mt_rand(64,128).', '.mt_rand(0,255).')';
$output .= ' <a href="'.$site_sess->url(ROOT_PATH."details.php?image_id=".$key).'" >'.$value.'</a> ';
$i++;
}
}
return $output;
}