shaqa Posted January 28, 2008 Share Posted January 28, 2008 I have php script for audio searching,and at the end of page is implanted Tags corner,ppl when search from my search box it save the information and show at the end of my page and also "bold" most serched keywords. Now my problem is,my table cannot handle to many keywords it change my style of my page and make it horrible for eye! How can i fix showing example just 50 last keyword and "bold" most searched keywords!? ill publish below code that belon to "tags" at index.php: <tr><td> <div id="wrapper" class="wrapper"> Keywords:<br /> <?php print tag_cloud(); ?> </div> </td> </tr> At header.php included in index.php function tag_cloud() { $min_size = 15; $max_size = 40; $tags = tag_info(); $minimum_count = min(array_values($tags)); $maximum_count = max(array_values($tags)); $spread = $maximum_count - $minimum_count; if($spread == 0) { $spread = 1; } $cloud_html = ''; $cloud_tags = array(); $step = ($max_size - $min_size)/($spread); foreach ($tags as $tag => $count) { $size = $min_size + ($count - $minimum_count) * $step; // $size = ($max_size + $min_size)/$spread; $cloud_tags[] = '<a style="font-size: '. floor($size) . 'px' . '" class="tag_cloud" href="'. $CFG['domain'] . 'index.php?search=' . $tag . '&x=0&y=0' . '" title="This tag \'' . $tag . '\' is searched ' . $count . ' times">' . htmlspecialchars(stripslashes($tag)) . '</a>'; } $cloud_html = join("\n", $cloud_tags) . "\n"; return $cloud_html; } at style.css .tag_cloud {padding: 3px; text-decoration: none; font-family: verdana; } .tag_cloud:link { } .tag_cloud:hover { font-weight:bold; } .tag_cloud:active { } div.wrapper{ position:absolute; height:200px; width:400px; Screenshot of my problem: http://img30.picoodle.com/img/img30/4/1/28/f_samplem_d4e5d81.jpg Link to comment https://forums.phpfreaks.com/topic/88267-tags-problem/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.