Version: 1.05, by felxi
Developer Last Online: Dec 2010
Category: Miscellaneous Hacks -
Version: 3.6.x
Rating:
Released: 11-21-2007
Last Update: 11-24-2007
Installs: 92
Uses Plugins
Additional Files Is in Beta Stage
No support by the author.
Description
This Hack will easily rewrite all amazon links whitin the posts to your associate id. You can add your amazon.de and amazon.com associate id, links to both amazon stores will be replaced with the right id, it works fine with multilanguage boards.
vBulletin
vB 3.6.x working
vB 3.5.x working
updating
just upload the functions_amazon_links.php from the zip and don't forget to insert your amazon ids.
Change Log
25/11/2007 v1.05
- support for [ url=xxx]yyy[ /url]
- replacement for tag=xxx and ref=xxx in non asin links
- small fix for /preview/ links
24/11/2007 v1.04
- [url]amazon-link[ /url] long amazon links will be shorten vb like
23/11/2007 v1.03
- [url] and [url="xxx"] will be repleaced
Show Your Support
This modification may not be copied, reproduced or published elsewhere without author's permission.
Okay, I have this working, somewhat, under 3.8.1 PL1 using the hack to get multi-level domains, but the problem is, it is adding my affiliate IDs to all the URLs other than my my two multilevel domain affiliate IDs for Amazon UK and Amazon Japan.
I think it may have something to do with the preg_match section, which I keep trying to tweak to get working, but to no avail. Maybe someone here can help me out? Here's the code as I am using, with my affiliate IDs redacted:
PHP Code:
<?php function amazon_links($text) {
/* * your partnernet ids */ $associate_id_co_uk = 'azn-id'; // or leave empty $associate_id_co_jp = 'azn-id'; // or leave empty $associate_id_de = 'azn-id'; // or leave empty $associate_id_com = 'azn-id'; // or leave empty $associate_id_ca = 'azn-id'; // or leave empty
/* * tag=xxx and ref=xxx will be replaced with your associate id in non asin links */ $replace_targt_urls = true; // true or false // reeplace arrays $replace_src = array(); $replace_str = array();
Okay, never mind, this error is fixed, but the piece of code above is working for everything, including embedded links, except for the multi-level .co.uk and .co.jp domains, which I can't seem to get to work no matter what I do.
One more update, this plugin also won't work on URLs in the Calendar. So, to sum up, it won't work for the multi-level .uk and .jp domains, and it won't add the affiliate ID's to URLs posted in the Calendar -- that's where I'm at with this on a 3.8.1 PL1 board using the hack for mutli-level domains.
Can't get it to work on 3.7.2. The preg_match looks for the ASIN number, correct? If so, then the format of Amazon's link shouldn't matter, if the ASIN appears as below:
I now have 3.8.2 installed and the status is still the same for me with this plugin -- it won't work for .uk and .jp multilevel domains or in te VB calendar.
For now, I've disabled the plugin. When I get time, I may dissect the function and toss out some variables to see how it is working.
(EDIT: Disregard the following...my error...) For the .co.uk and .co.jp domains, I need those as well. I know that the regex for (co\.uk|co\.jp|de|com|ca) should work (syntax looks correct, and the dots are escaped properly), but I wonder how the script is parsing the $associate_id_co_uk and $associate_id_co_jp variable names, as they have one extra set of underscore and characters than the others. I wonder if that's where the problem lies...? That's why I want to look into the function more to see how it is setting the variables, if only for me to understand how it works overall. It's the regular expressions I sometimes get hung up on.