News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Amazon DVD

Started by hchute, December 16, 2008, 06:37:01 AM

Previous topic - Next topic

hchute

Link to Mod

This mod provides an Amazon DVD button in your posting template. It converts selected text into an affiliate link that searches for that text in Amazon's DVD (Movies & TV) store. 

Amazon allows and encourages these links that draw traffic to its site. The mod is designed to make it easy for your forum members to make clickable links in their posts when they reference the name of a movie or DVD.

If you are in Amazon's affiliate program, your affiliate code can be automatically embedded in the link, so that you get credit for any resulting purchases.

Screenshots:

Posting button:


Posting page (close-up):


Posting page:


How it's used:

When creating or modifying a post, your forum members can select text in that post and click on the Amazon DVD. The selected text will become a clickable link in the post. When visitors to your forum click on that link, a new browser page will open with the Amazon DVD search page results for that string.

The mod also provides an easy way for your forum moderators to modifying existing posts to convert text to Amazon links.

After running the automatic install, copy the included amazondvd.gif to your Themes/Default/Images/BBC folder. And, if you are part of Amazon's affiliate program, edit Subs.php in your Sources folder and replace the string "affiliate-id" with your affiliate ID assigned by Amazon.

Changelog:

1.0 - 12/08/08
- initial release
KBoards - (2.5M posts) | SMF mods for Amazon affiliates: - Amazon Search - Amazon DVD  - Amazon MP3

hchute

PS You may also be interested in other mods that build Amazon affiliate links. Here are the ones I've developed so far:


  • Amazon Search. Converts selected text to an affiliate link that searches Amazon's site for that text string.
  • Amazon DVD. Converts selected text to an affiliate link that searches Amazon's DVD store for that text string. The posting bbcode button is an image of a musical note. 
  • Amazon MP3. Converts selected text to an affiliate link that searches Amazon's MP3 download store for that text string. The posting bbcode button is an image of a musical note. 
KBoards - (2.5M posts) | SMF mods for Amazon affiliates: - Amazon Search - Amazon DVD  - Amazon MP3

Michael24

I can't find "affiliate id" in Sources/Subs.php so I can't enter my amazon id.

hchute

Make sure you're searching for affiliate-id - - note the dash in between the two words. Then replace that string 'affiliate-id' with your own affiliate id.

Also: Are you using SMF Version 1.*? Or are you on the 2.* beta?
KBoards - (2.5M posts) | SMF mods for Amazon affiliates: - Amazon Search - Amazon DVD  - Amazon MP3

Parents of Autistic Kids

I have manually installed this mod and cannot get it to produce a link. The button part works fine, puts in the [amazon] [/amazon] part just fine, but no link. I used N++ to edit the files. The reason i didn't use the auto installer was it wanted the permissions changed but I couldn't get the log in to work. I manually changed the permissions, screwed everything up and had to have my web host reset permissions for me. On the files it wants permissions changed on, what should the permissions be? The forum can be seen at hxxp:www.forum.parentsofautistickids.com [nonactive] Thanks  for your help and you hard work on this mod.

hchute

#5
^ Taking a look at that now... will post again shortly.

Update: The autoinstall for the mod updates a couple of existing files, and those files should be defaulting to 644 for their permissions. Anything 644 or above should work for the auto-installer.

You mention that the button adds an [amazon] [/amazon] code... but note that it should be [amazondvd] [/amazondvd] - -  so double-check that when you made the manual edits that you typed 'amazondvd' and not just 'amazon'.

Let me know if that corrects it for you!
KBoards - (2.5M posts) | SMF mods for Amazon affiliates: - Amazon Search - Amazon DVD  - Amazon MP3

Parents of Autistic Kids

#6
Sorry, It does put in [amazondvd][/amazondvd] I approved your test account if you wouldn't mind taking a look again. When i put the code in I copy/pasted it. (doesn't mean it didn't get copied right though) Thanks Randy

ETA: I have just checked the permissions and they are all set to 644 now, Don't know what they were set at when I origiannly tried to install the mod. What would happen if i tried the autoinstaller now after having manually added the code? Thanks again, RAndy

hchute

You could get unpredictable results if you tried running the auto-install after doing the manual updates.

One option is to undo the manual updates, and try running the auto-install. Before you do that though, let me take a look at your site and see if I notice anything amiss. BRB.
KBoards - (2.5M posts) | SMF mods for Amazon affiliates: - Amazon Search - Amazon DVD  - Amazon MP3

hchute

It is putting the bbcode in place properly - so that tells me that the updates you made to post.template.php are correct.

The problem is most likely in the Subs.php update. Check very carefully that you have exactly the code below copied into the Subs.php folder.

         array(
            'tag' => 'amazondvd',
            'type' => 'unparsed_content',
            'content' => '<a href="http://www.amazon.com/gp/redirect.html?ie=UTF8&location=http%3A%2F%2Fwww.amazon.com%2Fs%3Fie%3DUTF8%26x%3D0%26ref%255F%3Dnb%255Fss%255Fgw%26y%3D0%26field-keywords%3D$1%26url%3Dsearch-alias%253Ddvd&tag=affiliate-id-20&linkCode=ur2&camp=1789&creative=390957">$1</a>',
         ),

If you like, you can email me the Subs.php file (it should be under your Sources folder), and I can take a look at it.

- Harvey
KBoards - (2.5M posts) | SMF mods for Amazon affiliates: - Amazon Search - Amazon DVD  - Amazon MP3

hchute

#9
Got our email - yes, it looks like there is a problem with how the Subs.php file was changed in your manual edits:

