Archived : Techno Babble

This is the archived version of my b2evolution code blog.
If you require any help regarding b2evolution then
visit it's support forums

You can find my current blogs here
Code : {@link : WafflesOn}
Personal : {@link : InnerVisions}

« Tidying the Admin screen127.0.0.1 »

Predicting tags

Posted on 21st Apr 2008 in : Plugins & Widgets

Auto-complete your tags

I decided to have another play with tags as I tend to use them quite a bit on my posts and I'm always forgetting which ones I've used before and which ones I haven't. So I threw together a plugin that will auto-suggest tags based on ones that you've used in the past. It'll also show you a list of all other similar tags in case you have more than one tag with the same starting letter(s) although they're not clickable at the moment because I haven't got that far.

Installation is pretty simple, just download the zip ( AM AutoTags ), upload it, install it, then meander into the plugin settings and set the tag separator for whatever your version uses. That's it. Now when you enter tags you it should try and auto complete them for you and show you a list of other tags.

NOTE : I've only tested this in FireFox as my IE is having a crisis of confidence when it comes to running javascript, so if you use IE and it doesn't work then tough shit. Also, this is a pre-release version so it's bound to have a few quirks, if you find any then just let me know and I'll see what I can do to eradicate them.

¥

*edit* 24th April
I think I've finally managed to convince IE that it can actually understand javascript so this should now work in IE as well, zip file updated

41 comments

Comment by Gary { @link http://garysblog.co.uk } on 21/04/08
WOT, 2 post within a week mate ;) You must have too much time on your hands :)
I will give it a go and report back, :>>

Gz
Comment by Gary { @link http://garysblog.co.uk } on 21/04/08
Works for me buddy boy :) Not in IE though :(
There again, who uses IE ???
Glad I use Firefox!

Gz
Comment by John { @link http://wow-factor.com } on 21/04/08
Nice work. The show/hide is smooth.
On the Mac, it works with Firefox, Safari but not Opera 9.50 Beta.

Now if only that same show/hide could be used for the toolbars :)
Comment by ¥åßßå on 22/04/08
Gotta love x-browser :p

Ok I've made a few script changes so it *should* now work in opera, tested in 9.27 which I assume is latest stable, but it might work in beta. The zip file is updated so you can just download it again.

It still doesn't work in explorer ... mainly because I haven't tried particularly hard, and I still haven't made the "available tags" clickable.

¥
Comment by John { @link http://wow-factor.com } on 22/04/08
Clickable tags would be a nice touch. Thanks for the update, works with my Opera Beta nicely.

Comment by ¥åßßå on 22/04/08
Tags are now clickable ( zips been updated ) .... still doesn't work in IE, dunno if I'll over bother to make it do so ;)

¥
Comment by Gary { @link http://garysblog.co.uk } on 22/04/08
Nice one, it gets better and better. :)
What's next? how about a plugin to make a plugin!
Gz
Comment by ¥åßßå on 22/04/08
Lol EdB's already in the middle of coding one ;)

¥
Comment by Gary { @link http://garysblog.co.uk } on 22/04/08
Rofl, I was only joking as well ;)

Gz
Comment by Lurker on 23/04/08
boo
Comment by ¥åßßå on 23/04/08
Most people try and look semi-intelligent on my blog .... I say "semi" cos I have a fair few "M y S p ac E p r0 +x y" and "I own a school, how can I bypass it's filters", people visit my site :|

¥
Comment by ¥åßßå on 24/04/08
Swift update.

After a load of pissing around and some pointers from Danny I *think* I've managed to get this working in IE.

The zips been updated, let me know if you have any problems ;)

¥
Comment by Gary { @link http://garysblog.co.uk } on 24/04/08
Nice One :) will try it out later.

