for new normalization code when tidy not in use
* Replace "nogomatch" with "noexactmatch" and place the magic colon in the messages
themselves. Some minor tweaks to the actual message content.
-
+* Introduce $wgContentNamespaces which allows for articles to exist in namespaces other
+ than the main namespace, and still be counted as valid content in the site statistics.
== Compatibility ==
* @return bool
*/
function isCountable( $text ) {
- global $wgUseCommaCount;
+ global $wgUseCommaCount, $wgContentNamespaces;
$token = $wgUseCommaCount ? ',' : '[[';
return
- $this->mTitle->getNamespace() == NS_MAIN
+ array_search( $this->mTitle->getNamespace(), $wgContentNamespaces ) !== false
&& ! $this->isRedirect( $text )
&& in_string( $token, $text );
}
*/
$wgAllowTitlesInSVG = false;
+/**
+ * Array of namespaces which can be deemed to contain valid "content", as far
+ * as the site statistics are concerned. Useful if additional namespaces also
+ * contain "content" which should be considered when generating a count of the
+ * number of articles in the wiki.
+ */
+$wgContentNamespaces = array( NS_MAIN );
+
?>
$edits = $dbr->selectField( 'revision', 'COUNT(*)', '', $fname );
echo( "{$edits}\nCounting number of articles..." );
-$good = $dbr->selectField( 'page', 'COUNT(*)', array( 'page_namespace' => 0, 'page_is_redirect' => 0, 'page_len > 0' ), $fname );
+global $wgContentNamespaces;
+$good = $dbr->selectField( 'page', 'COUNT(*)', array( 'page_namespace' => $wgContentNamespaces, 'page_is_redirect' => 0, 'page_len > 0' ), $fname );
echo( "{$good}\nCounting total pages..." );
$pages = $dbr->selectField( 'page', 'COUNT(*)', '', $fname );