show(); } class BookSourceList { var $mIsbn; function BookSourceList( $isbn ) { $this->mIsbn = $isbn; } function show() { global $wgOut, $wgUser, $wgLang; global $ip, $wpBlockAddress, $wpBlockReason; $fname="BookSourceList->show()"; $wgOut->setPagetitle( wfMsg( "booksources" ) ); $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. if(!$noautolist) { # only do this if we haven't already shown [[Wikipedia:Book sources]] $s = "\n"; $wgOut->addHTML( $s ); } } } ?>