Something like this loop should work, if you haven't defined any custom namespaces in your wiki:
global $wgCanonicalNamespaceNames; foreach ($wgCanonicalNamespaceNames as $ns => $name) { // If namespace ID is non-negative and even, protect it. if ($ns >= 0 && $ns % 2 == 0) { $wgNamespaceProtection[$ns] = array( 'sysop' ); } }
DanB
-----Original Message----- Derrick Farnell writes:
That went above my head! Perhaps if I just added a line for each non-talk namespace? That is:
$wgNamespaceProtection[NS_MAIN] = array( 'sysop' ); $wgNamespaceProtection[NS_MEDIAWIKI] = array( 'sysop' ); $wgNamespaceProtection[NS_TEMPLATE] = array( 'sysop' ); $wgNamespaceProtection[NS_WIKI_TITLE] = array( 'sysop' );