-<?
+<?php
function wfSpecialStatistics()
{
- global $wgUser, $wgOut;
+ global $wgUser, $wgOut, $wgLang;
$fname = "wfSpecialStatistics";
$wgOut->addHTML( "<h2>" . wfMsg( "sitestats" ) . "</h2>\n" );
$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" );
$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 );
}