pb ile ilgili tag cloud eklentisi ararken karşıma çıkan kodlar.. sadece tek yapılan ilgili tagları com search ile joomlaya yönlendirmek…

 

belki işine yarayan olur..

 

<?php

$db_host = “localhost”;
$db_user = “root”;
$db_pass = “”;
$db_name = “forum”;

mysql_connect($db_host, $db_user, $db_pass) or die(mysql_error());
mysql_select_db($db_name);

function tag_info() {
$sorgu = mysql_query(”SELECT title AS tag, COUNT(posts) AS quantity FROM ibf_topics GROUP BY posts ORDER BY posts DESC”);
while($row = mysql_fetch_array($sorgu)) {
$arr[$row[‘tag’]] = $row[‘count’];
}
ksort($arr);
return $arr;
}

function tag_cloud() {

$min_size = 10;
$max_size = 150;

$tags = tag_info();

$minimum_posts = min(array_values($tags));
$maximum_posts = max(array_values($tags));
$spread = $maximum_posts – $minimum_posts;

if($spread == 0) {
$spread = 1;
}

$cloud_html = ”;
$cloud_tags = array();
foreach ($tags as $tag => $posts) {
$size = $min_size + ($posts – $minimum_posts)
* ($max_size – $min_size) / $spread;
$cloud_tags[] = ‘<a style=”font-size: ‘. floor($size) . ‘px’
. ‘” class=”tag_cloud” target=”_blank” href=”http://www.bozkurtmhp.com/index.php?option=com_search&searchword=’ . $tag
. ‘” title=”” . $tag  . ‘’ returned a count of ‘ . $posts . ‘”>’
. htmlspecialchars(stripslashes($tag)) . ‘</a>’;
}
$cloud_html = join(”n”, $cloud_tags) . “n”;
return $cloud_html;

}

?>

<style type=”text/css”>
.tag_cloud
{padding: 3px; text-decoration: none;
font-family: verdana;     }
.tag_cloud:link  { color: #FF0000; }
.tag_cloud:visited { color: #9900FF; }
.tag_cloud:hover { color: #FF0000; background: #000000; }
.tag_cloud:active { color: #6699FF; background: #000000; }
</style>

<div id=”wrapper”>
<?php print tag_cloud(); ?>
</div>