r21319 - Code Review

From MediaWiki.org

Jump to: navigation, search
Repository:MediaWiki
Revision:r21318 | r21319 (on ViewVC) | r21320 >
Date:09:23, 17 April 2007
Author:ivanlanin
Status:new
Tags:
Comment:Introduce magic word {{NUMBEROFEDITS}}
Modified paths:

Diff [purge]

Index: trunk/phase3/includes/Parser.php
===================================================================
--- trunk/phase3/includes/Parser.php	(revision 21318)
+++ trunk/phase3/includes/Parser.php	(revision 21319)
@@ -162,6 +162,7 @@
 		$this->setFunctionHook( 'numberofarticles', array( 'CoreParserFunctions', 'numberofarticles' ), SFH_NO_HASH );
 		$this->setFunctionHook( 'numberoffiles', array( 'CoreParserFunctions', 'numberoffiles' ), SFH_NO_HASH );
 		$this->setFunctionHook( 'numberofadmins', array( 'CoreParserFunctions', 'numberofadmins' ), SFH_NO_HASH );
+		$this->setFunctionHook( 'numberofedits', array( 'CoreParserFunctions', 'numberofedits' ), SFH_NO_HASH );
 		$this->setFunctionHook( 'language', array( 'CoreParserFunctions', 'language' ), SFH_NO_HASH );
 		$this->setFunctionHook( 'padleft', array( 'CoreParserFunctions', 'padleft' ), SFH_NO_HASH );
 		$this->setFunctionHook( 'padright', array( 'CoreParserFunctions', 'padright' ), SFH_NO_HASH );
@@ -2540,6 +2541,8 @@
 				return $varCache[$index] = $wgContLang->formatNum( SiteStats::pages() );
 			case 'numberofadmins':
 				return $varCache[$index]  = $wgContLang->formatNum( SiteStats::admins() );
+			case 'numberofedits':
+				return $varCache[$index]  = $wgContLang->formatNum( SiteStats::edits() );
 			case 'currenttimestamp':
 				return $varCache[$index] = wfTimestampNow();
 			case 'localtimestamp':
Index: trunk/phase3/includes/MagicWord.php
===================================================================
--- trunk/phase3/includes/MagicWord.php	(revision 21318)
+++ trunk/phase3/includes/MagicWord.php	(revision 21319)
@@ -53,6 +53,7 @@
 		'localhour',
 		'numberofarticles',
 		'numberoffiles',
+		'numberofedits',
 		'sitename',
 		'server',
 		'servername',
Index: trunk/phase3/includes/CoreParserFunctions.php
===================================================================
--- trunk/phase3/includes/CoreParserFunctions.php	(revision 21318)
+++ trunk/phase3/includes/CoreParserFunctions.php	(revision 21319)
@@ -135,6 +135,7 @@
 	static function numberofarticles( $parser, $raw = null ) { return self::statisticsFunction( 'articles', $raw ); }
 	static function numberoffiles( $parser, $raw = null ) { return self::statisticsFunction( 'images', $raw ); }
 	static function numberofadmins( $parser, $raw = null ) { return self::statisticsFunction( 'admins', $raw ); }
+	static function numberofedits( $parser, $raw = null ) { return self::statisticsFunction( 'edits', $raw ); }
 
 	static function pagesinnamespace( $parser, $namespace = 0, $raw = null ) {
 		$count = SiteStats::pagesInNs( intval( $namespace ) );
Index: trunk/phase3/languages/messages/MessagesEn.php
===================================================================
--- trunk/phase3/languages/messages/MessagesEn.php	(revision 21318)
+++ trunk/phase3/languages/messages/MessagesEn.php	(revision 21319)
@@ -251,6 +251,7 @@
 	'numberofarticles'       => array( 1,    'NUMBEROFARTICLES'       ),
 	'numberoffiles'          => array( 1,    'NUMBEROFFILES'          ),
 	'numberofusers'          => array( 1,    'NUMBEROFUSERS'          ),
+	'numberofedits'          => array( 1,    'NUMBEROFEDITS'          ),
 	'pagename'               => array( 1,    'PAGENAME'               ),
 	'pagenamee'              => array( 1,    'PAGENAMEE'              ),
 	'namespace'              => array( 1,    'NAMESPACE'              ),
Index: trunk/phase3/RELEASE-NOTES
===================================================================
--- trunk/phase3/RELEASE-NOTES	(revision 21318)
+++ trunk/phase3/RELEASE-NOTES	(revision 21319)
@@ -116,6 +116,7 @@
 * Introduce 'FileUpload' hook; see docs/hooks.txt for more information
 * Introduce 'SearchUpdate' hook; see docs/hooks.txt for more information
 * Introduce 'mywatchlist' message; used on personal menu to link to watchlist page
+* Introduce magic word {{NUMBEROFEDITS}}
 
 == Bugfixes since 1.9 ==
 
Views
Toolbox