Hack mediawiki isbn for affiliates

From OpenTutorial
Jump to navigation Jump to search

How to change the ISBN feature to reflect your affiliation with Amazon and Barnes and Noble

!!Caution!!

This is a hack to modify your MediaWiki - Do so at your own risk.

MediaWiki version 1.6.3

This is for MediaWiki version 1.6.3 I'm sure other versions would be similar.


Code

Starting at Line Number 166 In the File "/languages/language.php"

I changed it from:

/* private */ $wgBookstoreListEn = array(
   'AddALL' => 'http://www.addall.com/New/Partner.cgi?query=$1&type=ISBN',
   'PriceSCAN' => 'http://www.pricescan.com/books/bookDetail.asp?isbn=$1',
   'Barnes & Noble' => 'http://search.barnesandnoble.com/bookSearch/isbnInquiry.asp?isbn=$1',
   'Amazon.com' => 'http://www.amazon.com/exec/obidos/ISBN=$1'
);

To:

/* private */ $wgBookstoreListEn = array(
   // 'AddALL' => 'http://www.addall.com/New/Partner.cgi?query=$1&type=ISBN',
   // 'PriceSCAN' => 'http://www.pricescan.com/books/bookDetail.asp?isbn=$1',
   'Barnes & Noble' => 'http://service.bfast.com/bfast/click?bfmid=2181&sourceid=41614264&bfpid=$1&bfmtype=book',
   'Amazon.com' => 'http://www.amazon.com/exec/obidos/redirect?link_code=ur2&tag=tsickist-20&camp=1789&creative=9325&path=ISBN=$1'
);

I commented out AddALL and PriceSCAN because I don't have an affiliation with them. This is purely optional.

Note be sure to replace:

sourceid="41614264" with your Barnes and Noble number tag=tsickist-20 with your Amazon Code

Or you can leave mine and help me make $ :)

Bibliography

(ISBN 020171499X) "The Wiki Way: Collaboration and Sharing on the Web" by Bo Leuf, Ward Cunningham