Fix hardcoded "last month" in statistic message for acitve users.
authorRaimond Spekking <raymond@users.mediawiki.org>
Wed, 17 Dec 2008 13:54:32 +0000 (13:54 +0000)
committerRaimond Spekking <raymond@users.mediawiki.org>
Wed, 17 Dec 2008 13:54:32 +0000 (13:54 +0000)
This is wrong because the number of active users is count in SiteStats::cacheUpdate from recentchanges table.
Default of $wgRCMaxAge is 7 days not 30 days.

includes/specials/SpecialStatistics.php
languages/messages/MessagesEn.php

index 93edcd1..1c8a014 100644 (file)
@@ -93,12 +93,13 @@ class SpecialStatistics extends SpecialPage {
         * @param float $number a number
         * @param array $trExtraParams
         * @param string $descMsg
+        * @param string $descMsgParam
         * @return string table row in HTML format
         */
-       private function formatRow( $text, $number, $trExtraParams = array(), $descMsg = '' ) {
+       private function formatRow( $text, $number, $trExtraParams = array(), $descMsg = '', $descMsgParam = '' ) {
                global $wgStylePath;
                if( $descMsg ) {
-                       $descriptionText = wfMsg( $descMsg );
+                       $descriptionText = wfMsgExt( $descMsg, array( 'parseinline' ), $descMsgParam );
                        if ( !wfEmptyMsg( $descMsg, $descriptionText ) ) {
                                $descriptionText = " ($descriptionText)";
                                $text .= "<br />" . Xml::element( 'small', array( 'class' => 'mw-statistic-desc'), 
@@ -148,7 +149,7 @@ class SpecialStatistics extends SpecialPage {
                                                array( 'class' => 'mw-statistics-jobqueue' ) );
        }
        private function getUserStats() {
-               global $wgLang;
+               global $wgLang, $wgRCMaxAge;
                return Xml::openElement( 'tr' ) .
                        Xml::tags( 'th', array( 'colspan' => '2' ), wfMsg( 'statistics-header-users' ) ) .
                        Xml::closeElement( 'tr' ) .
@@ -158,7 +159,8 @@ class SpecialStatistics extends SpecialPage {
                                $this->formatRow( wfMsgExt( 'statistics-users-active', array( 'parseinline' ) ),
                                                $wgLang->formatNum( $this->activeUsers ),
                                                array( 'class' => 'mw-statistics-users-active' ),
-                                               'statistics-users-active-desc' );
+                                               'statistics-users-active-desc',
+                                               $wgLang->formatNum( ceil( $wgRCMaxAge / ( 3600 * 24 ) ) ) );
        }
        private function getGroupStats() {
                global $wgGroupPermissions, $wgImplicitGroups, $wgLang, $wgUser;
index f6f78bf..8a293b0 100644 (file)
@@ -2028,7 +2028,7 @@ Remember to check for other links to the templates before deleting them.',
 'statistics-jobqueue'          => '[http://www.mediawiki.org/wiki/Manual:Job_queue Job queue] length',
 'statistics-users'             => 'Registered [[Special:ListUsers|users]]',
 'statistics-users-active'      => 'Active users',
-'statistics-users-active-desc' => 'Users who have performed an action in the past month',
+'statistics-users-active-desc' => 'Users who have performed an action in the last {{PLURAL:$1|day|$1 days}}',
 'statistics-mostpopular'       => 'Most viewed pages',
 'statistics-footer'            => '', # do not translate or duplicate this message to other languages