PDA

View Full Version : Ability to auto-link set keywords.


vadimr
09-28-2003, 08:33 PM
The idea behind this hack/feature is to help with many webmasters to link their visitors to the right place right away.

The feature is as follows.. and it should be very easy to implement because the bad word feature is already there so therefore the text gets filted each time it is submitted.

Basically I want to be able to add keywords and the URL for them. Each time someone writes lets say the word google, I want my vbulletin to automatically link it to www.google.com with target window _blank (but that blank feature could always be added as the part of the url). I don't want a simple addition of www in the front of the word and .com in the end of the word, I want my specific url. So if i want to send everyone who types google to toolbar.google.com I can change that in the database/config file somewhere.

Replacement would do this fine, however as noted by Scott MacVicar it could break something if someone was to paste a URL. So It has to be a little smart, all url should stay un-touched.

Also if someone was to go and edit the post later and remove the link and just again put the word google in there, the hack should again link the word up, just like the bad work feature.

To make it even more smarter, make it up to two words searchable
so if someone was to type google it would go to www.google.com and if someone was to type Google Toolbar it would go to toolbar.google.com and so on..

This would be very benificial to many users, to help promote their sponsors and so on. Just think of it, if you site is sponsored by Bob International (making this up), and each click-through earns you more money, wouldn't you be happy if Bob Internation was posted on your site that everyone would go to bob international with your affiliate link?

I want to hear some feedback on this, thanks guys..
- Vadim

assassingod
09-28-2003, 08:36 PM
<a href="https://vborg.vbsupport.ru/showthread.php?s=&threadid=50116" target="_blank">https://vborg.vbsupport.ru/showt...threadid=50116</a>

Try that

vadimr
09-29-2003, 02:24 AM
This is a good idea, but not exactly finished.. I wish I was more fluent with php to edit that code... I'll try to see what I can do.. I even have a database that I created that has all my affiliate's name and their links.. With a control panel so you can always, add, edit and delete new users... However this would be a very slow operation if the replacement was used to parse the links when viewing the site.. It has to be only when posting or editing a msg, else the operation to load pages would take too long to work..

memobug
09-29-2003, 07:52 AM
I would appreciate something like this but for a different reason. I have used the Replacements for this with some success. Adding a leading space to each replacement will help avoid problems with URLs getting messed up if someone has a keyword in a URL.

However, when a post is edited, the replacement text is rendered and you wind up with HTML in your message body that doesn't display properly.

So I think you have a good idea here, and I can think of a lot of uses for it.

Regards,

Matt

vadimr
09-29-2003, 12:00 PM
Matt,
Thanks for the feedback, I want to ask you a few questions. Can you elaborate further on the leading space? I really would like to avoid that problem.
Also you said once the text is edited the replacement text will be rendered and you'll end up with HTML. I understand that this will happen if you are just using plain replacement but what if it was modified to work with vB code? So even if the user went to edit his msg, deleted the vB code still once it was submitted the keyword would be re-linked again.

This also can be made a little more interesting, once the keywords are found instead of being replaced with the direct link to the site, they could be replaced with something like www.yoursite.com/redirect.php?site_id=google this way you have a nice way of tracking clicks, changing re-direct url and etc.. all out of a database. I have this setup on my site for other reasons and it's a great way to track and update urls.

I also want to make this smart and not only search for 1 keyword then check what is the next word.. Like I said earlier google and google toolbar would have two different redirects.



I would appreciate something like this but for a different reason. I have used the Replacements for this with some success. Adding a leading space to each replacement will help avoid problems with URLs getting messed up if someone has a keyword in a URL.

However, when a post is edited, the replacement text is rendered and you wind up with HTML in your message body that doesn't display properly.

So I think you have a good idea here, and I can think of a lot of uses for it.

Regards,

Matt