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)

felxi 11-21-2007 10:00 PM

Dynamic Amazon Links
 
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

weeno 11-23-2007 12:08 AM

Thank you for taking this up. I've been trying to get the previous one to work, but unless the parsings perfect (in that it doesn't break in any scenario) then I'm reluctant to deploy it on my site.

downloading/testing.

edit: It's not working for me. links are not getting processed at all. Looks like lower case [url] aren't processed.

thanks
arn

redlabour 11-23-2007 05:50 AM

Great - but does it work with vbAnonymizer installed?

felxi 11-23-2007 06:23 AM

Quote:

Originally Posted by weeno (Post 1387802)
edit: It's not working for me. links are not getting processed at all. Looks like lower case [url] aren't processed.

@arn:
i made a little update and tested it. now the script will also replace [url] and [url="xxx"] instead of [URL] and [URL="xxx"].

@redlabour: i'll test it this evening to get it working.

Best regards,
Felxi

weeno 11-23-2007 06:37 AM

Quote:

Originally Posted by felxi (Post 1387897)
@arn:
i made a little update and tested it. now the script will also replace [url] and [url="xxx"] instead of [URL] and [URL="xxx"].

The lowercase still isn't working for the [url="xxx"]

example:
[url="http://www.amazon.com/Logitech-970155-0403-V20-Notebook-Speakers/dp/B0009WKBGC"]these[/url]

arn

felxi 11-23-2007 07:03 AM

Quote:

Originally Posted by weeno (Post 1387910)
example:
these

It should work now, I updated the script. You can test your link-codes in the functions_amazon_links.php and run this php file direct:

PHP Code:

<?php
echo amazon_links('some text
[url="http://www.amazon.com/Logitech-970155-0403-V20-Notebook-Speakers/dp/B0009WKBGC"]link text here[/url]'
);


function 
amazon_links($text) {
// ...
}
?>


weeno 11-23-2007 07:26 AM

Quote:

Originally Posted by felxi (Post 1387917)
It should work now, I updated the script. You can test your link-codes in the functions_amazon_links.php and run this php file direct:

Thanks. appears to be working well. I'll test it more extensively when I have time this weekend. again, appreciate the effort.

arn

reteep 11-23-2007 07:46 AM

Seems to work dude, good job!

daFish 11-23-2007 07:49 AM

Great release. I assume this works with the 3.6-series?

reteep 11-23-2007 07:52 AM

Quote:

Originally Posted by daFish (Post 1387943)
Great release. I assume this works with the 3.6-series?

Yea, running it on the latest 3.6.

projectego 11-23-2007 02:59 PM

[high]* projectego clicks install :)[/high]

weeno 11-24-2007 04:09 AM

Another issue.

It seems that using this hack removes vbulletin's auto truncate feature in long urls.

For example:

Without the hack, long urls are shortened. Example:

h_ttp://www.amazon.com/Microsoft-Offi...5878848&sr=8-1

Once you install the hack, the url ends up being very long, and not auto truncated.

h_ttp://www.amazon.com/Microsoft-Office-2004-Student-Teacher/dp/B0001WN16M/ref=pd_bbs_1?ie=UTF8&s=software&qid=1195878848&sr= 8-1

bada_bing 11-24-2007 04:46 AM

Reserved

felxi 11-24-2007 09:08 AM

Quote:

Originally Posted by weeno (Post 1388445)
Another issue.
It seems that using this hack removes vbulletin's auto truncate feature in long urls.


Hey weeno,
thanks for the report. the truncate feature is now added to the script.

In general the displayed link e.g. [url ] amazon-link [ /url] will get [url="new-amazon-link" ] amazon-link [ /url], so the displayed post-text isn't changed :).

Greetz,
felxi

djbaxter 11-24-2007 01:13 PM

Wow!

I've tried a few of these before, both for vBulletin and WordPress. This is the first one that actually WORKS for me.

Well done! :)

I made a slight modification to the plug-in that might be useful to others...

In functions_amaxzon_links.php, find at lines 6-7:

Code:

        /*
        * your partnernet ids
        */
        $associate_id_de = 'xxxxxxxxx'; // or leave empty
        $associate_id_com = 'xxxxxxxxxxx'; // or leave empty

Since I don't have or need an amazon.de account but I do have another regional account, I changed this to:

