Index: trunk/phase3/includes/Parser.php |
— | — | @@ -2150,6 +2150,11 @@ |
2151 | 2151 | return $varCache[$index] = $wgContLang->formatNum( wfNumberOfFiles() ); |
2152 | 2152 | case MAG_NUMBEROFUSERS: |
2153 | 2153 | return $varCache[$index] = $wgContLang->formatNum( wfNumberOfUsers() ); |
| 2154 | + case MAG_NUMBEROFPAGES: |
| 2155 | + return $varCache[$index] = $wgContLang->formatNum( wfNumberOfPages() ); |
| 2156 | + case MAG_CURRENTVERSION: |
| 2157 | + global $wgVersion; |
| 2158 | + return $wgVersion; |
2154 | 2159 | case MAG_SITENAME: |
2155 | 2160 | return $wgSitename; |
2156 | 2161 | case MAG_SERVER: |
— | — | @@ -2664,9 +2669,12 @@ |
2665 | 2670 | } |
2666 | 2671 | } |
2667 | 2672 | |
2668 | | - # NUMBEROFUSERS, NUMBEROFARTICLES, and NUMBEROFFILES |
| 2673 | + # NUMBEROFPAGES, NUMBEROFUSERS, NUMBEROFARTICLES, and NUMBEROFFILES |
2669 | 2674 | if( !$found ) { |
2670 | | - $mwWordsToCheck = array( MAG_NUMBEROFUSERS => 'wfNumberOfUsers', MAG_NUMBEROFARTICLES => 'wfNumberOfArticles', MAG_NUMBEROFFILES => 'wfNumberOfFiles' ); |
| 2675 | + $mwWordsToCheck = array( MAG_NUMBEROFPAGES => 'wfNumberOfPages', |
| 2676 | + MAG_NUMBEROFUSERS => 'wfNumberOfUsers', |
| 2677 | + MAG_NUMBEROFARTICLES => 'wfNumberOfArticles', |
| 2678 | + MAG_NUMBEROFFILES => 'wfNumberOfFiles' ); |
2671 | 2679 | foreach( $mwWordsToCheck as $word => $func ) { |
2672 | 2680 | $mwCurrentWord =& MagicWord::get( $word ); |
2673 | 2681 | if( $mwCurrentWord->matchStartAndRemove( $part1 ) ) { |
— | — | @@ -4318,6 +4326,18 @@ |
4319 | 4327 | } |
4320 | 4328 | |
4321 | 4329 | /** |
| 4330 | + * Return the total number of pages |
| 4331 | + * @return integer |
| 4332 | + */ |
| 4333 | +function wfNumberOfPages() { |
| 4334 | + wfProfileIn( 'wfNumberOfPages' ); |
| 4335 | + $dbr =& wfGetDB( DB_SLAVE ); |
| 4336 | + $count = $dbr->selectField( 'site_stats', 'ss_total_pages', array(), 'wfNumberOfPages' ); |
| 4337 | + wfProfileOut( 'wfNumberOfPages' ); |
| 4338 | + return (int)$count; |
| 4339 | +} |
| 4340 | + |
| 4341 | +/** |
4322 | 4342 | * Get various statistics from the database |
4323 | 4343 | * @private |
4324 | 4344 | */ |
Index: trunk/phase3/includes/MagicWord.php |
— | — | @@ -84,6 +84,8 @@ |
85 | 85 | 'MAG_NUMBEROFUSERS', |
86 | 86 | 'MAG_RAWSUFFIX', |
87 | 87 | 'MAG_NEWSECTIONLINK', |
| 88 | + 'MAG_NUMBEROFPAGES', |
| 89 | + 'MAG_CURRENTVERSION', |
88 | 90 | ); |
89 | 91 | if ( ! defined( 'MEDIAWIKI_INSTALL' ) ) |
90 | 92 | wfRunHooks( 'MagicWordMagicWords', array( &$magicWords ) ); |
— | — | @@ -130,6 +132,8 @@ |
131 | 133 | MAG_NUMBEROFUSERS, |
132 | 134 | MAG_RAWSUFFIX, |
133 | 135 | MAG_NEWSECTIONLINK, |
| 136 | + MAG_NUMBEROFPAGES, |
| 137 | + MAG_CURRENTVERSION, |
134 | 138 | ); |
135 | 139 | if ( ! defined( 'MEDIAWIKI_INSTALL' ) ) |
136 | 140 | wfRunHooks( 'MagicWordwgVariableIDs', array( &$wgVariableIDs ) ); |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -253,6 +253,8 @@ |
254 | 254 | * (bug 5806) {{plural:}} support instead of "twin" MediaWiki messages |
255 | 255 | * (bug 5931) Update for Polish language (pl) |
256 | 256 | * Ignore the user and user talk namespaces on Special:Wantedpages |
| 257 | +* Introduce NUMBEROFPAGES magic word |
| 258 | +* (bug 5833) Introduce CURRENTVERSION magic word |
257 | 259 | |
258 | 260 | == Compatibility == |
259 | 261 | |
Index: trunk/phase3/languages/Language.php |
— | — | @@ -226,6 +226,7 @@ |
227 | 227 | MAG_CURRENTDAYNAME => array( 1, 'CURRENTDAYNAME' ), |
228 | 228 | MAG_CURRENTYEAR => array( 1, 'CURRENTYEAR' ), |
229 | 229 | MAG_CURRENTTIME => array( 1, 'CURRENTTIME' ), |
| 230 | + MAG_NUMBEROFPAGES => array( 1, 'NUMBEROFPAGES' ), |
230 | 231 | MAG_NUMBEROFARTICLES => array( 1, 'NUMBEROFARTICLES' ), |
231 | 232 | MAG_NUMBEROFFILES => array( 1, 'NUMBEROFFILES' ), |
232 | 233 | MAG_NUMBEROFUSERS => array( 1, 'NUMBEROFUSERS' ), |
— | — | @@ -282,6 +283,7 @@ |
283 | 284 | MAG_DISPLAYTITLE => array( 1, 'DISPLAYTITLE' ), |
284 | 285 | MAG_RAWSUFFIX => array( 1, 'R' ), |
285 | 286 | MAG_NEWSECTIONLINK => array( 1, '__NEWSECTIONLINK__' ), |
| 287 | + MAG_CURRENTVERSION => array( 1, 'CURRENTVERSION' ), |
286 | 288 | ); |
287 | 289 | |
288 | 290 | if (!$wgCachedMessageArrays) { |