Link to Mod (http://custom.simplemachines.org/mods/index.php?mod=1553)
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:
(http://i363.photobucket.com/albums/oo71/hchute/smf%20mods/amazondvd-button-01.jpg)
Posting page (close-up):
(http://i363.photobucket.com/albums/oo71/hchute/smf%20mods/amazon-buttons-01.jpg)
Posting page:
(http://i363.photobucket.com/albums/oo71/hchute/smf%20mods/amazondvd-screenshot-01.jpg)
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
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 (http://custom.simplemachines.org/mods/index.php?mod=1540). Converts selected text to an affiliate link that searches Amazon's site for that text string.
- Amazon DVD (http://custom.simplemachines.org/mods/index.php?mod=1553). 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 (http://custom.simplemachines.org/mods/index.php?mod=1541). 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.
I can't find "affiliate id" in Sources/Subs.php so I can't enter my amazon id.
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?
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 www.forum.parentsofautistickids.com Thanks for your help and you hard work on this mod.
^ 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!
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
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.
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
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!
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.
Hmm, that is so odd. Subs.php looks okay to me other than that missing "),".
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
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
^ 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
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.
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
Updated for compatibility with SMF 1.* up through 1.1.11, and SMF 2.0 RC1 and RC2.
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...
Can anyone help with this?
I don't mean to keep bumping the thread, but I'd like to solve the error and haven't gotten any response since I first posted the issue on the 21st. I really don't want to waste anyone's time, but is the mod still upported?
~aLEX - sorry I missed your earlier posts. It looks like the mod did not install completely. Please let me know what version of SMF you're using, and you may want to print out the "manual instructions" for the mod and check that the source code files were updated as expected upon installation of the mods. Let me know based on that and we can further diagnose it.
The mod page has been updated to indicate that the mod is compatible with current 1.1.* and 2.* releases of SMF. Existing users of the mod should not have to change anything.
Is it compatible with SMF 2.0 Final?
Quote from: Kajol on July 11, 2011, 07:59:29 AM
Is it compatible with SMF 2.0 Final?
I haven't done a test install yet, but after viewing code changes between 2.0 Final and the last RC release, I am pretty certain it is compatible with SMF 2.0 Final.
Don't think this works anymore. I wasn't getting any click-throughs from the Amazon converted movie title links. When I looked at the URL after clicking it seems everything after the & (the affiliate ID and such) wasn't included.
Moved to the BBC category of mods.