Gz
Comment by Gary { @link http://garysblog.co.uk } on 24/04/08
Just tried it out in IE6 and it kinda works.
When you try and select a couple of tags it just adds a comma to the tag and comma that is already there. That's IE for you ;)

Gz
Comment by ¥åßßå on 24/04/08
oh bugger, I forgot about the onclick stuff :p

¥
Comment by ¥åßßå on 25/04/08
Yet another update, cured the clickable stuff in IE and squashed a couple of bugs. Zip file updated

¥
Comment by Gary { @link http://garysblog.co.uk } on 25/04/08
Sorry Paul, works perfectly in IE6 , not in Firefox though! :(
Back to the old drawing board I guess !

Gz
Comment by ¥åßßå on 25/04/08
It works in FF here? About the nearest I can get to "not working" is if you click a new tag without separating it from previous tag in which case it'll replace the current tag for every click?

I've changed that behaviour as well, see if it does what you expect now?

¥
Comment by John { @link http://wow-factor.com } on 25/04/08
@ Gary, works for me in FF. Just remember to reload your plugins
Comment by ¥åßßå on 25/04/08
*points to the uber cool "reply to gary" link you could have used .... bloody aussies :|

¥
Comment by Lurker on 25/04/08
Give us a break, It's 8am.
Comment by ¥åßßå on 25/04/08
*points to the fact that you not only missed the "reply to yabba" link, you also forgot to type yer bloody name* ... I'll make allowances for the "before coffee", but any git that's so lazy arsed to have just got up at 8am deserves slapping :|

¥

*note* : it's now 23:00 ( "less than 8 hours to coffee" to aussies ) here, so feel free to take the piss whilst I sleep ;)
Comment by John { @link http://wow-factor.com } on 25/04/08
Your form doesn't remember anything....
Comment by ¥åßßå on 25/04/08
coded by a blonde :|

go get coffee :|

¥

*edit*
bollocks, I forgot to press "reply to the decaffeinated lazy arsed git :-S
Comment by John { @link http://wow-factor.com } on 25/04/08
:)
Back to the plugin... what's the best way to deal with 2 worded tags?

internet-explorer or internet_explorer or internet explorer ?

I noticed that the plugin didn't pick up any double worded tags
Comment by ¥åßßå on 26/04/08
Previous versions of the core had space separated tags, so I used "-", new style is comma separated, so I use spaces for double word tags

I can pull up double worded tags no problem ( have to type the second "r" of "pre-r[elease]" though )

¥
Comment by John { @link http://wow-factor.com } on 26/04/08
Ok, thanks for the info, i'll give it a spin
Comment by Gary { @link http://garysblog.co.uk } on 26/04/08
Just installed 0.91 and I am happy to report that it works fine for me in IE6, IE7 and FFox.
Enjoy the rest fo the weekend y'all

Gz :)
Comment by Lurker on 27/04/08
* OFF TOPIC *

Just running Ubuntu off live CD, its looking kinda good :) Not sure if it warrants binning Windows though !

Gz ;)
Comment by ¥åßßå on 28/04/08
Windows is enough of a reason to bin windows ;)

¥
Comment by Gary { @link http://garysblog.co.uk } on 28/04/08
Grrrrrrrrrrr, I trashed my system with Ubuntu (the pile of >:XX)
Not a happy bunny, I have lost EVERYTHING :>

On a lighter note : Good morning :)

GZ ;)
Comment by slamp { @link http://daury.net/ } on 22/05/08
Got a problem with predicting tag:
_am_autotags.plugins.php: line 48: var htsrv_url = "'.trim( $baseurl, '/' ).str_replace( '&', '&', $this->get_htsrv_url( 'am_tags_autocomplete' ) ).'";
On my installation it gives:
var htsrv_url = "http://www.domain.info/blogs/blogs/htsrv/call_plugin.php?plugin_ID=26&method=am_tags_autocomplete";

the words blogs appears 2 times.
Comment by ¥åßßå on 23/05/08
Bugger, I'll have to work on a fix for that and get back to you

¥
Comment by Lurker on 24/05/08
It's a default installation: http://s150188918.onlinehome.fr/blogs/
Comment by slamp on 24/05/08
Sorry It was Slamp. I forgot to login.
Comment by ¥åßßå on 25/05/08
Hi Slamp,

That's a tad weird because I can't replicate the doubling up. You can just hardcode the link to suit your install

¥
Comment by JC John SESE Cuneta (Laibcoms) { @link http://gameshogun.ws/ } on 13/07/08
Lol, I badly need this.. I'm tired doing edits because I used the wrong tag :p

Thanks a bunch! ^_^
Comment by Larry { @link http://cronicaslinuxeras.com/ } on 30/07/08
Hey, it works for me. One comment though, the first tag I start writing in the input field causes firefox to try itself to autocomplete and the list it displays hides the list the plugin shows. autocomplete="off" has to be appended to the input field in order to prevent this.
Comment by ¥åßßå on 30/07/08
I have to admit, that does my head in as well .... but I'm still undecided as to whether I should break "normal" browser behaviour ( kill the history ) or not ... I also considered having the list above the tags box ... but that would just make your screen bounce all over the place.

I suppose I could make the "kill the history" a setting, then we can have the best of bot worlds?

Note to self : need an "all tags" method ... bugger, that'll just lead to boolean tags, scrap that one :-S

¥
Comment by Daniel { @link http://daniel.hahler.de/ } on 18/03/09
Excuse my ignorance, but I haven't tested this.

But, I think this should be in core by default (auto-complete of tags). Is it still compatible to b2evo 3.x? Do you think it's "clean enough" to get added to the core?

Thanks.
Comment by ¥åßßå on 22/03/09
Hi Daniel,
Sorry for the delay.

It's pretty much robust enough for the core as it is, but it'd probably need a bit of a recode to convert as much as possible to jquery. Hopefully I'll get a chance to play with it and we'll see what happens ;)

¥
Page archived : 11th Nov 2009
 

X