From: Erik Moeller Date: Mon, 19 May 2003 21:01:09 +0000 (+0000) Subject: Support for [[Wikipedia:Book sources]] (or localized text), content of X-Git-Tag: 1.1.0~547 X-Git-Url: http://git.cyclocoop.org/%7B%24admin_url%7Dmembres/modifier.php?a=commitdiff_plain;h=b9d208a4f2e5b821954321efd01451b27b291d10;p=lhc%2Fweb%2Fwiklou.git Support for [[Wikipedia:Book sources]] (or localized text), content of this page, with WIKI-ISBN replaced by ISBN number, is used instead of the text in LanguageFoo.php for queries that include an ISBN. --- diff --git a/includes/SpecialBooksources.php b/includes/SpecialBooksources.php index a3722cd8db..c16b7eb8d6 100644 --- a/includes/SpecialBooksources.php +++ b/includes/SpecialBooksources.php @@ -24,34 +24,55 @@ class BookSourceList { { global $wgOut, $wgUser, $wgLang; global $ip, $wpBlockAddress, $wpBlockReason; + $fname="BookSourceList->show()"; $wgOut->setPagetitle( wfMsg( "booksources" ) ); - $wgOut->addWikiText( wfMsg( "booksourcetext" ) ); + $bstext=wfMsg( "booksourcetext" ); + if($this->mIsbn) + { + $bstitle=Title::newFromText(wfmsg("booksources")); + $sql="SELECT cur_text FROM cur WHERE cur_namespace=4 and cur_title='" . $bstitle->getPrefixedDBkey()."'"; + $res=wfQuery($sql,$fname); + if( ($s=wfFetchObject($res)) and ($s->cur_text!="")) { + + $bstext=$s->cur_text; + $bstext=str_replace("WIKI-ISBN",$this->mIsbn,$bstext); + $noautolist=1; + } + + } + + + $wgOut->addWikiText( $bstext ); + + # If ISBN is blank, just show a list of links to the # home page of the various book sites. Otherwise, show # a list of links directly to the book. - $s = "\n"; + if(!$noautolist) { # only do this if we haven't already shown [[Wikipedia:Book sources]] + $s = "\n"; - $wgOut->addHTML( $s ); - } + $wgOut->addHTML( $s ); + } + } } ?>