Introduce magic word {{NUMBEROFEDITS}}
authorIvan Lanin <ivanlanin@users.mediawiki.org>
Tue, 17 Apr 2007 09:23:31 +0000 (09:23 +0000)
committerIvan Lanin <ivanlanin@users.mediawiki.org>
Tue, 17 Apr 2007 09:23:31 +0000 (09:23 +0000)
RELEASE-NOTES
includes/CoreParserFunctions.php
includes/MagicWord.php
includes/Parser.php
languages/messages/MessagesEn.php

index 3c3d3d1..beefb39 100644 (file)
@@ -116,6 +116,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * 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 ==
 
index 0c4d0a0..bb8a735 100644 (file)
@@ -135,6 +135,7 @@ class CoreParserFunctions {
        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 c23c3cb..bf72a0c 100644 (file)
@@ -53,6 +53,7 @@ class MagicWord {
                'localhour',
                'numberofarticles',
                'numberoffiles',
+               'numberofedits',
                'sitename',
                'server',
                'servername',
index 504780f..efaf303 100644 (file)
@@ -162,6 +162,7 @@ class Parser
                $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 @@ class Parser
                                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 6a39d59..345bbb9 100644 (file)
@@ -251,6 +251,7 @@ $magicWords = array(
        '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'              ),