MediaWiki/embedding/old/extract.php/v1

About
This version is obsolete. Use only if newer code fails and you are looking for ideas. This was formerly "the slightly less-elegant method", and was used with a MediaWiki version somewhere around 1.7 --Woozle 19:11, 6 June 2009 (EDT) (updated 2011-03-12)

Instructions
Create the file extract.php from the code below, and place it in your MediaWiki root folder (i.e. the folder where the main wiki's index.php is).

The following code displays text from the wiki page whose name (in URL format, with underlines for spaces) is passed to getWikiPage: error_reporting(E_ALL ^ E_NOTICE ^ E_WARNING); require_once('../wiki.sluggysquad.com/extract.php'); echo str_replace("/index.php/","http:// your.wiki's.base.url /",getWikiPage('WWW_Wiki_Intro'));
 * The str_replace will need some tweaking depending on the URL form your wiki uses.
 * This example assumes http://your.wiki.domain/index.php/Page_title

Code
getText( 'title', $pageName ); $wgTitle = Title::newFromText( $useportal ); $wgArticle = new Article( $wgTitle ); $mainText = $wgOut->parse( $wgArticle->getContent( false ) ); return $mainText; }

?>