Extension:SpecialNamespaces/sourcecode

For installations based on previous MediaWiki versions, use Extension:SpecialNamespaces/sourcecode (ver 0.1).

The code below is intended for MediaWiki 1.16 to 1.17. See Extension:SpecialNamespaces for installation instructions. The following five files need to be created in .../extensions/Namespaces/ in your MediaWiki installation. In MediaWiki 1.18 - 1.19 all instances of 'Xml::Hidden' must be replaced with 'Html::Hidden'.

SpecialNamespaces_body.php
';		$wgOut->addWikiMsg( 'namespaces_intro' ); $wgOut->addHTML( $out ); $wgOut->addWikiMsg( 'namespaces_intro_footer' ); $selfTitle = $this->getTitle;

if ( $admin ) { $skin = $wgUser->getSkin; $addtext = wfMsgHtml( 'namespaces_addtext' ); $addlink = $skin->link( $selfTitle, $addtext, array, array( 'action' => 'add' ) ); $wgOut->addHTML( ' ' . $addlink . ' ' ); }

$dbr = wfGetDB( DB_SLAVE ); $res = $dbr->select(			'namespace_names',			'*',			1,			__METHOD__,			array( 'ORDER BY' => 'ns_id' )		); $numrows = $res->numRows; if ( $numrows == 0 ) { $this->error( 'namespaces_error' ); return; }

$out = " ';		$wgOut->addHTML( $out );	}

function error { global $wgOut; $args = func_get_args; $wgOut->wrapWikiMsg( "$1 ", $args ); } }