vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   Amazon Associates Hack for VB3 (https://vborg.vbsupport.ru/showthread.php?t=72560)

amykhar 12-05-2004 10:00 PM

Amazon Associates Hack for VB3
 
This hack converts any US amazon link posted on your board to use your affilliate id and is based of some work Logician did for me in Vbulletin 2, but is an improved rewrite. The old version did not track well with Amazon because it did not strip out Amazon session ids.

Please note that you need to change my affilliate id to use yours.

Also note that the chunk of code you are looking for in edit.php may not be an exact match in your file. You are looking for the query that updates the post table with the edited post.

Regarding Update.zip Update.zip contains a new functions_amazon.php that I would like some people to try out before I add to the regular zip file. The new function handles Amazon's new link format, and I believe, works better than the original function. Please LET ME KNOW if you try it and it works for you.

-------------
This hack will always be free, however your donations are kindly accepted and will help towards further development. If you donate, please leave me some info (either your forum site or username at vB.org) so that I can thank you. :)
https://vborg.vbsupport.ru/external/2010/02/12.gif

MrNase 12-06-2004 12:44 PM

What does this hack do?

amykhar 12-06-2004 12:45 PM

Quote:

Originally Posted by MrNase
What does this hack do?

converts any amazon link posted on your board to user your affilliate id.

Blue Moose Aaron 12-06-2004 01:03 PM

This is a really good idea. I will install for sure when complete!

Reeve of shinra 12-06-2004 01:21 PM

I'm really glad to see this released. How does this work with your non-us members?

amykhar 12-06-2004 02:13 PM

Quote:

Originally Posted by Reeve of shinra
I'm really glad to see this released. How does this work with your non-us members?

I don't really have many members who use non-us amazon sites. So, I haven't tested that aspect. I believe some work would be required to make it more international.

amykhar 12-07-2004 02:38 AM

For the record, I installed this hack 3 days ago and have already sold 22 items. Given that I have an off-topic site that normally sells 2 or so items a quarter without the hack, I think this has the potential to make serious money for forums with a true focus.

Amy

fiber1 12-07-2004 09:33 AM

Nice, I just put a full amazon shop on my site instead though since it only took about 5 minutes.

dndog 12-08-2004 03:23 AM

AWESOME.

This is sheer genius.

/me clicks install.

NightWalk8r 12-08-2004 03:47 AM

Thanks you soooo much!!!!!!!

Phalynx 12-09-2004 09:37 PM

Good tool, thanks.

amykhar 12-10-2004 12:34 PM

Is anybody actively using it? Found any link rendering problems? I know that it's tracking items very well and I am getting credit for purchases - even direct links to products. My one concern is that with people using different editors (WYSIWYG, enhanced, and guided, etc.) that some of the urls might get botched.

If no problems have been reported in a couple of weeks, I'll move on to getting this working in the PM system as well.

Amy

amykhar 12-11-2004 09:38 PM

This hack is now out of beta. Enjoy.

bold 12-11-2004 10:29 PM

Quote:

Originally Posted by amykhar
This hack is now out of beta. Enjoy.

Thanks for the hack. Do i replace epinionaddicts?

amykhar 12-11-2004 10:42 PM

Quote:

Originally Posted by bold
Thanks for the hack. Do i replace epinionaddicts?

Yes, you do.

boatdesign 12-14-2004 01:12 AM

Awesome modification - thank you very much!!!

Only problem is that for some reason it is working fine for me if I use the Enhanced editor, but if I use the Standard editor it is not working at all it seems. I cannot figure out how to get it to work with the standard editor...

amykhar 12-14-2004 01:33 AM

Quote:

Originally Posted by boatdesign
Awesome modification - thank you very much!!!

Only problem is that for some reason it is working fine for me if I use the Enhanced editor, but if I use the Standard editor it is not working at all it seems. I cannot figure out how to get it to work with the standard editor...

Let me check the code when I get home. I may have tweaked something else that I forgot to put in the instructions.

amykhar 12-14-2004 12:01 PM

Quote:

Originally Posted by amykhar
Let me check the code when I get home. I may have tweaked something else that I forgot to put in the instructions.

Try this:

In the file includes/functions_newpost.php Find:
Code:

                $urlReplaceArray = array(
                        "http://\\2\\4"
                );