Code:

        /*
        * your partnernet ids
        */
        $associate_id_de = ''; // or leave empty
        $associate_id_com = 'xxxxxxxxxxx'; // or leave empty
        $associate_id_ca = 'xxxxxxxxxxx'; // or leave empty

Then find two instances of

Code:

amazon.(de|com)
at lines 17-18 and 42-43. Change to:

Code:

amazon.(ca|com)
For other regional Amazons, use the appropriate regional extension instead of "ca".

weeno 11-24-2007 08:37 PM

two more "issues"

1.

It breaks this link:
http://www.amazon.com/review/product...owViewpoints=1

since it has an ABIN number but is not meant to go to the product itself

2.

It doesn't handle [url=http://www.link.com]text[/url] (without quotes)

Regarding #1, in a related note, I might even prefer the urls all to be redirect urls via Amazon rather than any in the more abbreviated ABIN version... since that way the final url is as intended by the origanal poster, and your referal code is no longer embedded in the final destination url. But that might be a personal preference.

thanks
arn

felxi 11-25-2007 10:20 AM

hi weeno,
the issues are been solved. thank you for reporting.

regards,
felxi

weeno 11-25-2007 07:23 PM

Quote:

Originally Posted by felxi (Post 1389089)
hi weeno,
the issues are been solved. thank you for reporting.

regards,
felxi

Thanks,

Do you forsee any problems if I modify it to use the redirect code on all links, even those with ABINs in them?

arn

g00gl3r 11-26-2007 12:54 AM

reserved

djbaxter 11-26-2007 03:36 PM

Quote:

Originally Posted by g00gl3r (Post 1389422)
reserved

This is a serious question, not a flame: What is the purpose of a post like this? It seems to me it's more a non-post.

felxi 11-27-2007 05:55 AM

Hey wenno,

I think the best conversion you can get is using ref=nosim, because the link will be a direct product link in this case.

Greets,
Felxi

g00gl3r 11-29-2007 05:20 PM

Quote:

Originally Posted by djbaxter (Post 1389729)
This is a serious question, not a flame: What is the purpose of a post like this? It seems to me it's more a non-post.

Just saying I've reserved it for use on a forum in the future as I have no need for it currently. As the "mark if installed" feature promotes the trusted and used mods, I wanted to show I'd trust and use this mod.... but I haven't yet so haven't marked as installed.

I think you'll find many members do such a thing.

g00gl3r 11-29-2007 05:27 PM

Quote:

Originally Posted by djbaxter (Post 1388606)
Wow!

I've tried a few of these before, both for vBulletin and WordPress. This is the first one that actually WORKS for me.

Well done! :)

I made a slight modification to the plug-in that might be useful to others...

In functions_amaxzon_links.php, find at lines 6-7:

Code:

        /*
        * your partnernet ids
        */
        $associate_id_de = 'xxxxxxxxx'; // or leave empty
        $associate_id_com = 'xxxxxxxxxxx'; // or leave empty

Since I don't have or need an amazon.de account but I do have another regional account, I changed this to:

Code:

        /*
        * your partnernet ids
        */
        $associate_id_de = ''; // or leave empty
        $associate_id_com = 'xxxxxxxxxxx'; // or leave empty
        $associate_id_ca = 'xxxxxxxxxxx'; // or leave empty

Then find two instances of

Code:

amazon.(de|com)
at lines 17-18 and 42-43. Change to:

Code:

amazon.(ca|com)
For other regional Amazons, use the appropriate regional extension instead of "ca".

How would I get .co.uk work with this? Would
Code:

amazon.(ca|com)
become
Code:

amazon.(co.uk|com)
etc?

g00gl3r 11-29-2007 05:33 PM

Quote:

Originally Posted by djbaxter (Post 1388606)
Wow!

I've tried a few of these before, both for vBulletin and WordPress. This is the first one that actually WORKS for me.

Well done! :)

I made a slight modification to the plug-in that might be useful to others...

In functions_amaxzon_links.php, find at lines 6-7:

Code:

        /*
        * your partnernet ids
        */
        $associate_id_de = 'xxxxxxxxx'; // or leave empty
        $associate_id_com = 'xxxxxxxxxxx'; // or leave empty

Since I don't have or need an amazon.de account but I do have another regional account, I changed this to:

Code:

        /*
        * your partnernet ids
        */
        $associate_id_de = ''; // or leave empty
        $associate_id_com = 'xxxxxxxxxxx'; // or leave empty
        $associate_id_ca = 'xxxxxxxxxxx'; // or leave empty

Then find two instances of

Code:

amazon.(de|com)
at lines 17-18 and 42-43. Change to:

Code:

amazon.(ca|com)
For other regional Amazons, use the appropriate regional extension instead of "ca".

How would I get .co.uk work with this? Would
Code:

amazon.(ca|com)
become
Code:

amazon.(co.uk|com)
etc?

g00gl3r 11-29-2007 05:35 PM

It seems this mod isn't compatible with the vbanonymizer or vbseo or something lol. When I installed it - it stopped my viewtopic pages from being displayed.

uninstalled.

g00gl3r 11-29-2007 05:39 PM

I'm guessing it's this line I'd have to edit to get it to work....
Code:

        if(preg_match_all("/\[url\=(?:\")?(http:\/\/(?:[A-z0-9\.]+)?amazon\.(de|com|ca|co.uk)\/(?:.+))(?:\")?](.+)\[\/url\]/iU", $text, $out)) {
But what would I change it to? it's this that I have:https://vborg.vbsupport.ru/showthread.php?t=131292

felxi 11-30-2007 06:40 AM

it's working together with vbseo without any problemes. i gonna check it this evening.

pete_brady 12-04-2007 10:15 PM

working for .com (albeit without truncation of links) but can't get it going for .co.uk at all.

Vinyljunky 12-07-2007 09:22 AM

Quote:

Originally Posted by pete_brady (Post 1395111)
working for .com (albeit without truncation of links) but can't get it going for .co.uk at all.


Does anybody use this with VBSEO?

I also need it for .co.uk :)

VinylJunky

theinvisibleman 12-12-2007 06:48 PM

anyone had any joy with co.uk?

pete_brady 12-17-2007 10:29 PM

as well as .co.uk for amazon, i'm wondering would it be possible to add in support for other affiliate networks, either in this or a separate product?

For example, www.buy.at use their own standardised URLS to track affiliate referrals, so it should be straightforward enough(?) to add the appropriate prefix to any www.game.co.uk or www.play.com links:

Game.co.uk:
http://game-online.at/AFFILIATEID?DU...4/Mass-Effect/

Play.com:
http://playcom.at/AFFILIATEID?DURL=h...2&title=135786

other affiliate networks just need a variable appended to the URL...

pete_brady 12-30-2007 01:59 PM

anybody?

TRBoxman 01-04-2008 08:31 PM

I'm interested in the same kind of mod. Something simple that will append affiliate ID's to selected URLs.

irishblacknight 01-05-2008 04:29 PM

I'd be interested in using it if
  • it worked with co.uk
  • it worked with vbseo

Banana_man 01-16-2008 02:49 PM

Me too, i have been looking around for a plugin for play.com but no look so far. I will also be installing vbseo soon so it would be great if it worked with that.

Vinyljunky 01-16-2008 02:56 PM

Quote:

Originally Posted by irishblacknight (Post 1416014)
I'd be interested in using it if
  • it worked with co.uk
  • it worked with vbseo

I second that or rather I 3rd that :D

Alfa1 01-18-2008 02:32 PM

I am on vb 3,7 and it is not working for me. Please port this to vb 3.7

Also; I have a book review section where the amazon link is posted in a custom field. Can you please add a function to make this work for custom GARS fields?

sleepytom 01-19-2008 09:55 AM

this works well for the usa - i'd really like to do amazon.co.uk too though (i tried to change the .ca support to .co.uk but it doesn't work) It shouldn't be too hard to get it going though for someone with some php skills (i'm really no good and this stuff!)

also is their a way to get this to work on all the amazon links on my forum? as i understand it this only adds the code to newly posted links as opposed to links that have been posted in the past.

ChrisSy 01-22-2008 06:25 PM

Anyone got the code hacks to swap out .de for co.uk?

pete_brady 01-22-2008 08:03 PM

Would it help if some cash was offered to get this coded up?


All times are GMT. The time now is 06:19 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.01558 seconds
  • Memory Usage 1,838KB
  • 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
  • (17)bbcode_code_printable
  • (1)bbcode_php_printable
  • (13)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)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