In the following code:

array(
'tag' => 'anchor',
'type' => 'unparsed_equals',
'test' => '[#]?([A-Za-z][A-Za-z0-9_\-]*)\]',
'before' => '<span id="post_$1" />',
'after' => '',
array(
'tag' => 'amazondvd',
'type' => 'unparsed_content',
'content' => '<a href="http://www.amazon.com/gp/redirect.html?ie=UTF8&location=http%3A%2F%2Fwww.amazon.com%2Fs%3Fie%3DUTF8%26x%3D0%26ref%255F%3Dnb%255Fss%255Fgw%26y%3D0%26field-keywords%3D$1%26url%3Dsearch-alias%253Ddvd&tag=parentsofautistickids-20&linkCode=ur2&camp=1789&creative=390957">$1</a>',
),


... a parenthesis and comma ")," was accidentally deleted from the code at the end of the 'anchor' array.

Once that's added back in, the section of the code will look like this:

array(
'tag' => 'anchor',
'type' => 'unparsed_equals',
'test' => '[#]?([A-Za-z][A-Za-z0-9_\-]*)\]',
'before' => '<span id="post_$1" />',
'after' => '',
           ),
array(
'tag' => 'amazondvd',
'type' => 'unparsed_content',
'content' => '<a href="http://www.amazon.com/gp/redirect.html?ie=UTF8&location=http%3A%2F%2Fwww.amazon.com%2Fs%3Fie%3DUTF8%26x%3D0%26ref%255F%3Dnb%255Fss%255Fgw%26y%3D0%26field-keywords%3D$1%26url%3Dsearch-alias%253Ddvd&tag=parentsofautistickids-20&linkCode=ur2&camp=1789&creative=390957">$1</a>',
),


Try adding that back in and seeing how that works for you!
KBoards - (2.5M posts) | SMF mods for Amazon affiliates: - Amazon Search - Amazon DVD  - Amazon MP3

Parents of Autistic Kids

I put the ")," in as instructed, but the results did not change. I cleared my cache just to be sure. I guess I will upload the originals and then try the auto installer. Thanks for your help.

hchute

Hmm, that is so odd. Subs.php looks okay to me other than that missing "),".
KBoards - (2.5M posts) | SMF mods for Amazon affiliates: - Amazon Search - Amazon DVD  - Amazon MP3

Parents of Autistic Kids

I fixed it. Reinstalled the three files from originals, then ran the auto installer and now it works right.  :D Am still interested to know what was wrong before Thanks Randy

Parents of Autistic Kids

#13
One last thing. I can't tell if I put my affiliate ID in right my code looks like this array(
'tag' => 'amazondvd',
'type' => 'unparsed_content',
'content' => '<a href="http://www.amazon.com/gp/redirect.html?ie=UTF8&location=http%3A%2F%2Fwww.amazon.com%2Fs%3Fie%3DUTF8%26x%3D0%26ref%255F%3Dnb%255Fss%255Fgw%26y%3D0%26field-keywords%3D$1%26url%3Dsearch-alias%253Ddvd&tag=all****ut-20&linkCode=ur2&camp=1789&creative=390957">$1</a>',
),

I am not sure if I need an extra "-20" My ID has a "-20" and there is already one in the code, so I am confused. Should i see my affiliate ID when i click a link i made to amazon (in the resulting web address)? Thanks again, RAndy

hchute

^ Technically, your affiliate ID is your ID without the '-20'. You add the '-20' to the end of your affiliate ID to create your 'Affiliate tag'. So, the short answer is, don't add the second '-20' - it should just appear once in the code.

You won't see your affiliate link in the URL, but it is received by Amazon. You can test this with a small purchase - you'll see it credited the next day. But rest assured, your affiliate ID is being passed through that &tag field, even when it is not displayed in the Amazon URL.

Thanks for letting me know that the auto-install worked for you!

- Harvey
KBoards - (2.5M posts) | SMF mods for Amazon affiliates: - Amazon Search - Amazon DVD  - Amazon MP3

hchute

Update: I've updated the mod for compatibility with SMF 2.0 RC1, and SMF 1.1.8.

Existing users of the mod won't have to make any changes to keep using it. If you're upgrading SMF or newly installing the mod, this new version will ensure compatibility with the latest SMF versions.
KBoards - (2.5M posts) | SMF mods for Amazon affiliates: - Amazon Search - Amazon DVD  - Amazon MP3

Broc Lee

Just installed a fresh copy of SMF 1.1.8 and I am getting this at the top of every page.....

$txt['amazondvd_post'] = 'Amazon DVD';$txt['amazonmp3_post'] = 'Amazon MP3';$txt['amazonsearch_post'] = 'Amazon Search';

How or where can I correct this?

Thanks

hchute

Updated for compatibility with SMF 1.* up through 1.1.11, and SMF 2.0 RC1 and RC2.
KBoards - (2.5M posts) | SMF mods for Amazon affiliates: - Amazon Search - Amazon DVD  - Amazon MP3

- danny

hchute, thanks for the mod.

i've been tracking an error and can't figure it out. hope you can take a look and maybe advise what's causing it...

8: Undefined index: amazondvd_post
File: /home/XXX/public_html/Themes/default/Post.template.php
Line: 851


the same applies to the amazonmp3 mod...

8: Undefined index: amazonmp3_post
File: /home/XXX/public_html/Themes/default/Post.template.php
Line: 850


what do you think? it's repeating itself over and over in the error log...

- danny

Can anyone help with this?

Advertisement: