PDA

View Full Version : Replacing words with links?


Jago
07-15-2002, 06:52 PM
Is there a hack that does this? I've searched both vbulletin.com and .org and haven't found too much info.

This is what I'm looking to do:

When someone types the word buy, it replaces the word with a hyperlink.

I would like to buy (http://www.buy.com) a toy.

TIA.

Velocd
07-15-2002, 07:00 PM
This should go in the hack request forum ;)

I don't believe it's been made, but I bet it can be done similar to that /me code.

I'm guessing you would be able to submit where the link actually takes you in the admin cp? It sounds interesting, but it sure would be spamful.

Jago
07-15-2002, 07:11 PM
Would an admin please move this thread to the Hacks Request forum? Thanks.

SaintDog
07-16-2002, 03:32 PM
Consider it moved :)

- SaintDog

Jago
07-18-2002, 06:57 PM
Anyone have any ideas how easy/hard this would be to implement?

Logician
07-18-2002, 08:37 PM
not exactly what you want but you may use the algorithm and adapt the code to your needs:

https://vborg.vbsupport.ru/showthread.php?s=&threadid=39071&highlight=amazon

memobug
08-24-2002, 04:01 PM
You can use the built-in replacements system to do this. Just create a replacement for

_bananas_ with <a href="link to bananas">_bananas_</a>

where those underscores are spaces, and it will swap each incidence of _bananas_ with the link.

The only probs are
1) case sensitivity
2) if you edit a post containing a replacement it will insert the html (as text) on the screen and you will have to fix before reposting.

You can, of course, create your own linked replacements, like

***AMAZON*** -> <a href="http://www.amazon.com">Visit Amazon</a>

Then wherever you put ***AMAZON*** you'll get the link, with little chance someone will do it accidentally.

However, it's still subject to the limitations 1,2 above.

Regards,

Matt