r21319 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r21318‎ | r21319 | r21320 >
Date:09:23, 17 April 2007
Author:ivanlanin
Status:old
Tags:
Comment:
Introduce magic word {{NUMBEROFEDITS}}
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/CoreParserFunctions.php (modified) (history)
  • /trunk/phase3/includes/MagicWord.php (modified) (history)
  • /trunk/phase3/includes/Parser.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesEn.php (modified) (history)

Diff [purge]

Index: trunk/phase3/languages/messages/MessagesEn.php
@@ -251,6 +251,7 @@
252252 'numberofarticles' => array( 1, 'NUMBEROFARTICLES' ),
253253 'numberoffiles' => array( 1, 'NUMBEROFFILES' ),
254254 'numberofusers' => array( 1, 'NUMBEROFUSERS' ),
 255+ 'numberofedits' => array( 1, 'NUMBEROFEDITS' ),
255256 'pagename' => array( 1, 'PAGENAME' ),
256257 'pagenamee' => array( 1, 'PAGENAMEE' ),
257258 'namespace' => array( 1, 'NAMESPACE' ),
Index: trunk/phase3/RELEASE-NOTES
@@ -116,6 +116,7 @@
117117 * Introduce 'FileUpload' hook; see docs/hooks.txt for more information
118118 * Introduce 'SearchUpdate' hook; see docs/hooks.txt for more information
119119 * Introduce 'mywatchlist' message; used on personal menu to link to watchlist page
 120+* Introduce magic word {{NUMBEROFEDITS}}
120121
121122 == Bugfixes since 1.9 ==
122123
Index: trunk/phase3/includes/CoreParserFunctions.php
@@ -135,6 +135,7 @@
136136 static function numberofarticles( $parser, $raw = null ) { return self::statisticsFunction( 'articles', $raw ); }
137137 static function numberoffiles( $parser, $raw = null ) { return self::statisticsFunction( 'images', $raw ); }
138138 static function numberofadmins( $parser, $raw = null ) { return self::statisticsFunction( 'admins', $raw ); }
 139+ static function numberofedits( $parser, $raw = null ) { return self::statisticsFunction( 'edits', $raw ); }
139140
140141 static function pagesinnamespace( $parser, $namespace = 0, $raw = null ) {
141142 $count = SiteStats::pagesInNs( intval( $namespace ) );
Index: trunk/phase3/includes/MagicWord.php
@@ -53,6 +53,7 @@
5454 'localhour',
5555 'numberofarticles',
5656 'numberoffiles',
 57+ 'numberofedits',
5758 'sitename',
5859 'server',
5960 'servername',
Index: trunk/phase3/includes/Parser.php
@@ -162,6 +162,7 @@
163163 $this->setFunctionHook( 'numberofarticles', array( 'CoreParserFunctions', 'numberofarticles' ), SFH_NO_HASH );
164164 $this->setFunctionHook( 'numberoffiles', array( 'CoreParserFunctions', 'numberoffiles' ), SFH_NO_HASH );
165165 $this->setFunctionHook( 'numberofadmins', array( 'CoreParserFunctions', 'numberofadmins' ), SFH_NO_HASH );
 166+ $this->setFunctionHook( 'numberofedits', array( 'CoreParserFunctions', 'numberofedits' ), SFH_NO_HASH );
166167 $this->setFunctionHook( 'language', array( 'CoreParserFunctions', 'language' ), SFH_NO_HASH );
167168 $this->setFunctionHook( 'padleft', array( 'CoreParserFunctions', 'padleft' ), SFH_NO_HASH );
168169 $this->setFunctionHook( 'padright', array( 'CoreParserFunctions', 'padright' ), SFH_NO_HASH );
@@ -2540,6 +2541,8 @@
25412542 return $varCache[$index] = $wgContLang->formatNum( SiteStats::pages() );
25422543 case 'numberofadmins':
25432544 return $varCache[$index] = $wgContLang->formatNum( SiteStats::admins() );
 2545+ case 'numberofedits':
 2546+ return $varCache[$index] = $wgContLang->formatNum( SiteStats::edits() );
25442547 case 'currenttimestamp':
25452548 return $varCache[$index] = wfTimestampNow();
25462549 case 'localtimestamp':