Index: trunk/phase3/includes/Parser.php |
— | — | @@ -2148,6 +2148,8 @@ |
2149 | 2149 | return $varCache[$index] = $wgContLang->formatNum( wfNumberOfArticles() ); |
2150 | 2150 | case MAG_NUMBEROFFILES: |
2151 | 2151 | return $varCache[$index] = $wgContLang->formatNum( wfNumberOfFiles() ); |
| 2152 | + case MAG_NUMBEROFUSERS: |
| 2153 | + return $varCache[$index] = $wgContLang->formatNum( wfNumberOfUsers() ); |
2152 | 2154 | case MAG_SITENAME: |
2153 | 2155 | return $wgSitename; |
2154 | 2156 | case MAG_SERVER: |
— | — | @@ -4254,6 +4256,18 @@ |
4255 | 4257 | } |
4256 | 4258 | |
4257 | 4259 | /** |
| 4260 | + * Return the number of user accounts |
| 4261 | + * @return integer |
| 4262 | + */ |
| 4263 | +function wfNumberOfUsers() { |
| 4264 | + wfProfileIn( 'wfNumberOfUsers' ); |
| 4265 | + $dbr =& wfGetDB( DB_SLAVE ); |
| 4266 | + $count = $dbr->selectField( 'site_stats', 'ss_users', array(), 'wfNumberOfUsers' ); |
| 4267 | + wfProfileOut( 'wfNumberOfUsers' ); |
| 4268 | + return (int)$count; |
| 4269 | +} |
| 4270 | + |
| 4271 | +/** |
4258 | 4272 | * Get various statistics from the database |
4259 | 4273 | * @private |
4260 | 4274 | */ |
Index: trunk/phase3/includes/MagicWord.php |
— | — | @@ -81,6 +81,7 @@ |
82 | 82 | 'MAG_TALKPAGENAMEE', |
83 | 83 | 'MAG_SUBJECTPAGENAME', |
84 | 84 | 'MAG_SUBJECTPAGENAMEE', |
| 85 | + 'MAG_NUMBEROFUSERS', |
85 | 86 | ); |
86 | 87 | if ( ! defined( 'MEDIAWIKI_INSTALL' ) ) |
87 | 88 | wfRunHooks( 'MagicWordMagicWords', array( &$magicWords ) ); |
— | — | @@ -124,6 +125,7 @@ |
125 | 126 | MAG_TALKPAGENAMEE, |
126 | 127 | MAG_SUBJECTPAGENAME, |
127 | 128 | MAG_SUBJECTPAGENAMEE, |
| 129 | + MAG_NUMBEROFUSERS, |
128 | 130 | ); |
129 | 131 | if ( ! defined( 'MEDIAWIKI_INSTALL' ) ) |
130 | 132 | wfRunHooks( 'MagicWordwgVariableIDs', array( &$wgVariableIDs ) ); |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -135,6 +135,7 @@ |
136 | 136 | * Remove unneeded extra whitespace at top of Special:Categories |
137 | 137 | * (bug 5679): format number on timeanddate() calls for fa: hi: bn:. |
138 | 138 | * (bug 5751) Updates to Portuguese localisation files |
| 139 | +* (bug 5741) Introduce {{NUMBEROFUSERS}} magic word |
139 | 140 | |
140 | 141 | == Compatibility == |
141 | 142 | |
Index: trunk/phase3/languages/Language.php |
— | — | @@ -228,6 +228,7 @@ |
229 | 229 | MAG_CURRENTTIME => array( 1, 'CURRENTTIME' ), |
230 | 230 | MAG_NUMBEROFARTICLES => array( 1, 'NUMBEROFARTICLES' ), |
231 | 231 | MAG_NUMBEROFFILES => array( 1, 'NUMBEROFFILES' ), |
| 232 | + MAG_NUMBEROFUSERS => array( 1, 'NUMBEROFUSERS' ), |
232 | 233 | MAG_PAGENAME => array( 1, 'PAGENAME' ), |
233 | 234 | MAG_PAGENAMEE => array( 1, 'PAGENAMEE' ), |
234 | 235 | MAG_NAMESPACE => array( 1, 'NAMESPACE' ), |