Quote:
Originally Posted by Tourmeister
Howdy,
Having problems with Amazon links again... Not sure why.
Original link posted on forum,
Code:
http://www.amazon.com/dp/B009I2BRUS/
Or this one,
Code:
http://www.amazon.com/dp/B009I2BRUS/ref=wl_it_dp_o_pC_nS_ttl?_encoding=UTF8&colid=1EEVRNXUZ4YUI&coliid=IKWF6MS36PJLJ
SHOULD get changed to
Code:
http://www.amazon.com/dp/B009I2BRUS/?tag=twtwhetex-20
But it is messing up. The "/dp/" part of the original link is getting an extra / stuck in it so that it becomes "/d/p/", and that screws up the link. I have NO CLUE how the replacement stuff works :giveup:
Here is the regular expression
Code:
http://[a-z\.]*?amazon\.([a-z\.]*)/([\d\w_\-]*)/?([product|dp|asin]+/[\d\w]+)(?:.*)
and here is the replacement code
Code:
<a href="http://www.amazon.$p1/$p2/$p3/?tag=twowhetex-20" target="_blank" title="$ameinfo[title]"><img src="images/misc/amazon_icon.gif" border="0" alt="$ameinfo[title]" /></a> <a href="http://www.amazon.$p1/$p2/$p3/?tag=twowhetex-20" target="_blank" title="$ameinfo[title]">$ameinfo[title]</a>
Any chance you know what is inserting that extra "/"?
Thanks.
|
It's a problem with the regex match. I'll have to look at Amazon URLs again. See if something has to be done for newer links that have been simplified.