r20304 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r20303‎ | r20304 | r20305 >
Date:23:08, 9 March 2007
Author:raymond
Status:old
Tags:
Comment:
* (bug 5619) Split statistics messages for brighter output if
$wgDisableCounters or $wgMiserMode are true
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/SpecialStatistics.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesDe.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesEn.php (modified) (history)
  • /trunk/phase3/maintenance/language/messages.inc (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/language/messages.inc
@@ -863,8 +863,10 @@
864864 'statistics',
865865 'sitestats',
866866 'userstats',
867 - 'sitestatstext',
868 - 'userstatstext',
 867+ 'sitestats-text',
 868+ 'sitestats-views',
 869+ 'sitestats-jobs',
 870+ 'userstats-text',
869871 'statistics-mostpopular',
870872 'statistics-footer',
871873 ),
Index: trunk/phase3/includes/SpecialStatistics.php
@@ -31,31 +31,39 @@
3232 echo "total=$total;good=$good;views=$views;edits=$edits;users=$users;admins=$admins;images=$images;jobs=$numJobs\n";
3333 return;
3434 } else {
 35+ global $wgDisableCounters, $wgMiserMode, $wgUser, $wgLang, $wgContLang;
 36+
3537 $text = '==' . wfMsg( 'sitestats' ) . "==\n" ;
36 - $text .= wfMsgExt( 'sitestatstext', array ( 'parsemag' ),
 38+ $text .= wfMsgExt( 'sitestats-text', array ( 'parsemag' ),
3739 $wgLang->formatNum( $total ),
3840 $wgLang->formatNum( $good ),
39 - $wgLang->formatNum( $views ),
4041 $wgLang->formatNum( $edits ),
4142 $wgLang->formatNum( sprintf( '%.2f', $total ? $edits / $total : 0 ) ),
42 - $wgLang->formatNum( sprintf( '%.2f', $edits ? $views / $edits : 0 ) ),
43 - $wgLang->formatNum( $numJobs ),
4443 $wgLang->formatNum( $images )
4544 );
4645
 46+ if( !$wgDisableCounters && !$wgMiserMode ) {
 47+ $text .= '<p>' . wfMsgExt( 'sitestats-views', array ( 'parsemag' ),
 48+ $wgLang->formatNum( $views ),
 49+ $wgLang->formatNum( sprintf( '%.2f', $edits ? $views / $edits : 0 ) )
 50+ ) . '</p>';
 51+ }
 52+
 53+ $text .= '<p>' . wfMsgExt( 'sitestats-jobs', array ( 'parsemag' ),
 54+ $wgLang->formatNum( $numJobs )
 55+ ) . '</p>';
 56+
4757 $text .= "\n==" . wfMsg( 'userstats' ) . "==\n";
4858
49 - $text .= wfMsgExt( 'userstatstext', array ( 'parsemag' ),
 59+ $text .= wfMsgExt( 'userstats-text', array ( 'parsemag' ),
5060 $wgLang->formatNum( $users ),
5161 $wgLang->formatNum( $admins ),
52 - '[[' . wfMsgForContent( 'grouppage-sysop' ) . ']]', # TODO somehow remove, kept for backwards compatibility
5362 $wgLang->formatNum( sprintf( '%.2f', $admins / $users * 100 ) ),
5463 User::makeGroupLinkWiki( 'sysop' )
5564 );
5665
5766 $wgOut->addWikiText( $text );
5867
59 - global $wgDisableCounters, $wgMiserMode, $wgUser, $wgLang, $wgContLang;
6068 if( !$wgDisableCounters && !$wgMiserMode ) {
6169 $page = $dbr->tableName( 'page' );
6270 $sql = "SELECT page_namespace, page_title, page_counter FROM {$page} WHERE page_is_redirect = 0 AND page_counter > 0 ORDER BY page_counter DESC";
@@ -74,11 +82,11 @@
7583 $dbr->freeResult( $res );
7684 }
7785 }
78 -
 86+
7987 $footer = wfMsg( 'statistics-footer' );
8088 if( !wfEmptyMsg( 'statistics-footer', $footer ) && $footer != '' )
8189 $wgOut->addWikiText( $footer );
82 -
 90+
8391 }
8492 }
8593 ?>
Index: trunk/phase3/languages/messages/MessagesEn.php
@@ -1449,21 +1449,18 @@
14501450 'statistics' => 'Statistics',
14511451 'sitestats' => '{{SITENAME}} statistics',
14521452 'userstats' => 'User statistics',
1453 -'sitestatstext' => "There {{PLURAL:$1|is '''1''' page|are '''$1''' total pages}} in the database.
 1453+'sitestats-text' => "There {{PLURAL:$1|is '''1''' page|are '''$1''' total pages}} in the database.
14541454 This includes \"talk\" pages, pages about {{SITENAME}}, minimal \"stub\"
14551455 pages, redirects, and others that probably don't qualify as content pages.
14561456 Excluding those, there {{PLURAL:$2|is '''1''' page that is a|are '''$2''' pages that are}} probably legitimate
14571457 content {{PLURAL:$2|page|pages}}.
14581458
1459 -'''$8''' {{PLURAL:$8|file|files}} have been uploaded.
 1459+'''$5''' {{PLURAL:$5|file|files}} have been uploaded.
