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

Limitations

The Amazon plugin currently has the following limitations: If I get decent feedback and people are using it, I will continue to improve it.

Version History

Installing The Plugin

  1. 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.
  2. Uncompress the amz plugin archive while in the <geeklog_dir>/plugins directory. The archive will create a directory called amz.
  3. Under your html directory (usually public_html) create a directory called amz. Under your admin/plugins/ directory create a directory called amz.
  4. Change to your <geeklog_dir>/plugins/amz/ directory.
  5. Copy the files in the admin directory to the admin/plugins/amz/ directory you created in step 3.
  6. Copy the files and directories in the public_html directory to the public_html/amz/ directory you created in step 3.
  7. 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

  1. 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.
  2. Disable the plugin using the Plugin interface in the admin menu.
  3. Uncompress the amz plugin archive while in the <geeklog_dir>/plugins directory. This will overwrite the amz directory.
  4. 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].
  5. 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.
  6. Go to the admin page to set any new preferences. That's it!

Removing The Plugin

  1. 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.
  2. Delete the three plugin directories created in the install process:
  3. There is no step three.

Things You Can Do

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?