Hacking Cloudy

WordPress | Friday, January 19th, 2007 | 12 years, 8 months ago

EDIT – this article was written in reference to Cloudy version 0.4. See the end of this article for a copy of my customised source code along with installation instructions.

I’ve hacked the source a little bit to make each word in the Cloudy cloud clickable. Clicking a word searches my blog for that word. Here’s what I did: (I hope these blockquotes will show HTML code!) I scrolled to the bottom of the source just after the 4 lines starting with this code:

if ($val >= $this->range………….

I then found the folliowing line of code:

$this->my_cloudy_text .= “<span style=\”font-size: $font_size%;\”><a title=\”I have used ‘$key’ $val times!\” name=\”$key\” class=\”cloudy\”>$key</a></span> “

At this point in the code the string variable “$key” contains one word in the cloud. I performed a search on my blog which showed the format of a URL crafted to perform a search. It’s basically http://blog.yourdomain.com/index.php?s=searchterm

So I just added an HREF option to the A tag. The following code is crafted for my site, so just replace my domain name with yours:

$this->my_cloudy_text .= “<span style=\”font-size: $font_size%;\”> < a href=\”http://blog.demodulated.com/index.php?s=$key\” title=\”I have used ‘$key’ $val times!\” name=\”$key\” class=\”cloudy\”>$key</a></span> “;

Enjoy, and many many thanks to Chris Compton for this excellent and superbly documented lump of code!

Note – don’t try to copy and paste this code because WordPress converts double quotes to fancy quotes. Pasting this code won’t work. Just insert the bolded href command above into the appropriate place.

EDIT – You may download an exact copy of my customised source code here. Right-click this link and save the file as “cloudy.php”, then upload it to /blogdir/wp-content/plugins/, and activate it. Look near the bottom of the file for the code I edited – I left a comment just above it so it should be perfectly clear what you need to do.

Note that this is an unofficial, unsupported hack of the source code. In general you should not trust source code coming from anyone but the original developer, and if you’re smart you’ll even be suspicious of that. Even WordPress’s official source code has been infiltrated in the recent past. The onus is on YOU to read over this source code before implementing it.


>> ATH0 -- NO CARRIER <<


  1. where do you find the source code? Cuz I can’t find this text int the cloudy.php….probably a silly question….but i’m kinda lost on this

    Comment by nikita — March 21, 2007 @ 11:31 am

  2. I’ve just updated this article to mention that I used Cloudy version 0.4 when I wrote this article. It’s a shame that WordPress has no means of automatically informing me when a plugin has been updated because I see Cloudy is now up to version 1.2. Still, I think I’ll keep the version I’ve got here.

    I’ve decided to make my full source code available directly from this article. Check back in a few minutes for instructions. Hopefully this will work for you easily.

    Thanks for writing, nikita, and good luck implementing Cloudy! Feel free to leave a URL to your blog in a comment so that people can see how you’ve implemented it!

    Comment by brian — March 21, 2007 @ 11:54 am

  3. Thanx Brian, I don’t yet know if it’s going to work cuz the search on my blog doesn’t seem to be functioning right now…when it does, I’ll let you know


    Comment by nikita — March 21, 2007 @ 12:37 pm

RSS feed for comments on this post.

Sorry, the comment form is closed at this time.

Powered by WordPress | Theme by Roy Tanck | Customized by Brian Damage