slight alteration to comment
[lhc/web/wiklou.git] / includes / SpecialStatistics.php
index 35c4f21..1a96dcf 100644 (file)
@@ -1,8 +1,8 @@
-<?
+<?php
 
 function wfSpecialStatistics()
 {
-       global $wgUser, $wgOut;
+       global $wgUser, $wgOut, $wgLang;
        $fname = "wfSpecialStatistics";
 
        $wgOut->addHTML( "<h2>" . wfMsg( "sitestats" ) . "</h2>\n" );
@@ -20,12 +20,13 @@ function wfSpecialStatistics()
        $edits = $row->ss_total_edits;
        $good = $row->ss_good_articles;
 
-       $text = str_replace( "$1", $total, wfMsg( "sitestatstext" ) );
-       $text = str_replace( "$2", $good, $text );
-       $text = str_replace( "$3", $views, $text );
-       $text = str_replace( "$4", $edits, $text );
-       $text = str_replace( "$5", sprintf( "%.2f", $edits / $total ), $text );
-       $text = str_replace( "$6", sprintf( "%.2f", $views / $edits ), $text );
+       $text = wfMsg( "sitestatstext",
+               $wgLang->formatNum( $total ),
+               $wgLang->formatNum( $good ),
+               $wgLang->formatNum( $views ),
+               $wgLang->formatNum( $edits ),
+               $wgLang->formatNum( sprintf( "%.2f", $total ? $edits / $total : 0 ) ),
+               $wgLang->formatNum( sprintf( "%.2f", $edits ? $views / $edits : 0 ) ) );
 
        $wgOut->addHTML( $text );
        $wgOut->addHTML( "<h2>" . wfMsg( "userstats" ) . "</h2>\n" );
@@ -44,9 +45,9 @@ function wfSpecialStatistics()
        $sk = $wgUser->getSkin();
        $ap = $sk->makeKnownLink( wfMsg( "administrators" ), "" );
 
-       $text = str_replace( "$1", $total, wfMsg( "userstatstext" ) );
-       $text = str_replace( "$2", $admins, $text );
-       $text = str_replace( "$3", $ap, $text );
+       $text = wfMsg( "userstatstext",
+               $wgLang->formatNum( $total ),
+               $wgLang->formatNum( $admins ), $ap );
        $wgOut->addHTML( $text );
 }