From ecfe0e38feaae4e60f159fd6097c3484c8597372 Mon Sep 17 00:00:00 2001 From: Magnus Manske Date: Thu, 7 Jul 2005 18:45:22 +0000 Subject: [PATCH] Fixes for patch --- includes/SpecialValidate.php | 7 +++++-- languages/Language.php | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/includes/SpecialValidate.php b/includes/SpecialValidate.php index 5766a318db..1c43c98c56 100644 --- a/includes/SpecialValidate.php +++ b/includes/SpecialValidate.php @@ -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; } diff --git a/languages/Language.php b/languages/Language.php index ff9d724f26..c520bdecea 100644 --- a/languages/Language.php +++ b/languages/Language.php @@ -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" here', +'val_rev_stats' => 'See the validation statistics for "$1" here', 'val_revision_stats_link' => 'details', 'val_iamsure' => 'Check this box if you really mean it!', 'val_details_th' => 'User \\ Topic', -- 2.20.1