Version: 1.00, by MARCO1
Developer Last Online: Jan 2022
Category: Forum Home Enhancements -
Version: 4.0.x
Rating:
Released: 02-14-2010
Last Update: Never
Installs: 153
Uses Plugins Auto-Templates
No support by the author.
MARCO1 Tag Cloud - Forum Home
vB4.x.x
By
Marco Mamdouh
Please Note that : I'm keeping update my products and codes without any money simply support me in vb.org to continue this work
Support Me! Mark As Installed - Nominate For MOTM
Installation : Import the xml file from your admincp
History : 15-12-2010 : First release : vB4
Translations : You can translate this Mod and publish it in your forum however you can't do that without take permissions from Me via PM's English Version in Attachments.
Dont mind this mod but how cool would it be to be like this http://www.empiritag.com/
That would be kick ass.
Any chance of this or not gunna happen ever?
Dont mind this mod but how cool would it be to be like this http://www.empiritag.com/
That would be kick ass.
Any chance of this or not gunna happen ever?
You'd have to play around with it to fit into your widgets right but this would work;
Installation
Goto Admincp->vBullietin CMS->Widgets->Create New Widget
Choose PHP Direct Execution as Widget's Type
Place a Title. eg Upcoming Events. Keep it short as this is what will appear as title on your pages.
Click Save
Click Configure on the right of the new created widget.
Remove the default code that appears. Be sure to not leave behind even a single letter.
Copy and Paste the code that you can find below.
Leave the template name as is (vbcms_widget_execphp_page)
Click Save
Goto Admincp->vBullietin CMS->Layout Manager
Click Go on the Default Layout
Add the Widget to your Layout
Click Save
Download the attached tagcloud.zip and extract it.
Upload tagcloud.swf to root directory of your vbulletin install
That's all !!
PHP Code
Code:
$flashWidth = 330;
$flashHeight = 330;
$flashPath = 'tagcloud.swf';
$flashBackgroundColor = 'ffffff';
$tagCount = 30;
$tagMaxSize = 16;
$tagMinSize = 8;
// Colors are in hex
$data['tcolor'] = '0x000000';
$data['tcolor2'] = '0x336699';
$data['hicolor'] = '0x000000';
$data['speed'] = 100;
$data['distr'] = 'true';
$data['mode'] = '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[] = $tag;
$tagSize[$tag['tagtext']] = $tag['count'];
}
// 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['count'] - $minQty) * $step));
$text = $tag['tagtext'];
$url = $vbulletin->options['homeurl'].'/'.$contentTypes[$tag['contenttypeid']].urlencode($tag['tagtext']);
$tagsHTML .= "<a href='$url' style='$size'>$text</a>";
}
$data['tagcloud'] = '<tags>'.$tagsHTML.'</tags>';
$flashVars = "";
foreach($data as $var=>$val)
{
$flashVars .= (empty ($flashVars))?'':'&';
$flashVars .= "$var=".urlencode($val);
}
ob_start();
?>
<embed width="<?php echo $flashWidth;?>" height="<?php echo $flashHeight;?>" flashvars="<?php echo $flashVars;?>" wmode="transparent" allowscriptaccess="always" quality="high" bgcolor="#<?php echo $flashBackgroundColor;?>" name="vbCloudFlash" id="vbCloudFlash" style="" src="<?php echo $vbulletin->options['homeurl'].'/'.$flashPath;?>" type="application/x-shockwave-flash"/>
<?php
$content = ob_get_contents();
ob_end_clean();
$output = $content;