Geeklog Amazon Plugin [v1.3.0]
by Andy Maloney [asmaloney@users.sf.net]
01 Aug 2005
Table of Contents
Description
Short description
If you are an Amazon associate, this plugin will make you more money.
Longer description
This plugin provides an Amazon Search block which will search any of the amazon servers
and produce search results with direct links to products. As an associate, under the current scheme
you get a premium of 2.5% on top of the base 5% when people buy products through these links.
The plugin allows you to set associate IDs for each amazon server and set one of them
as the default for your site.
The plugin provides an XSLT file for the amazon server to access, which processes it together with the XML results of
the search, and then returns HTML. This saves your server from having to process the XML itself.
Developed Using These Tools
- Geeklog 1.3.11
- PHP 5.0.4 w/CURL support [though it should work with PHP >= 4.1.0]
- MySQL 4.1.11
- FireFox 1.0.6
- MacOS X 10.4.2
Limitations
The Amazon plugin currently has the following limitations:
- you cannot choose the sorting order
- you cannot choose the data that is shown in the result [unless you know XSLT]
If I get decent feedback and people are using it, I will continue to improve it.
Version History
- v1.3.0 [01 Aug 2005]
- [fix] Amazon recently made a change which made all searches but the .com site stop working properly
- [new] added amazon.co.jp [thanks to Steven for the prompting]
- Japanese characters will only show up if you are using a UTF-8 language setting for Geeklog
- [new] moved to a newer version of Amazon API [2005-03-23]
v1.2.1 [21 May 2005]
- [fix] fix installation problem on some systems
v1.2.0 [21 Apr 2005]
- [fix] changed install so that it should work with MySQL < 4.0.18
- [fix] should now install on Geeklog 1.3.12 from CVS
- [fix] some cleanup of the generated HTML
- [new] added option to set a cookie so the user's preferred server and last search
is filled in whenever they visit your site [defaults to on]
v1.1.0 [20 Mar 2005]
- [new] added links to associate websites on the admin page
- [new] allow searching on these categories: All, Books, DVDs, Music, and Software
- [new] admin can set the default category to search on [the user may select a different one on the search results page]
- [new] added paging of results
- [new] changed the whole mechanism of installation and upgrading [now more like GL itself]
v1.0.0 [12 Mar 2005]
Installing The Plugin
- Backup your Geeklog database because the amz plugin adds and modifies tables.
You can do this with the built in admin backup facility in the Admin menu.
- Uncompress the amz plugin archive while in the <geeklog_dir>/plugins directory.
The archive will create a directory called amz.
- Under your html directory (usually public_html) create a directory called amz. Under your
admin/plugins/ directory create a directory called amz.
- Change to your <geeklog_dir>/plugins/amz/ directory.
- Copy the files in the admin directory to the admin/plugins/amz/ directory you created in step 3.
- Copy the files and directories in the public_html directory to the public_html/amz/
directory you created in step 3.
- Go to the plugin administration page. The amz plugin
should show up with a link to install it. Click it. The install page will tell you if the install
was successful or not. If not examine the Geeklog system errorlog in <geeklog_dir>/logs to see
what the problem was. Fix it and re-install.
The amz plugin should now be installed.
Configuring The Plugin
In the Admin block you will find a link to the Amazon plugin page where you may configure the following:
Associate IDs
In this section, fill in any associate IDs you have. You may also select one of the servers to be the
default for your users. If you live in France, you might choose the amazon.fr server, for example.
Any IDs left blank will be filled in with mine.
Development Contribution
Ah, here's the hook! I've set it up so that every 'N' searches, the links which are produced use my
associate IDs. You can choose a value for 'N' here. No need to go hacking if you don't want to support
development - just set it to 0 and I won't substitute my associate IDs.
Searching
The Default Category is the one that will be used when the user searches from the block. When they
get the results, they will be able to change the category on the search page. Note that 'Blended' means
search all products - it's an Amazon term.
The Default Search Term is what is used if the user doesn't enter a search term. Right now it defaults
to my brother's books. You will probably want to change it.
You may specify an XSLT file that will be sent to the amazon servers for processing. This file must be publicly
accessible because the amazon server will be reading it to provide formatting.
If you don't know what this means, you better leave it alone. The XSLT file may be edited if you want to
customise the results produced by the search. I am certainly not an XSLT expert, so if you have any suggestions,
please contact me.
You may also set the size of the images that are to be returned in the search or 'None' to turn them off.
Watch out if you set this to 'Large'!
The plugin will optionally set a cookie on the user's machine to save the last server they used and the last
search term. This is then filled in when they next view your site. To turn this off, uncheck 'Use cookies'.
Upgrading The Plugin
- Backup your Geeklog database because the upgrade process modifies tables.
You can do this with the built in admin backup facility in the Admin menu.
- Disable the plugin using the Plugin interface in the admin menu.
- Uncompress the amz plugin archive while in the <geeklog_dir>/plugins directory.
This will overwrite the amz directory.
- Change to your <geeklog_dir>/plugins/amz/ directory. Copy the files in the admin directory to
the admin/plugins/amz/ directory [overwrite the old ones]. Copy the files and directories in the
public_html directory to the public_html/amz/ directory [overwrite the old ones].
- Go to the plugin administration page. Click the link to the amz plugin. Re-enable the plugin.
When the page reloads, it will have a button to upgrade the plugin. Click it.
- Go to the admin page to set any new preferences. That's it!
Removing The Plugin
- Log in to your Geeklog as a root user and go to the plugin administration page. Click the amz
link and then click the 'Delete' button. It will ask you to confirm it. Confirm it.
- Delete the three plugin directories created in the install process:
- <geeklog-dir>plugins/amz/
- <public_html>/amz/
- <admin>/plugins/amz/
- There is no step three.
Things You Can Do
- Check my PHP & XSLT and tell me if there are better ways to do any of this.
[email me]
- Let me know if you use it or have any suggestions.
[email me]
- Link to my page [http://imol.gotdns.com] somewhere on yours.
- Support development by making a donation:
or by using one of the following links to shop at amazon:
or by going to [http://imol.gotdns.com] and clicking on an interesting Google ad or two
[I make several cents for each click!]
License
The Geeklog Amazon Plugin is licensed under the GPL even though I don't really understand it and all its implications.
Why do we let legalese control the world?