Replace with:
Code:


                $urlReplaceArray = array(
                        "\\2\\4"
                );

For some reason, vbulletin developers decided to put urls in the database differently depending on the editor used. This just makes the standard editor urls the same format as the WYSIWYG.

I'll add this to the text file.

Amy

rinkrat 12-15-2004 06:58 AM

Great idea!! I love this!!

boatdesign 12-16-2004 02:48 AM

Fantastic!!! Thanks very very much Amy :)

(and I'm sorry I didn't say thank you earlier - because of the way vbulletin doesn't leave the url statements in the code, they looked exactly the same to me when I first saw the reply, but if you hit quote you can see the difference.

Thanks again so much - works great!

amykhar 12-19-2004 11:06 PM

I have updated the code so it now works in private messages as well. In addition, I tweaked things so you only have to change the affilliate id in one place, and have made the code a bit easier to install.

If you have the old version installed, you will need to remove the changes you made in functions_newpost.php and editpost.php.

limey 01-05-2005 06:37 PM

getting double //ref=nosim with latest code. Not that it matters really I think it still tracks ok.

Great hack!

RichieBoy67 01-05-2005 10:04 PM

I am sure this will sound stupid...

I am trying to edit the functions_amazon.php file and I am very confused as to where my associates ID goes.... It asks for it in a few places... I don't want to mess up...

help please..

amykhar 01-05-2005 10:56 PM

Quote:

Originally Posted by RichieBoy67
I am sure this will sound stupid...

I am trying to edit the functions_amazon.php file and I am very confused as to where my associates ID goes.... It asks for it in a few places... I don't want to mess up...

help please..

Code:

// enter your associate id here

$associate_id = "your_id";

You only need to change it in one spot. The rest use the variable. Change it right where it says your_id.

amykhar 01-05-2005 10:57 PM

Quote:

Originally Posted by limey
getting double //ref=nosim with latest code. Not that it matters really I think it still tracks ok.

Great hack!

Yes, it still tracks :)

RichieBoy67 01-05-2005 11:02 PM

Cool, That is exactly what I did but I wanted to be sure....

Thanks :)

amykhar 01-05-2005 11:07 PM

Don't hold me to this one, gang, cause I haven't tested it. But I THINK you can make this work for international Amazon sites simply by changing the .com to the extension you desire whereever it occurs in the Amazon functions file. (Please don't try to do this if you can't code. Wait until somebody with experience tests it first)

For example, if you use the Canadian Amazon, you would change .com to .ca everywhere it occurs.

If you use more than one Amazon because you are a multicultural site, you would just have to repleat the code blocks - once for each country. AGAIN DON'T TRY THIS IF YOU AREN'T A CODER. LET SOMEBODY ELSE PAVE THE WAY.

I'm not going to support the internationalization aspect because I don't use it. Try it at your own risk.

Slave 01-08-2005 10:48 AM

Just looking at this .. and a question comes to mind ..

What's the point/need for the "/ref=nosim/"?

(This is for co.uk Amazon btw .. not .com)

limey 01-08-2005 12:28 PM

Quote:

Originally Posted by Slave
Just looking at this .. and a question comes to mind ..

What's the point/need for the "/ref=nosim/"?

(This is for co.uk Amazon btw .. not .com)

ref=nosim means that when you goto amazon's product/item page there are NO similar items on that page. Just the item in question.

Cheers.

cteselle 01-26-2005 05:10 PM

Thanks for putting this together!

It's great that it deletes other associate id's from the direct links, however if someone links to the main page using:

http://www.amazon.com/exec/obidos/redirect-home/someid-20

the link turns into:

http://www.amazon.com/exec/obidos/redirect-home/someid-20/ref=nosim/myid-20

Who gets the credit then?

amykhar 01-26-2005 05:28 PM

I don't know. But, if I get time in the next day or so, I'll work on knocking other people's referrals out of other links as well.

Amy

OrangeFlea 02-04-2005 03:00 PM

I recently visited a message board that had a "Shop with Amazon" drop down menu on the top of their forum (navigation bar area). When users click on this link, a small search box (similar to the “Search Forum” box) with an amazon logo and design appears, in where users would enter their query in the search-like box. For example, a member would type in a product name and it would automatically take them to the corresponding amazon.com page.

