Extension:SpecialNamespaces/sourcecode

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

The code below is intended for MediaWiki 1.16 and later. See Extension:Simple namespaces for installation instructions. The following five files need to be created in .../extensions/Namespaces/ in your MediaWiki installation:

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 ); } }