Feb 28
Please check out the demo page for examples on how to use the new functions available in this version.
Some of the new features included in the new tag cloud script are:
- Link and URL Assignment
- Additional attribute assignment e.g. title etc
- Add styles and colour options to each tag
- Set a limit to the amount of tags that are displayed
- Examples of intergrating with a MySQL Database
- Examples of intergrating with a Flat Text File
- String to cloud, parse a single string into a tag cloud instantly
- Ignore list, to remove particular words from the cloud. e.g. and, the, it, i
- Ordering by a selective field. e.g. word, size, colour
Tutorial coming soon ...

February 28th, 2008 at 4:10 pm
I can't wait! I love you tag system, and this sounds very good
Keep up the good work dude
February 28th, 2008 at 4:12 pm
hi, great class! In my case I modified showCloud function a bit.
This way I don't need to get array first and create links myself. This might be useful for other users?
February 28th, 2008 at 4:15 pm
I think your tutorial should also include the Rewrite Engine rule required to make the domain.dom/tag// link work
February 28th, 2008 at 4:15 pm
I had a problem with this code. I wanted to pass a load of strings into it then have it show the top 10 most popular strings. Perhaps i missed somthing.? isnt this the entire point of a TagCloud?
March 10th, 2008 at 8:12 am
Good explane
March 16th, 2008 at 10:49 pm
[...] Tag Cloud Script (Version 2) is now Available, with more customizable features [...]
March 20th, 2008 at 6:25 pm
There is a bug at the Limit:
$i = 1;
foreach ($this->wordsArray as $key => $value) {
if ($this->limitAmount < $i) {
$wordsArray[$value['word']] = $value;
}
$i++;
}
limitAmount $i
March 20th, 2008 at 10:08 pm
@Gabriel
When you parse a string into the tag cloud class, it converts the string to tags, you can order and limit the tags using specific methods in the class, these are shown in the tutorial.
@Arnaud
Good idea, although this isn't really something i can control as each site system will work differently.
@Bandorka
Thanks for the comment, could you please expand on this as it's very difficult for me to replicate the bug you are encountering! Looking at the code, it looks fine to me and i have tested the method and i seem to get the desired results ... ?
March 27th, 2008 at 12:52 pm
Good post!...
March 30th, 2008 at 12:40 pm
Nice class, great work
Found a bug though, and the fix I believe.
In the getMax()-method in wordcloud.class.php a "{" and a "}" is missing.
Before it was this:
...
row 306: if ($c_size > $p_size)
row 307: $max = $c_size;
row 308: $p_size = $c_size;
After my fix:
...
row 306: if ($c_size > $p_size) {
row 307: max= $c_size;
row 308: $p_size = $c_size;
row 309: }
You can see the bug in action on your demo-page actually. If you view that page and just hits F5 5-10 times you will see how your first Basic Example change appearance (the order), and some times the "weight" of the tags change too. That "randomness" in tag-weight is a bug in my oppinion.
March 30th, 2008 at 4:53 pm
Indeed it was a minor bug, thank you for mentioning this it is now fixed
and it works a little smoother and consistent when the page is reloaded.
As each item was looped through only two items were compared in size, now we store the largest item in size and then compare it to each item as it loops through the array.
Thanks again!
April 10th, 2008 at 11:04 am
Hi. I tried to limit the number of words.
For exemple the top 10 words of a text.
How to do ?
April 22nd, 2008 at 3:21 pm
Hi,
I was wondering how I would go about using an RSS feed as the data source for your cloud script?
Any help you could provide would be greatly appreciated.
All the best.
May 13th, 2008 at 9:32 pm
Hi,
Thank you for your script!
Could You show me an example what is about W/Links & colours MySQL Database?
If there are three fileds of word, link, color.
Thank you!
July 6th, 2008 at 3:10 pm
Hi,
the css style sheet doesn't work, all link are blue
http://www.bigsoftwares.com/searchflickr/word_cloud/tags2.php?feed=http%3A%2F%2Fapi.flickr.com%2Fservices%2Ffeeds%2Fphotos_public.gne%3Ftags%3Dtag%26lang%3Den-us%26format%3Drss_200
July 8th, 2008 at 7:56 am
Thanks for script. Could you please do some more fixes. For example if you have a small array of tags all of them are getting big size classes. This looks not to good on website.
July 29th, 2008 at 11:29 pm
HOW I CAN SET LIMIT ON MYSQL QUERY? Why $cloud->setLimit(20); dont work :/? :(:(
October 8th, 2008 at 2:56 pm
Nice Effort , I liked you site !
Can it tag Arabic words or not ?
October 10th, 2008 at 10:03 am
Thanks for script. How i can put russian text as a source words ?
November 2nd, 2008 at 4:56 pm
how i can set max tags to show in by not mysql version ??
November 13th, 2008 at 7:38 pm
Hi, this is what i need, great job, thank you. Before I publish om my site i need some help...i can't make tags w/links working when I use $string for language change dynamically, for example:
$cloud = new wordCloud();
$cloud->addWord(array('word' => ''$acc'', 'size' => 1, 'url' => 'http://www.link.com'));
...
where $acc is defined before in several language and change it when language=$language
how can I define $acc string? with echo don't work ether.
thank you,
M.
December 4th, 2008 at 4:21 pm
Is there anyway to a make it so the tag cloud takes the 10 top used words on the website itself and makes a cloud based on those repetitions? That way each page has a unique page cloud based on the content of the individual pages.
January 24th, 2009 at 1:56 pm
for a much better speed change all
return $this->wordsArray;
to
return true;
February 9th, 2009 at 11:07 am
I've used this code on a couple of websites now, always works perfectly. Thanks
February 18th, 2009 at 2:37 am
I added a new utility function:
/*
* Sets a limit for the amount of clouds
* @example setLimitPercent(.50) will show only 50% of the words
*
* @param string $limit as a fraction
*
* @returns string $this->limitAmount
*/
function setLimitPercent($limit)
{
if (!empty($limit)) {
$this->limitAmount = round($limit * count($this->wordsArray));
}
return $this->limitAmount;
}
-------
It was too much work in my current code base to keep track of unique words and since tagCloud already knew that amount, this function works out really well.
March 2nd, 2009 at 4:41 pm
Thankyou. Super code.
April 6th, 2009 at 12:10 am
Hey Can you please suggest how to write the code for text cloud in java, and if possible can you provide an example