I was wondering how I would be able to install this feature onto my message board. Please try to be very thorough and detailed when describing the steps and the coding involved.

cteselle 02-04-2005 03:51 PM

Quote:

Originally Posted by OrangeFlea
I recently visited a message board that had a "Shop with Amazon" drop down menu on the top of their forum (navigation bar area). When users click on this link, a small search box (similar to the ?Search Forum? box) with an amazon logo and design appears, in where users would enter their query in the search-like box. For example, a member would type in a product name and it would automatically take them to the corresponding amazon.com page.

I was wondering how I would be able to install this feature onto my message board. Please try to be very thorough and detailed when describing the steps and the coding involved.

This is almost a hack by itself, but here it goes:

In your navbar template, find:

Code:

                <tr>
                        <td class="thead">$vbphrase[search_forums]</td>
                </tr>
                <tr>
                        <td class="vbmenu_option" title="nohilite">
                        <form action="search.php" method="post">
                                <input type="hidden" name="do" value="process" />
                                <input type="hidden" name="showposts" value="0" />
                                <input type="text" class="bginput" name="query" size="20" />$gobutton<br />
                        </form>
                        </td>
                </tr>
                <tr>
                        <td class="vbmenu_option"><a href="search.php?$session[sessionurl]" accesskey="4">$vbphrase[advanced_search]</a></td>
                </tr>

After that add:
Code:

<!-- Amazon.com Search Start -->
                <tr>
                        <td class="thead">Search Amazon.com!</td>
                </tr>
                <tr>
                        <td class="vbmenu_option" title="nohilite">
                        <form action="http://www.amazon.com/exec/obidos/external-search">
                                <input type="text" class="bginput" name="keyword" size="20" />$gobutton<br />
                                <input type="hidden" name="mode" value="blended" />
                                    <input type="hidden" name="tag" value="YOUR ASSOCIATE ID" />
                        </form>
                        </td>
                </tr>
                <tr>
                          <td style="background-color:#000;" height="40" align="center"><a href="http://www.amazon.com/exec/obidos/redirect-home/YOUR ASSOCIATE ID"><img src="http://g-images.amazon.com/images/G/01/associates/build-links/ap-search-logo-126x32.gif" height="36" border="0" width="126" /></a></td>
                </tr>
<!-- Amazon.com Search End -->

Don't forget to change "YOUR ASSOCIATE ID" with the correct info.

OrangeFlea 02-04-2005 04:15 PM

Cteselle, thank you so very much!

I was wondering, will it show the amazon.com graphics on the search box display? I want it to look somewhat professional and official.

EDIT: Also, will guests be able to view it?

cteselle 02-04-2005 04:21 PM

Quote:

Originally Posted by OrangeFlea
Cteselle, thank you so very much!

I was wondering, will it show the amazon.com graphics on the search box display? I want it to look somewhat professional and official.

EDIT: Also, will guests be able to view it?

The amazon graphic will appear below the search box.

Guests will be able to see it, if you have search turned on for guests.

OrangeFlea 02-04-2005 06:44 PM

Another question.

This only creates another table for the pre-existing search box. I wanted to make a separate drop-down menu altogether on the navbar. Is it possible for you to provide me with the code that does this?

gregwatson 03-16-2005 11:28 PM

So is there any way to get this to work with the GAL auto linker hack?

Greg

Installed

amykhar 03-17-2005 12:12 AM

It's two separate things that you should be able to use together. This hack modifies links, not text. The other hack modifies text, not links.

gregwatson 03-17-2005 12:30 AM

Quote:

Originally Posted by amykhar
It's two separate things that you should be able to use together. This hack modifies links, not text. The other hack modifies text, not links.

It's probably just a matter of "sequence" ... right now this won't modify a link that is created by GAL ... I was trying to simply GAL ...

Greg

Adrian Schneider 03-17-2005 12:38 AM

Sorry this may be kind of off topic, but how does the Amazon associates thing work? Do you place ads? Explain this to stupid old me. :)


All times are GMT. The time now is 03:13 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.01386 seconds
  • Memory Usage 1,837KB
  • 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
  • (5)bbcode_code_printable
  • (12)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)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