Tags Problem!
Posted: Mon Jan 28, 2008 4:03 pm
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 using as Top Tags!?
ill publish below code that belon to "tags"
at index.php:
At header.php included in index.php
at style.css
Screenshot of my problem:
http://img30.picoodle.com/img/img30/4/1 ... 4e5d81.jpg
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 using as Top Tags!?
ill publish below code that belon to "tags"
at index.php:
Code: Select all
<tr><td>
<div id="wrapper" class="wrapper">
Keywords:<br />
<?php print tag_cloud(); ?>
</div>
</td>
</tr>Code: Select all
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;
}
Code: Select all
.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;http://img30.picoodle.com/img/img30/4/1 ... 4e5d81.jpg