]> git.sesse.net Git - wloh/blobdiff - www/rating.pl
In bayeswf, dump aux_params before the others, since that is the order we read them...
[wloh] / www / rating.pl
index c69d5a7bf2004cfe1ae1fe3eb9b96ba056ffee60..557231538514e8743bf8463418e1d10aea5b7a15 100755 (executable)
@@ -26,7 +26,7 @@ my $locale = wloh_common::get_locale($cgi);
 
 my $aux_parms = wloh_common::get_auxillary_parameters($dbh, $locale);
 
-POSIX::setlocale(&POSIX::LC_ALL, 'nb_NO.UTF-8');
+wloh_common::set_locale($locale);
 
 my $season = wloh_common::get_max_season($dbh, $locale);
 
@@ -52,7 +52,7 @@ my $i = 0;
 while (my $ref = $q->fetchrow_hashref) {
        my %division = ();
 
-       $division{'#rank'} = sprintf "%d.", $ref->{'divisjon'};
+       $division{'#rank'} = wloh_common::get_ordinal($ref->{'divisjon'}, $locale);
        $division{'#average'} = sprintf "%.1f", $ref->{'avg_rating'};
        $division{'#stddev'} = sprintf "%.1f", $ref->{'stddev_rating'};
 
@@ -86,7 +86,7 @@ $i = 0;
 while (my $ref = $q->fetchrow_hashref) {
        my %player = ();
 
-       $player{'#rank'} = sprintf "%d.", ++$i;
+       $player{'#rank'} = wloh_common::get_ordinal(++$i, $locale);
        $player{'#user'} = Encode::decode_utf8($ref->{'navn'});
        $player{'#user/href'} = sprintf "http://wordfeud.aasmul.net/bruker-%d", $ref->{'id'};
        $player{'#rating'} = sprintf "%.1f", $ref->{'rating'};
@@ -97,8 +97,8 @@ while (my $ref = $q->fetchrow_hashref) {
        push @players, \%player;
 }
 
-print CGI->header(-type=>'text/html; charset=utf-8', -expires=>'+5m');
-wloh_common::process_template('rating.xml', {
+print CGI->header(-type=>'text/html; charset=utf-8', -expires=>'+75m');
+wloh_common::process_template('rating', $locale, {
        '#navbar' => wloh_common::get_navbar($cgi, $dbh, $locale),
        'iterations' => $aux_parms->{'num_iterations'},
        'rating-prior-stddev' => sprintf("%.1f", $aux_parms->{'rating_prior_stddev'}),