Introduce magic word {{NUMBEROFEDITS}}

This commit is contained in:
Ivan Lanin 2007-04-17 09:23:31 +00:00
parent 872e0ca649
commit 73bb06d1a0
5 changed files with 7 additions and 0 deletions

View 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 ==

View 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 ) );

View file

@ -53,6 +53,7 @@ class MagicWord {
'localhour',
'numberofarticles',
'numberoffiles',
'numberofedits',
'sitename',
'server',
'servername',

View 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':

View 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' ),