From 73bb06d1a099b160e6bc68f0c0b5690e16134377 Mon Sep 17 00:00:00 2001 From: Ivan Lanin Date: Tue, 17 Apr 2007 09:23:31 +0000 Subject: [PATCH] Introduce magic word {{NUMBEROFEDITS}} --- RELEASE-NOTES | 1 + includes/CoreParserFunctions.php | 1 + includes/MagicWord.php | 1 + includes/Parser.php | 3 +++ languages/messages/MessagesEn.php | 1 + 5 files changed, 7 insertions(+) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 3c3d3d1546..beefb398af 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -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 == diff --git a/includes/CoreParserFunctions.php b/includes/CoreParserFunctions.php index 0c4d0a0c81..bb8a735f4b 100644 --- a/includes/CoreParserFunctions.php +++ b/includes/CoreParserFunctions.php @@ -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 ) ); diff --git a/includes/MagicWord.php b/includes/MagicWord.php index c23c3cb686..bf72a0c841 100644 --- a/includes/MagicWord.php +++ b/includes/MagicWord.php @@ -53,6 +53,7 @@ class MagicWord { 'localhour', 'numberofarticles', 'numberoffiles', + 'numberofedits', 'sitename', 'server', 'servername', diff --git a/includes/Parser.php b/includes/Parser.php index 504780ff0f..efaf303e52 100644 --- a/includes/Parser.php +++ b/includes/Parser.php @@ -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': diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index 6a39d5930f..345bbb996e 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -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' ), -- 2.20.1