PDA

View Full Version : Auto convert parts of links that user's post (for affiliate programs)


007
04-10-2005, 09:04 PM
I want to be able to "replace" the beginning of some URL's in posts with an affiliate URL. By replace, I mean replace the actual link only through the replacements system. I want the links in the threads to remain the same, but to be replaced on page load.

For example:

Take the following site

http://site.com/?article=4324

And redirect links posted with the following:

http://affiliatesite.com/?affiliate...m/?article=4324

But using javascript to show the non-affiliate link in the status bar.

Basically I need to replace

http://site.com/?article=

with

http://affiliatesite.com/?affiliate...e/com/?article=

Leaving the last number off, so when different articles are linked to they will all work with the replacement? Does that make sense? Any suggestions?

I think it can be hardcoded somewhere, but what file would I put it in? If someone wants to make a real hack out of it, that would be awesome too.

Thanks.

~006

Marco van Herwaarden
04-10-2005, 09:33 PM
Sell if i ever find a site tricking me into a place that i don't want in this way, it would be the last time i visited there.

I always check my statusbar before clicking. If nothing is shown i won't click mostly or i will first try to look at page source. If i ever found out to be mislead, well i would be gone from there.

amykhar
04-10-2005, 09:36 PM
You could probably convert my Amazon or Ebay associates hack to do what you need.
I'm with Marco though. You shouldn't trick your users. Be open and let them know that you are doing it to support the board. The members of my site have no problem with my converting Amazon or Ebay hacks.

007
04-10-2005, 10:31 PM
Sell if i ever find a site tricking me into a place that i don't want in this way, it would be the last time i visited there.

I always check my statusbar before clicking. If nothing is shown i won't click mostly or i will first try to look at page source. If i ever found out to be mislead, well i would be gone from there.

Marco. That is a good point. I wasn't planning on using it that way. The affiliate links just look really messy and I think it would be cool to just show people the real page they will end up on.

Meaning, the link they see in the post IS the link they would end up on. It would just go through an affiliate site first and track the click. Nothing dishonest about that.

However, making a link like: (non working link, just hover over and see what I mean though)
http://really-cool-site..com (http://www.random-get-rich-quick-site..com/)

..would be very bad. That is not what I want it for.


---------

And Amy, I tried out yours but that changes the actual link. I am really just trying to keep the links looking good, and doing the affiliate stuff behind the scenes. I will take a further look at yours and see if it can be modded. :)

And my users will know about it. I'm just afraid of new members posting a link and seeing it posted differently, and thinking they messed up.

amykhar
04-11-2005, 02:08 AM
You can change mine just a wee bit to make it not change the text of the link if that's what you want. It just takes a bit of tinkering.

metrika
02-10-2012, 10:34 PM
I want it too