Animated Flash Tags Widget , Flash Tag Cloud

Animated Flash Tags Widget , Flash Tag Cloud

<div> PHP Code:
http://www.vbulletin.org/forum/showthread.php?t=237643




Flash Tag Cloud


Released 6/3/2010
By Vikas -
Demo - , Look at left sidebar

Installation


PHP Code
<div style="margin:20px; margin-top:5px"> PHP Code:
<div class="alt2"> <div dir="ltr" style="text-align:left;"> <span style="color: #000000"> $flashWidth = 330;
$flashHeight = 330;
$flashPath = 'tagcloud.swf';
$flashBackgroundColor = 'ffffff';
$tagCount = 30;
$tagMaxSize = 16;
$tagMinSize = 8;

// Colors are in hex
$data&#91;'tcolor'&#93; = '0x000000';
$data&#91;'tcolor2'&#93; = '0x336699';
$data&#91;'hicolor'&#93; = '0x000000';
$data&#91;'speed'&#93; = 100;
$data&#91;'distr'&#93; = 'true';
$data&#91;'mode'&#93; = 'tags';

$contentTypes = array(2=>'tags.php?tag=',15=>'blog.php?tag=');

/* No Editing Below This Line*/

global $vbulletin;

// %d

$query = sprintf("SELECT Tag.tagid, Tag.tagtext, TagContent.contenttypeid, COUNT( TagContent.tagid ) AS count FROM ".TABLE_PREFIX."tag AS Tag LEFT JOIN ".TABLE_PREFIX."tagcontent AS TagContent ON ( Tag.tagid = TagContent.tagid ) GROUP BY TagContent.tagid ORDER BY count DESC LIMIT %d",$tagCount);

$qtags = vB::$db->query_read($query);

while($tag = vB::$db->fetch_array($qtags)) {
$tags&#91;&#93; = $tag;
$tagSize&#91;$tag&#91;'tagtext'&#93;&#93; = $tag&#91;'count'&#93;;
}

// largest and smallest array values
$maxQty = max(array_values($tagSize));
$minQty = min(array_values($tagSize));

$spread = $maxQty - $minQty;
if ($spread == 0) {
$spread = 1;
}

$step = ($tagMaxSize - $tagMinSize) / ($spread);

// make the tag cloud
$tagsHTML = "";
foreach ($tags as $tag)
{
$size = round($tagMinSize + (($tag&#91;'count'&#93; - $minQty) * $step));
$text = $tag&#91;'tagtext'&#93;;

$url = $vbulletin->options&#91;'homeurl'&#93;.'/'.$contentTypes&#91;$tag&#91;'contenttypeid'&#93;& #93;.urlencode($tag&#91;'tagtext'&#93;);
$tagsHTML .= "$text";
}

$data&#91;'tagcloud'&#93; = ''.$tagsHTML.'';

$flashVars = "";

foreach($data as $var=>$val)
{
$flashVars .= (empty ($flashVars))?'':'&';
$flashVars .= "$var=".urlencode($val);
}

ob_start();
?>