Manual:ISBN

From MediaWiki.org
Jump to: navigation, search

MediaWiki 1.20.5 (and older?)[edit | edit source]

To customise the page results at Special:Book_Sources, for an ISBN number. Edit the page Project:Book sources (or equivalent, defined by MediaWiki:Booksources). In the source use MAGICNUMBER wherever the ISBN number is to be included. See Wikipedia:Book sources, for an example.

Mediawiki 1.16.0 and newer (and maybe some older versions, too)[edit | edit source]

Mediawiki recognizes inline ISBNs; for example: the wikitext ISBN 0-12-345678-9 becomes ISBN 0-12-345678-9 (the dashes are optional), which corresponds to Special:Booksources/0123456789. This is a link to a special booksource page, generated on-the-fly by the script includes/specials/SpecialBook/SpecialBooksources.php. You can influence the appearance of that generated page by putting your custom text into the pages

  • MediaWiki:Booksources
  • MediaWiki:Booksources-text
  • MediaWiki:Booksources-search-legend‎
  • MediaWiki:Booksources-go‎

Sadly, however, this only changes the text on the page, but not the list of shops. That shop list currently comes hard-coded from the file languages/messages/MessagesXXX.php, where XXX is the current language of your Wiki. For example, the default Mediawiki installation in MessagesEn.php assigns:

  $bookstoreList = 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'
  );

, and there sadly is no possibility to override this in LocalSettings.php. It would already be better if the above assignment would be done only if LocalSettings.php has not already assigned a value. The only 2 ways to currently change that list are:

  1. You patch that file directly with your custom shop list.
  2. You patch that file a little to only assign that value when LocalSettings.php has not done so already.

Both changes sadly will be overwritten with your next MediaWiki software upgrade. For Germany, this could for example be changed to

  bookstoreList = array(
       'amazon.de'  => 'http://www.amazon.de/s/ref=nb_sb_noss?field-keywords=$1',
       'amazon.com' => 'http://www.amazon.com/s/ref=nb_sb_noss?field-keywords=$1',
       'thalia.de'  => 'http://www.thalia.de/shop/tha_homestartseite/suche/?sswg=ANY&sq=$1'
  );

etc.

Further reading[edit | edit source]

See also: Markup spec/BNF/Magic links#ISBN numbers