PDA

View Full Version : Links to Amazon


amykhar
05-26-2002, 03:30 PM
I have a shopping forum, and quite often people post links to sales items at Amazon. My board is an affilliate of Amazon, ergo I would like to transform any Amazon links to point to my affilliate account.

All it takes is appending a slash and the affilliate name at the end of the link.

So, basically, as URLs are entered in a message, the hack needs to see if it points to amazon.com. If it does, it needs to modify the link to the affilliate link.

This would probably be a useful hack for others besides myself. Anyone have any thoughts on how to do it?

Amy

Logician
06-15-2002, 08:07 PM
edited for bug fix.. check below

Me2Be
06-16-2002, 02:47 PM
This would be great -- Amy are you using it?

(Thanks Logician!)

amykhar
06-16-2002, 02:54 PM
I haven't had time to try it yet.

Going to try right now :D

Amy

amykhar
06-16-2002, 03:08 PM
The code is throwing errors. Pretty sure it has something to do with the quotes in the urls. Working on ironing out the kinks.

Amy

Logician
06-16-2002, 05:13 PM
Originally posted by amykhar
The code is throwing errors. Pretty sure it has something to do with the quotes in the urls. Working on ironing out the kinks.

Can you specify the errors? What's the url before parsed and after parsed?

Code seems to work correctly here..

amykhar
06-16-2002, 05:29 PM
Parse error: parse error in /home/eaforums/public_html/admin/functions.php on line 644

Fatal error: Call to undefined function: vbdate() in /home/eaforums/public_html/admin/sessions.php on line 356

Logician
06-16-2002, 05:42 PM
Vbulletin changed the code while it's parsed here. ;)

I attached the code into a text file, please apply from there and you'll be fine..

Please notice: The code is 2 lines, not 4! So do not break the lines in between! There are only 2 linebreaks inside, both after the

$bbcode);

lines.

Logician
06-20-2002, 06:04 PM
Does it work?

amykhar
06-21-2002, 02:22 PM
Sorry, I had to be away for a few days. It doesn't quite work. If I give it a link to a specific product, say

http://www.amazon.com/exec/obidos/ASIN/B00004TBF2/ref=pd_gw_qpt_2/102-7878268-1024166

It truncates all the product information and gives me

http://www.amazon.com/affiliatesite instead of

http://www.amazon.com/exec/obidos/ASIN/B00004TBF2/ref=pd_gw_qpt_2/102-7878268-1024166/affiliatesite

Amy

Logician
06-22-2002, 08:46 PM
ok I edited the code and fixed the bug.. It now seems to parse all amazon related [URL] and [URL] tags correctly. However since I dont use it, I dont know if there are any further bugs. So please check this code and let me know how it is doing.

amykhar
06-23-2002, 04:17 AM
Works beautifully now!

Thank you :)

Amy

Brain Crusher
03-02-2003, 10:50 PM
great hack works it also with amazon.de?

thx

ryancooper
06-19-2003, 06:57 PM
Awesome And Thank yOu!!

amykhar
06-19-2003, 08:35 PM
This one is already updated for VB3 and being tested. It should be released when VB goes gold.

amykhar
06-26-2003, 02:11 PM
I made a few changes to the link structure because I learned from Amazon that not all of my sales were tracking the old way. In my new, improved version of this, my orders have more than DOUBLED. This isn't so much that orders are up. It's more that not all sales were tracked before.

Given that I only fixed the problem in early June, and sales are up this much, I have to wonder how many I was losing before.

limey
07-19-2003, 10:45 PM
Can you add on to this? I have another affiliate that uses a ? and then the afilliate ID. I tried copying the code and putting hte correct data and I get:

Warning: REG_BADRPT

vadimr
09-28-2003, 11:22 PM
The changes that you made, are they available in the code in the previous page, or you never posted them here?
I know this is an old thread.
Thanks

I made a few changes to the link structure because I learned from Amazon that not all of my sales were tracking the old way. In my new, improved version of this, my orders have more than DOUBLED. This isn't so much that orders are up. It's more that not all sales were tracked before.

Given that I only fixed the problem in early June, and sales are up this much, I have to wonder how many I was losing before.