Only fill this in if you're a spammer huh? Your name :
Your email :
Your message :
Apr
23rd
2007

Playing with clouds

Posted in : Plugins & Widgets

Yay I got a Zeitgeist ........ whatever the hell one of them is .... personally I call it a search cloud, it's far easier to spell :| In the true spirit of OpenSourceSoftware I stole the idea off Whoo and decided to see how easy it would be to create a b2evolution plugin that did the same thing. It's probably taken me longer to write this post than it took to code it :p

How does it work ?

It's pretty simple really, the plugin scurries through your hitlog and finds all of the hits that have been flagged as coming from a search engine. It takes all these hits and meanders off to count them, grabs a beer and a smoke and then ambles back with a cloud ready to be slapped on your blog. If it's enabled then you should see a cloud below the first post on the first page of my blog, the font-size indicates how often that search term was used to find my tacky lil pad :D

If any of you fancy having a pre-release play with it then you can steal it from here (we've now released version 1.0 of the plugin on Sourceforge ), unzip/upload/install it and then add the following skintag to your skins _main.php

Code:

$Plugins->call_by_code( 'am_srchcloud', array() );

You can pretty much throw that anywhere in your skins main, even inside your post loop as it defaults to only showing once per page. There's a couple of parameters you can use :

  1. blog : spookily enough this is the blog ID that you want to show the cloud for. The default is to use the current blogs id. If you set it to 1 then it will show all hits for all blogs
  2. show_once : by setting this to false you can display more than one cloud, the default is to only show once

If you want to play with the styling then just take a root around in the plugins source and you'll see all the classnames it uses, you can even play with the html it produces to bend it to your will. The chances are that most of that bit will become params by the time the release version comes out.

That's pretty much it really. As always if you find any bugs or want to send me the odd million quid then feel free to leave a comment
¥

*edit* 29th April

This plugin has how been released on Sourceforge, unfortunately we forgot all about the help file so here's a quick rundown of all the parameters

*edit*4th May

We've now released version 1.1, which actually has a semi-useful helpfile ;) ... you can read all about it on AstonishMe

Trackback URL (right click and copy shortcut/link location)

Trackback url for this post
Note : This trackback url is time limited so use it within 30 minutes or the SpamHound will snarl at you.

http://waffleson.co.uk/z/?k=364626026331032381c00171d7398ced61d2508433f463cb3

Replied on : 04/28/07 @ 02:48 pm #1

After gawping jealously at Whoo's clouds of glory I screwed up my eyes and wished that someone would make something like that for b2evo. Imagine my delight, etc. Nice one. I tried it out on my main blog in the sidebar and it's devastatingly simple & effective. Well written too so even a numpty like me can understand it. Will need me to do some skin mods for me to use properly so I'll wait a bit for next iteration maybe as I'm too idle to do it twice. Meanwhile, fancy some feedback? From the mundane to the wildly optimistic.
- Like to be able to limit number of items shown, showing top n most interesting or recent
- Looks like the list is dynamically calculated, so is there likely to be a performance hit on well-used sites? Any chance of it ever being cached, refreshed every 30 mins or something?
- Some search terms are stupidly long, can they be optionally truncated?
- Obscenity filter? Amazing how often my blog gets hit for 'weird sex'. Ahem.



What should we do with spammers? You want to stone them
 
 
¥åßßå users avatar

Posts : 845

Joined : 10/05/05

Location : 127.0.0.1

Reply to comment 13934 by ¥åßßå

Replied on : 04/28/07 @ 03:14 pm #2

Lol, ooops, I suppose I should have posted an update :p

We've actually been working on this in svn and have released a version of it that has a limit, and a few more parameters. We'll be implementing a cache in the next version although we'd been toying with a 24 hour cache ..... guess I'll make it a setting and then everybodys happy.

I think I could probably do with the obscenity filter myself, there seems to be a fair few searchers that misunderstand the sort of pumps I tend to babble about :P

The evocore already limits each individual search word ( to 10 chars I think ), but it wouldn't be to hard to also build in a total length ... guess that'll be another setting.

If you want to grab the release version you can get it from Sourceforge, unfortunately, being the blonde that I am, I forgot all about the help file until after I packaged up the release, so you'd need to look at the source to get all the parameters .... hopefully they'll make sense to non-blondes as well .... note to self, nag Scott to do the help file :p

Thanks a lot for the feedback, it's always invaluable :D

¥

What should we do with spammers? You want to play with them

I may have opened the door, but you entered of your own free will

 
 

Replied on : 04/28/07 @ 05:11 pm #3

Nice, that's even better. I tried this version too - it has much promise. I shall keep my eye on this one. Cheers.

What should we do with spammers? You want to hang them
 
 
¥åßßå users avatar

Posts : 845

Joined : 10/05/05

Location : 127.0.0.1

Reply to comment 13936 by ¥åßßå

Replied on : 05/04/07 @ 08:57 am #4

We've now released version 1.1 which has a cache, word filter and a term length setting. You can grab it from the same link ;)

¥

What should we do with spammers? You want to play with them

I may have opened the door, but you entered of your own free will

 
 

Replied on : 06/17/07 @ 10:21 pm #5

Yay! Now I have my very own cloud. Nice. And with the options I suggested... now I'm pathetically grateful. Thanks a lot for this plug-in. Thanks also for the crystal documentation - easiest plug-in I've dealt with for a while. You can see it working at the bottom of my main sidebar.

Now, my query (you knew there would be one huh?) is this. I've set the order to desc (after trying them all), and I notice the top item showing is not the most popular, as the biggest item is a little way down the list. And changing the number of searches shown does change the order a bit as new items come and go. When rand is not selected is there still any randomisation when the list is displayed, and if so can we turn it off? I'd like to show a 'Top of the Pops' style league table, ideally.

What should we do with spammers? You want to play with them
 
 

Replied on : 06/17/07 @ 10:31 pm #6

Doh. OK, I've just got it. It's alphabetical. It was 'Zina Saro-wiwa' that give me the clue. So forgive and forget my ramblings above if you will. But still, any chance of having it in asc/desc order of popularity, as opposed to alphabet?

What should we do with spammers? You want to play with them
 
 
¥åßßå users avatar

Posts : 845

Joined : 10/05/05

Location : 127.0.0.1

Reply to comment 14031 by ¥åßßå

Replied on : 06/18/07 @ 09:00 am #7

Lol, give you an inch and you want a mile :p

If you amend this bit of code ( to add the /* .......... */ ) then it'll show you the cloud in highest -> lowest order.

/*
switch( $params[ 'order' ] )
{
case 'asc' :
ksort( $search_stats );
break;

case 'desc' :
krsort( $search_stats );
break;

default:
shuffle( $search_stats );
}
*/

¥

What should we do with spammers? You want to play with them

I may have opened the door, but you entered of your own free will

 
 

Replied on : 06/18/07 @ 10:11 pm #8

Bullseye. Thanks, Yabba. It's now just as I want it. :)

What should we do with spammers? You want to play with them
 
 
¥åßßå users avatar

Posts : 845

Joined : 10/05/05

Location : 127.0.0.1

Reply to comment 14036 by ¥åßßå

Replied on : 06/19/07 @ 07:25 pm #9

really? When I last looked the cloud wasn't being carried towards me by a lightly clad, well developed blonde with low morals :(

Of course I'm now gonna have to code that into the next version ...... not the blonde, I'm not that good :p

¥

What should we do with spammers? You want to play with them

I may have opened the door, but you entered of your own free will

 
 

Leave a comment

Your email address will not be displayed on this site.
Your URL will be displayed.
About you

Just fill in the bits you want, none of it is required



Your email address will only be used to send you adverts for viagra and rolex watches.



(Line breaks become <br />)
Leave a comment
Code:
=> :!: :?: :idea: :) :D :p B) ;) :> :roll: :oops: :| :-/ :( >:( :'( |-| :>> ;D :)) 88| :lalala: :crazy: >:XX :o