PDA

View Full Version : Create "Instant Links" when certain word are typed??


ataraxia
10-09-2004, 12:05 AM
Is it possible to set something up so that whenever someone types, say, the word "basketball" in a message, the word is replaced by a hyperllink to your Basketball forum or some other internal or external URL?

The really big advantage to this is that the users do not have to know or use any codes at all. When they type a certain word, it is automagically converted into a link. There is no learning curve or additional effort required from them. It's all automatic.

You could also use this as a kind of "automatic glossary", linking certain words to entries in your FAQ or to a permanent announcement. Or how about something more dynamic like a link to the current basketball scores on CNN or maybe today's closing stock prices for a particular company? Anyone typing a "$" or "?" sign could find it automatically linked to a currency conversion site. This has enormous possibilities!

Unfortunately, Replacement Variables do not work for this because the linking code is seen by the message editor as literal text rather than HTML if "Allow HTML" is turned off for security. There were also some other messy issues such as changing "hot words" into links in places where you would not want that to happen such as in the title of topics, threads, etc.

We'd need an "engine" that only looks for "hotwords" typed inside the text of a message in any of the editors. There should also be some simple facility for Admins to create, edit or delete HotWords as needed.

Any ideas on how this could be done?

thanks!

alkatraz
12-10-2004, 06:27 AM
cool idea =)

The Geek
12-10-2004, 11:00 AM
Its veryvery difficult to di. I had made a hack that did this on my site but I removed it when I upgraded to vB3.
The biggest difficulty is with urls. if you want to 'auto' link the word bob and someone types in www.bob.com then it is going to screw up your link.
The other problem is that it is VERY processor hungry. The more auto links you have (or variations on the theme)... the more it will slow things down.

I guess I could see if I could find my old code for you though...

benroles
12-10-2004, 11:47 AM
This would be very good.. if you could provide some code for this I may look at it. This is especially good for 'online businesses'. For example, I make gambling communities and get paid by aff. links (gambling affiliate programmes pay of excellently well - e.g. $150 per acquisition). However, as well as having ads it would be great for someone to type in XYZ Casino and this convert to an aff. link URL.

I have seen this done recently for ebay and amazon, but for a whole list of casinos it would be excellent. As such, code that is more flexible than the recent examples would be ideal.

Ben.

Blue Moose Aaron
12-10-2004, 12:00 PM
Why can't you use BBcode [url] tags in your replacement rather than HTML?

Torqued
12-10-2004, 12:15 PM
I would think that you would need to do it the same way as the censor filter works... if you could specify {bob} like you can in the censored words, then you could replace just bob but not http://www.bob.com. I would like to do this for multi-word combinations. For example, be able to link {peanut butter} and not have it consider it as 2 separate words "peanut" and "butter".

Could the code for the censor filter be modified or mostly duplicated to accomplish this? It is already evaluating the text when messages are posted...

JustAskJulie
12-10-2004, 01:08 PM
Why can't you use BBcode [url] tags in your replacement rather than HTML?

Because it doesn't work. If you use BBcode it just prints it as code rather than actually converting it like it would if you were making a post.

This has been one of my big things as well, I would love to have this work RIGHT and not screw up everything when it's done. It seems like THIS would be a great use of the replacements but you can't use the replacements this way.

amykhar
12-10-2004, 01:13 PM
uh, guys, there's already a hack posted that does what you are looking for in vb3. search for replacement text.

Amy

JustAskJulie
12-10-2004, 01:15 PM
I just found that..., it's still in beta mode

https://vborg.vbsupport.ru/showthread.php?t=71191

amykhar
12-10-2004, 01:31 PM
I just found that..., it's still in beta mode

https://vborg.vbsupport.ru/showthread.php?t=71191
and something you get by requesting here wouldn't be beta?

The Geek
12-10-2004, 01:39 PM
aw suck. I just dredged up the code mentioned earlier and tweaked it a tad.

Oh well... ill stick it here if you want it. There is no fancy install or interface for the words/links and yes... it can screw up URL's just like the other. I do think however this is faster. I just tested it on my site and works a treat.

nJoy

maximux1
01-08-2005, 06:00 PM
aw suck. I just dredged up the code mentioned earlier and tweaked it a tad.

Oh well... ill stick it here if you want it. There is no fancy install or interface for the words/links and yes... it can screw up URL's just like the other. I do think however this is faster. I just tested it on my site and works a treat.

nJoy
How difficult would it be to take TNG's hack and have it just ignore text within hyperlinks? Seems this could be a possible way to work around busting user links up.

Thanks for the work TNG