vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.6 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=194)
-   -   Miscellaneous Hacks - Dynamic Amazon Links (https://vborg.vbsupport.ru/showthread.php?t=163393)

ShackMaster 08-16-2010 03:57 PM

This appears to be working good for us thus far on version 3.8.5... with the co.uk modification.

New links to Amazon.com, Amazon.ca and Amazon.co.uk are rewriting with our associate ID, but old links are not. In order for old links to work, we are having to edit and save with no actual edit being made.

Of course this is our initial findings... and we will have to verify that there are no other conflicts.

twistedsymphony 09-23-2010 04:44 PM

I just got this installed and running on 3.8.x and it seems to work great :)

one concern though... I'm new to the whole affiliate linking thing and I noticed it's adding "ref=nosim" to some of the links.

I didn't know what this was so I looked it up, people used to add it because it would take users directly to the desired products as opposed to a similar product's page.

Amazon has depreciated this tag a few years ago (hence why I'd never seen it) and they state that link that include it should still work but they don't recommend anyone use it anymore.

there is concern among some that the "ref=nosim" tag will at some point stop working and invalidate existing links.

it'd be nice if there were an updated version of this plugin that takes newer link protocol into account... or if someone with a good knowledge of amazon affiliate links could point out what needs to be changed in the code to get rid of that tag.

it looks like it's used in 2 places with the following line:

Code:

$out[1][$i] = 'http://www.amazon.'.$out[2][$i].'/exec/obidos/ASIN'.$asin[0].'ref=nosim/'.$associate_id;
I'm curious if it should be modified to this:

Code:

$out[1][$i] = 'http://www.amazon.'.$out[2][$i].'/exec/obidos/ASIN'.$asin[0].'ref='.$associate_id;
or to this:

Code:

$out[1][$i] = 'http://www.amazon.'.$out[2][$i].'/exec/obidos/ASIN'.$asin[0].'/'.$associate_id;

hqarrse 10-22-2010 11:36 AM

Version 4.0.8 has caused me some problems (this is my first try so I don't know if it worked in previous versions of VB4).

Firstly I had to manually create the plugin - the XML upload throws an error. This was no problem - just look at the XML file and it is very obvious what to enter when you do 'Add new plugin'. However....

The function only worked for a new post. I believe this is to do with cache. Therefore after this initial posting is made, this line in the plugin no longer does anything:

Code:

$post['pagetext'] = amazon_links($post['pagetext']);
My solution - I'm sure not the ideal one, is to scrap the plugin and edit the file showthread.php as follows:

after line 113 add the include
Code:

require_once(DIR . '/includes/functions_amazon_links.php');
after line 980, in the loop for the large query that reads the post table:

Code:

$post['pagetext'] = amazon_links($post['pagetext']);
and then after 1469 when the post cache is being read

Code:

$post['pagetext'] = amazon_links($post['pagetext']);
Secondly the regex seems to be case sensitive when searching for URL, despite the /i at the end. Therefore as given it will not find
Code:

URL=
and (sod's law) the post I was testing on had it in upper case. I assume the user typed it in manually. I haven't been able to fix that yet, hence this post. Can a regex expert please help and make the function search for both URL and url?

Claygp 11-21-2010 03:12 PM

Can we please get an updated version of this for 4.0.8? Mine stopped working with the upgrade. :(

raaowdot 11-30-2010 01:30 PM

Does anyone know how to adapt it for amazon.co.uk?

I've tried to amended the codes from com to co.uk however I'm not able to do this with the variable. Any ideas?

mulesnx 12-07-2010 06:55 PM

When I add a link, it truncates the amazon link but does not add affiliate code. I am using 3.6.7

wraggster 02-02-2011 02:28 PM

any chance of a vb4 version ?

lubbie 03-09-2011 04:50 PM

Same here. Appreciate an update to vb4

wraggster 03-22-2011 01:53 PM

Quote:

Originally Posted by ShackMaster (Post 2084814)
This appears to be working good for us thus far on version 3.8.5... with the co.uk modification.

New links to Amazon.com, Amazon.ca and Amazon.co.uk are rewriting with our associate ID, but old links are not. In order for old links to work, we are having to edit and save with no actual edit being made.

Of course this is our initial findings... and we will have to verify that there are no other conflicts.

do you have the full code of this working, i still cantget .com and .co.uk to work together

hiker 05-13-2011 07:47 PM

Quote:

Originally Posted by lubbie (Post 2171483)
Same here. Appreciate an update to vb4

ditto


All times are GMT. The time now is 09:01 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01566 seconds
  • Memory Usage 1,745KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (8)bbcode_code_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete