Fixes for patch
authorMagnus Manske <magnusmanske@users.mediawiki.org>
Thu, 7 Jul 2005 18:45:22 +0000 (18:45 +0000)
committerMagnus Manske <magnusmanske@users.mediawiki.org>
Thu, 7 Jul 2005 18:45:22 +0000 (18:45 +0000)
includes/SpecialValidate.php
languages/Language.php

index 5766a31..1c43c98 100644 (file)
@@ -555,7 +555,7 @@ class Validation {
 
                # Collecting statistic data
                $db =& wfGetDB( DB_SLAVE );
-               $res = $db->select( 'validate', '*', array( 'val_page' => $this->page_id, val_revision => $revision ), 'SpecialValidate::showDetails' );
+               $res = $db->select( 'validate', '*', array( 'val_page' => $this->page_id, 'val_revision' => $revision ), 'SpecialValidate::showDetails' );
                while( $x = $db->fetchObject($res) ) {
                        $data[$this->make_user_id($x)][$x->val_type] = $x;
                        $users[$this->make_user_id($x)] = true;
@@ -623,11 +623,14 @@ class Validation {
                
                # Collecting statistic data
                $db =& wfGetDB( DB_SLAVE );
-               $res = $db->select( 'validate', '*', array( val_page => $this->page_id ), 'SpecialValidate::showList' );
+               $res = $db->select( 'validate', '*', array( "val_page" => $this->page_id ), 'SpecialValidate::showList' );
 
                $statistics = array();
                while( $vote = $db->fetchObject($res) ) {
                        $ts = $this->getRevisionTimestamp($vote->val_revision);
+                       if ( !isset ( $statistics[$ts] ) ) $statistics[$ts] = array () ;
+                       if ( !isset ( $statistics[$ts][$vote->val_type]->count ) ) $statistics[$ts][$vote->val_type]->count = 0 ;
+                       if ( !isset ( $statistics[$ts][$vote->val_type]->sum ) ) $statistics[$ts][$vote->val_type]->sum = 0 ;
                        $statistics[$ts][$vote->val_type]->count++;
                        $statistics[$ts][$vote->val_type]->sum += $vote->val_value;
                }
index ff9d724..c520bde 100644 (file)
@@ -1505,7 +1505,7 @@ Type the name of the user in the box and press the button to make the user an ad
 'val_validation_of' => 'Validation of "$1"',
 'val_revision_of' => 'Revision of $1',
 'val_revision_changes_ok' => 'Your ratings have been stored!',
-'val_rev_stats_link' => 'See the validation statistics for "$1" <a href="$2">here</a>',
+'val_rev_stats' => 'See the validation statistics for "$1" <a href="$2">here</a>',
 'val_revision_stats_link' => 'details',
 'val_iamsure' => 'Check this box if you really mean it!',
 'val_details_th' => '<sub>User</sub> \\ <sup>Topic</sup>',