Okay, I may have it... but won't know for sure until I get stats back.

METHOD

In Amazon's affiliate area, you can create links to any product by using their redirect link.

So a link to this:
http://www.amazon.com/Family-Guy-Vol-Season-Part/dp/B000HT3P6U/ref=wl_gtwy_ty/104-6772149-0161532?%5Fencoding=UTF8&coliid=I4S9D64SV0IS8&colid=GWCWI0CVIG8D

Would become this:
http://www.amazon.com/gp/redirect.html?ie=UTF8&location=http%3A%2F%2Fwww.amazon.com%2FFamily-Guy-Vol-Season-Part%2Fdp%2FB000HT3P6U%3F%255Fencoding%3DUTF8%26coliid%3DI4S9D64SV0IS8%26colid%3DGWCWI0CVIG8D&tag=AFFILIATECODE&linkCode=ur2&camp=1789&creative=9325

So replacing
http://www.amazon.com/
with
http://www.amazon.com/gp/redirect.html?ie=UTF8&location=http://www.amazon.com/
will redirect links

So what I did was the above, while also adding &tag=AFFILIATECODE before the &location=

In ubbthreads.inc.php
On or around Line 933, find:
Code
$body = preg_replace( "#(\r\n|\r|\n)#i", "<br />", $body );
And afterwards place:
Code
$body = str_replace("http://www.amazon.com/", "http://www.amazon.com/gp/redirect.html?ie=UTF8&tag=AFFILIATECODE&location=http://www.amazon.com/", $body);

Replace AFFILIATECODE with your Amazon.com affiliate code.

RESULT

When using that redirect, the landing page becomes:
http://www.amazon.com/Family-Guy-Vo...32?_encoding=UTF8&tag2=AFFILIATECODE

First off, the link works, so no harm/no foul. I will have to see if it actually counts because it does one thing: It changes &tag=AFFILIATECODE to &tag2=AFFILIATECODE

Amazon has usually been pretty good retrieving the AFFILIATECODE from the URLs, so let's hope this works despite the difference in tag name.

If that indeed works, I'll check for compatibility with Amazon.co.uk and Amazon.ca, etc, and create a tutorial here and at ubbdev.com

(Thanks to Gizmo for introducing me to str_replace wink )


GangsterBB.NET (Ver. 7.6.1.1)
PHP Version 5.6.40 / MySQL 5.7.23-23 (was 5.6.41-84.1) / Apache 2.4.54
2007 Content Rulez Contest - Hon Mention
UBB.classic 6.7.2 - RIP