14601460
1461 -There have been a total of '''$3''' {{PLURAL:$3|page view|page views}}, and '''$4''' {{PLURAL:$4|page edit|page edits}}
1462 -since {{SITENAME}} was setup.
1463 -That comes to '''$5''' average edits per page, and '''$6''' views per edit.
1464 -
1465 -The [http://meta.wikimedia.org/wiki/Help:Job_queue job queue] length is '''$7'''.",
1466 -'userstatstext' => "There {{PLURAL:$1|is '''1''' registered user|are '''$1''' registered users}}, of which
1467 -'''$2''' (or '''$4%''') {{PLURAL:$2|has|have}} $5 rights.",
 1461+There have been a total '''$3''' {{PLURAL:$3|page edit|page edits}} since {{SITENAME}} was setup. That comes to '''$4''' average edits per page.",
 1462+'sitestats-views' => "There have been a total of '''$1''' {{PLURAL:$1|page view|page views}} and '''$2''' views per edit.",
 1463+'sitestats-jobs' => "The [http://meta.wikimedia.org/wiki/Help:Job_queue job queue] length is '''$1'''.",
 1464+'userstats-text' => "There {{PLURAL:$1|is '''1''' registered user|are '''$1''' registered users}}, of which '''$2''' (or '''$3%''') {{PLURAL:$2|has|have}} $4 rights.",
14681465 'statistics-mostpopular' => 'Most viewed pages',
14691466 'statistics-footer' => '',
14701467
Index: trunk/phase3/languages/messages/MessagesDe.php
@@ -1065,20 +1065,18 @@
10661066 'statistics' => 'Statistik',
10671067 'sitestats' => 'Seitenstatistik',
10681068 'userstats' => 'Benutzerstatistik',
1069 -'sitestatstext' => "Es gibt insgesamt '''$1''' {{PLURAL:$1|Seite|Seiten}} in der Datenbank.
 1069+'sitestats-text' => "Es gibt insgesamt '''$1''' {{PLURAL:$1|Seite|Seiten}} in der Datenbank.
10701070 Das schliesst Diskussionsseiten, Seiten über {{SITENAME}}, kleine Seiten, Weiterleitungen und andere Seiten ein,
10711071 die eventuell nicht als Seiten gewertet werden können.
10721072
10731073 Diese ausgenommen gibt es '''$2''' {{PLURAL:$2|Seite|Seiten}}, die als Seite gewertet werden {{PLURAL:$2|kann|können}}.
10741074
1075 -Insgesamt {{PLURAL:$8|wurde '''1''' Datei|wurden '''$8''' Dateien}} hochgeladen.
 1075+Es {{PLURAL:$5|wurde bisher '''1''' Datei|wurden bisher '''$5''' Dateien}} hochgeladen.
10761076
1077 -Insgesamt gab es '''$3''' {{PLURAL:$3|Seitenabruf|Seitenabrufe}} und '''$4''' {{PLURAL:$4|Seitenbearbeitung|Seitenbearbeitungen}} seit {{SITENAME}} eingerichtet wurde.
1078 -Daraus ergeben sich '''$5''' Bearbeitungen pro Seite und '''$6''' Seitenabrufe pro Bearbeitung.
1079 -
1080 -Länge der [http://meta.wikimedia.org/wiki/Help:Job_queue „Job queue“]: '''$7'''",
1081 -'userstatstext' => "Es gibt '''$1''' {{PLURAL:$1|registrierten|registrierte}} [[Special:Listusers|Benutzer]].
1082 -Davon {{PLURAL:$2|hat|haben}} '''$2''' (=$4%) $5-Rechte.",
 1077+Seit Einrichtung von {{SITENAME}} gab es '''$3''' {{PLURAL:$3|Seitenbearbeitung|Seitenbearbeitungen}}. Daraus ergeben sich '''$4''' Bearbeitungen pro Seite.",
 1078+'sitestats-views' => "Insgesamt gab es '''$1''' {{PLURAL:$1|Seitenabruf|Seitenabrufe}} und damit '''$2''' Seitenabrufe pro Bearbeitung.",
 1079+'sitestats-jobs' => "Länge der [http://meta.wikimedia.org/wiki/Help:Job_queue „Job queue“]: '''$1'''",
 1080+'userstats-text' => "Es gibt '''$1''' {{PLURAL:$1|registrierten|registrierte}} [[Special:Listusers|Benutzer]]. Davon {{PLURAL:$2|hat|haben}} '''$2''' (='''$3%''') $4-Rechte.",
10831081 'statistics-mostpopular' => 'Meist besuchte Seiten',
10841082
10851083 'disambiguations' => 'Begriffsklärungsseiten',
Index: trunk/phase3/RELEASE-NOTES
@@ -262,6 +262,8 @@
263263 * Fix fallback implementation of mb_strlen so it works and isn't insanely
264264 slow for large strings, since it's used for page edit lengths
265265 * (bug 8815) Setting password in initUser() breaks LdapAuthentication plugin
 266+* (bug 5619) Split statistics messages for brighter output if $wgDisableCounters
 267+ or $wgMiserMode are true
266268
267269 == Languages updated ==
268270

Follow-up revisions

RevisionCommit summaryAuthorDate
r20363Revert of r20304....raymond08:48, 12 March 2007
r40636* (bug 5619) Break messages used in Special:Statistics down further...raymond06:50, 9 September 2008