Advertisement:

Author Topic: Amazon DVD  (Read 17432 times)

Offline hchute

  • Jr. Member
  • **
  • Posts: 111
Amazon DVD
« on: December 16, 2008, 06:37:01 AM »
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
« Last Edit: December 21, 2008, 04:21:18 PM by hchute »
KBoards - (2.5M posts) | SMF mods for Amazon affiliates: - Amazon Search - Amazon DVD  - Amazon MP3

Offline hchute

  • Jr. Member
  • **
  • Posts: 111
Re: Amazon DVD
« Reply #1 on: December 16, 2008, 01:43:46 PM »
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

Offline Michael24

  • Semi-Newbie
  • *
  • Posts: 41
Re: Amazon DVD
« Reply #2 on: December 19, 2008, 07:23:42 PM »
I can't find "affiliate id" in Sources/Subs.php so I can't enter my amazon id.

Offline hchute

  • Jr. Member
  • **
  • Posts: 111
Re: Amazon DVD
« Reply #3 on: December 19, 2008, 08:20:51 PM »
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

Offline Parents of Autistic Kids

  • Newbie
  • *
  • Posts: 5
Re: Amazon DVD
« Reply #4 on: December 23, 2008, 01:39:47 AM »
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.

Offline hchute

  • Jr. Member
  • **
  • Posts: 111
Re: Amazon DVD
« Reply #5 on: December 23, 2008, 01:57:57 AM »
^ 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!
« Last Edit: December 23, 2008, 02:12:23 AM by hchute »
KBoards - (2.5M posts) | SMF mods for Amazon affiliates: - Amazon Search - Amazon DVD  - Amazon MP3

Offline Parents of Autistic Kids

  • Newbie
  • *
  • Posts: 5
Re: Amazon DVD
« Reply #6 on: December 23, 2008, 08:19:18 AM »
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
« Last Edit: December 23, 2008, 08:26:59 AM by Parents of Autistic Kids »

Offline hchute

  • Jr. Member
  • **
  • Posts: 111
Re: Amazon DVD
« Reply #7 on: December 23, 2008, 04:37:32 PM »
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

Offline hchute

  • Jr. Member
  • **
  • Posts: 111
Re: Amazon DVD
« Reply #8 on: December 23, 2008, 04:47:11 PM »
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

Offline hchute

  • Jr. Member
  • **
  • Posts: 111
Re: Amazon DVD
« Reply #9 on: December 23, 2008, 05:34:51 PM »
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:

Code: [Select]
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:

Code: [Select]
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!
« Last Edit: December 23, 2008, 05:37:37 PM by hchute »
KBoards - (2.5M posts) | SMF mods for Amazon affiliates: - Amazon Search - Amazon DVD  - Amazon MP3

Offline Parents of Autistic Kids

  • Newbie
  • *
  • Posts: 5
Re: Amazon DVD
« Reply #10 on: December 23, 2008, 05:59:24 PM »
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.

Offline hchute

  • Jr. Member
  • **
  • Posts: 111
Re: Amazon DVD
« Reply #11 on: December 23, 2008, 06:09:13 PM »
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

Offline Parents of Autistic Kids

  • Newbie
  • *
  • Posts: 5
Re: Amazon DVD
« Reply #12 on: December 23, 2008, 06:40:39 PM »
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

Offline Parents of Autistic Kids

  • Newbie
  • *
  • Posts: 5
Re: Amazon DVD
« Reply #13 on: December 23, 2008, 07:30:43 PM »
One last thing. I can't tell if I put my affiliate ID in right my code looks like this
Code: [Select]
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
« Last Edit: December 23, 2008, 07:37:56 PM by Parents of Autistic Kids »

Offline hchute

  • Jr. Member
  • **
  • Posts: 111
Re: Amazon DVD
« Reply #14 on: December 23, 2008, 07:51:38 PM »
^ 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

Offline hchute

  • Jr. Member
  • **
  • Posts: 111
Re: Amazon DVD
« Reply #15 on: February 09, 2009, 12:06:13 AM »
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

Offline Broc Lee

  • Semi-Newbie
  • *
  • Posts: 16
Re: Amazon DVD
« Reply #16 on: March 08, 2009, 09:54:41 PM »
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

Offline hchute

  • Jr. Member
  • **
  • Posts: 111
Re: Amazon DVD
« Reply #17 on: December 27, 2009, 01:38:36 AM »
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

Offline - danny

  • Jr. Member
  • **
  • Posts: 287
  • Gender: Male
    • The ThirdEye Concept
Re: Amazon DVD
« Reply #18 on: March 21, 2010, 06:30:22 PM »
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...

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

the same applies to the amazonmp3 mod...

Code: [Select]
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...

Offline - danny

  • Jr. Member
  • **
  • Posts: 287
  • Gender: Male
    • The ThirdEye Concept
Re: Amazon DVD
« Reply #19 on: March 25, 2010, 09:43:34 PM »
Can anyone help with this?