Extension:Amazon

This (simple) extension could be used for your booksources response page to offer the requested books via amazon.

The extension will output the given Amazon Affiliate Code.

Create a new file in your extensions folder, named "Amazon.php" with the following content:

setHook( "amazon", "renderAmazon" ); }

function renderAmazon( $input ) { # Your Amazon Partner ID   # <<<<< EDIT HERE <<<<< $partner = "EDIT HERE";
 * 1) The callback function for converting the input text to HTML output

# Building the code $output = " ";

return $output; } ?>

Give your Amazon Affiliate Partner ID to the variable $partner ("EDIT HERE").

If you want to use other code than this, replace it, but remember to replace your partner id in the amazon code with the variable $partner and most important replace the ISBN (ASIN) with the variable $input.

Open your LocalSettings.php, and insert at the end of file: include("extensions/Amazon.php");

You can then create a page Project:Booksources (The Booksources must be replaces with the translated word of your site language; "Buchhandlungen" for example in german MediaWikis) with the following content:

MAGICNUMBER

Afterwards the call to Special:Booksources/ISBNNUMBER will end up to the above mentioned page with same layout as the original but displaying your amazon affilate code.