| Index: trunk/phase3/maintenance/initStats.php |
| — | — | @@ -25,7 +25,8 @@ |
| 26 | 26 | $edits = $dbr->selectField( 'revision', 'COUNT(*)', '', $fname ); |
| 27 | 27 | echo( "{$edits}\nCounting number of articles..." ); |
| 28 | 28 | |
| 29 | | -$good = $dbr->selectField( 'page', 'COUNT(*)', array( 'page_namespace' => 0, 'page_is_redirect' => 0, 'page_len > 0' ), $fname ); |
| | 29 | +global $wgContentNamespaces; |
| | 30 | +$good = $dbr->selectField( 'page', 'COUNT(*)', array( 'page_namespace' => $wgContentNamespaces, 'page_is_redirect' => 0, 'page_len > 0' ), $fname ); |
| 30 | 31 | echo( "{$good}\nCounting total pages..." ); |
| 31 | 32 | |
| 32 | 33 | $pages = $dbr->selectField( 'page', 'COUNT(*)', '', $fname ); |
| Index: trunk/phase3/includes/Article.php |
| — | — | @@ -538,11 +538,11 @@ |
| 539 | 539 | * @return bool |
| 540 | 540 | */ |
| 541 | 541 | function isCountable( $text ) { |
| 542 | | - global $wgUseCommaCount; |
| | 542 | + global $wgUseCommaCount, $wgContentNamespaces; |
| 543 | 543 | |
| 544 | 544 | $token = $wgUseCommaCount ? ',' : '[['; |
| 545 | 545 | return |
| 546 | | - $this->mTitle->getNamespace() == NS_MAIN |
| | 546 | + array_search( $this->mTitle->getNamespace(), $wgContentNamespaces ) !== false |
| 547 | 547 | && ! $this->isRedirect( $text ) |
| 548 | 548 | && in_string( $token, $text ); |
| 549 | 549 | } |
| Index: trunk/phase3/includes/DefaultSettings.php |
| — | — | @@ -2067,4 +2067,12 @@ |
| 2068 | 2068 | */ |
| 2069 | 2069 | $wgAllowTitlesInSVG = false; |
| 2070 | 2070 | |
| | 2071 | +/** |
| | 2072 | + * Array of namespaces which can be deemed to contain valid "content", as far |
| | 2073 | + * as the site statistics are concerned. Useful if additional namespaces also |
| | 2074 | + * contain "content" which should be considered when generating a count of the |
| | 2075 | + * number of articles in the wiki. |
| | 2076 | + */ |
| | 2077 | +$wgContentNamespaces = array( NS_MAIN ); |
| | 2078 | + |
| 2071 | 2079 | ?> |
| Index: trunk/phase3/RELEASE-NOTES |
| — | — | @@ -476,8 +476,9 @@ |
| 477 | 477 | for new normalization code when tidy not in use |
| 478 | 478 | * Replace "nogomatch" with "noexactmatch" and place the magic colon in the messages |
| 479 | 479 | themselves. Some minor tweaks to the actual message content. |
| | 480 | +* Introduce $wgContentNamespaces which allows for articles to exist in namespaces other |
| | 481 | + than the main namespace, and still be counted as valid content in the site statistics. |
| 480 | 482 | |
| 481 | | - |
| 482 | 483 | == Compatibility == |
| 483 | 484 | |
| 484 | 485 | MediaWiki 1.7 requires PHP 5 (5.1 recommended). PHP 4 is no longer supported. |