Revert r51200, r51253, r51254, addition of {{NUMBEROFCONTRIBS:...}} parser function...
authorTim Starling <tstarling@users.mediawiki.org>
Sat, 6 Jun 2009 02:49:32 +0000 (02:49 +0000)
committerTim Starling <tstarling@users.mediawiki.org>
Sat, 6 Jun 2009 02:49:32 +0000 (02:49 +0000)
RELEASE-NOTES
includes/MagicWord.php
includes/parser/CoreParserFunctions.php
languages/messages/MessagesEn.php

index 840c878..2a87ccc 100644 (file)
@@ -76,8 +76,6 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * (bug 18860) Blocks of IPs affecting registered users can now block email
 * (bug 17093) Date and time are separate parameters in Special:BlockList
 * (bug 11484) Added ISO speed rating to default collapsed EXIF metadata view
-* (bug 19012) Introduce {{NUMBEROFCONTRIBS}} variable to display the number
-  of contributions a user has.
 * (bug 14866) Messages 'recentchangeslinked-toolbox' and
   'recentchangeslinked-toolbox' were added to allow more fine grained
   customisation of the user interface
index d92817e..b69d57e 100644 (file)
@@ -107,46 +107,45 @@ class MagicWord {
 
        /* Array of caching hints for ParserCache */
        static public $mCacheTTLs = array (
-               'currentmonth'           => 86400,
-               'currentmonth1'          => 86400,
-               'currentmonthname'       => 86400,
-               'currentmonthnamegen'    => 86400,
-               'currentmonthabbrev'     => 86400,
-               'currentday'             => 3600,
-               'currentday2'            => 3600,
-               'currentdayname'         => 3600,
-               'currentyear'            => 86400,
-               'currenttime'            => 3600,
-               'currenthour'            => 3600,
-               'localmonth'             => 86400,
-               'localmonth1'            => 86400,
-               'localmonthname'         => 86400,
-               'localmonthnamegen'      => 86400,
-               'localmonthabbrev'       => 86400,
-               'localday'               => 3600,
-               'localday2'              => 3600,
-               'localdayname'           => 3600,
-               'localyear'              => 86400,
-               'localtime'              => 3600,
-               'localhour'              => 3600,
-               'numberofarticles'       => 3600,
-               'numberoffiles'          => 3600,
-               'numberofedits'          => 3600,
-               'currentweek'            => 3600,
-               'currentdow'             => 3600,
-               'localweek'              => 3600,
-               'localdow'               => 3600,
-               'numberofusers'          => 3600,
-               'numberofactiveusers'    => 3600,
-               'numberofpages'          => 3600,
-               'currentversion'         => 86400,
-               'currenttimestamp'       => 3600,
-               'localtimestamp'         => 3600,
-               'pagesinnamespace'       => 3600,
-               'numberofadmins'         => 3600,
-               'numberofviews'          => 3600,
-               'numberingroup'          => 3600,
-               'numberofcontribs'       => 3600,
+               'currentmonth' => 86400,
+               'currentmonth1' => 86400,
+               'currentmonthname' => 86400,
+               'currentmonthnamegen' => 86400,
+               'currentmonthabbrev' => 86400,
+               'currentday' => 3600,
+               'currentday2' => 3600,
+               'currentdayname' => 3600,
+               'currentyear' => 86400,
+               'currenttime' => 3600,
+               'currenthour' => 3600,
+               'localmonth' => 86400,
+               'localmonth1' => 86400,
+               'localmonthname' => 86400,
+               'localmonthnamegen' => 86400,
+               'localmonthabbrev' => 86400,
+               'localday' => 3600,
+               'localday2' => 3600,
+               'localdayname' => 3600,
+               'localyear' => 86400,
+               'localtime' => 3600,
+               'localhour' => 3600,
+               'numberofarticles' => 3600,
+               'numberoffiles' => 3600,
+               'numberofedits' => 3600,
+               'currentweek' => 3600,
+               'currentdow' => 3600,
+               'localweek' => 3600,
+               'localdow' => 3600,
+               'numberofusers' => 3600,
+               'numberofactiveusers' => 3600,
+               'numberofpages' => 3600,
+               'currentversion' => 86400,
+               'currenttimestamp' => 3600,
+               'localtimestamp' => 3600,
+               'pagesinnamespace' => 3600,
+               'numberofadmins' => 3600,
+               'numberofviews' => 3600,
+               'numberingroup' => 3600,
                );
 
        static public $mDoubleUnderscoreIDs = array(
index b6f1ed1..be6d55a 100644 (file)
@@ -38,7 +38,6 @@ class CoreParserFunctions {
                $parser->setFunctionHook( 'numberingroup',    array( __CLASS__, 'numberingroup'    ), SFH_NO_HASH );
                $parser->setFunctionHook( 'numberofedits',    array( __CLASS__, 'numberofedits'    ), SFH_NO_HASH );
                $parser->setFunctionHook( 'numberofviews',    array( __CLASS__, 'numberofviews'    ), SFH_NO_HASH );
-               $parser->setFunctionHook( 'numberofcontribs', array( __CLASS__, 'numberofcontribs' ), SFH_NO_HASH );
                $parser->setFunctionHook( 'language',         array( __CLASS__, 'language'         ), SFH_NO_HASH );
                $parser->setFunctionHook( 'padleft',          array( __CLASS__, 'padleft'          ), SFH_NO_HASH );
                $parser->setFunctionHook( 'padright',         array( __CLASS__, 'padright'         ), SFH_NO_HASH );
@@ -483,7 +482,7 @@ class CoreParserFunctions {
                        $rev = Revision::newFromTitle($title);
                        $id = $rev ? $rev->getPage() : 0;
                        $length = $cache[$page] = $rev ? $rev->getSize() : 0;
-                       
+       
                        // Register dependency in templatelinks
                        $parser->mOutput->addTemplate( $title, $id, $rev ? $rev->getId() : 0 );
                }       
@@ -505,22 +504,6 @@ class CoreParserFunctions {
                $lang = $wgContLang->getLanguageName( strtolower( $arg ) );
                return $lang != '' ? $lang : $arg;
        }
-       
-       /**
-       * Returns the number of contributions by a certain user. This is an 
-       * expensive parser function and can't be called too many times per page
-       */
-       static function numberofcontribs( $parser, $user = null, $raw = null ) {
-               if ( is_null($user) || !User::isValidUserName( $user ) ) {
-                       return '';
-               }
-               if ( !$parser->incrementExpensiveFunctionCount() ) {
-                       return '';
-               }
-               $u = User::newFromName( $user );
-               $id = User::idFromName( $u->mName );
-               return self::formatRaw( User::edits( $id ), $raw );
-       }
 
        /**
         * Unicode-safe str_pad with the restriction that $length is forced to be <= 500
index 39fefda..52ffd1c 100644 (file)
@@ -340,7 +340,6 @@ $magicWords = array(
        'index'                  => array( 1,    '__INDEX__'              ),
        'noindex'                => array( 1,    '__NOINDEX__'            ),
        'numberingroup'          => array( 1,    'NUMBERINGROUP', 'NUMINGROUP' ),
-       'numberofcontribs'       => array( 1,    'NUMBEROFCONTRIBS', 'USERCONTRIBS', 'NUMOFCONTRIBS' ),
        'staticredirect'         => array( 1,    '__STATICREDIRECT__'     ),
        'protectionlevel'        => array( 1,    'PROTECTIONLEVEL'        ),
        'formatdate'             => array( 0,    'formatdate', 'dateformat' ),