Article validation code (number of user validations)
authorMagnus Manske <magnusmanske@users.mediawiki.org>
Sat, 31 Jul 2004 15:14:55 +0000 (15:14 +0000)
committerMagnus Manske <magnusmanske@users.mediawiki.org>
Sat, 31 Jul 2004 15:14:55 +0000 (15:14 +0000)
includes/SpecialContributions.php
includes/SpecialValidate.php
languages/Language.php

index 279f58c..cf3e4cb 100644 (file)
@@ -142,6 +142,12 @@ function wfSpecialContributions( $par = "" )
                        ucListEdit( $sk, $ns, $t, $ts, $topmark, $comment, ( $me > 0), $isnew, $usertext );
        }
        $wgOut->addHTML( "</ul>\n" );
+       
+       # Validations
+       $val = new Validation ;
+       $val = $val->countUserValidations ( $id ) ;
+       $val = str_replace ( "$1" , $val , wfMsg ( 'val_user_validations' ) ) ;
+       $wgOut->addHTML( $val );
 }
 
 
index eccd77b..94199b0 100644 (file)
@@ -325,7 +325,16 @@ class Validation
                $html .= "</table>\n" ;
                return $html ;
                }
-               
+
+       function countUserValidations ( $userid )
+               {
+               $sql = "SELECT count(DISTINCT val_title) AS num FROM validate WHERE val_user={$userid}" ;
+               $res = wfQuery( $sql, DB_READ );
+               if ( $s = wfFetchObject( $res ) ) $num = $s->num ;
+               else $num = 0 ;
+               return $num ;
+               }
+
        }
 
 function wfSpecialValidate( $page = "" )
index 352f144..2045334 100644 (file)
@@ -1280,6 +1280,7 @@ merging will fill in the other options with your previous settings.',
 'val_stat_link_text' => 'Validation statistics for this article',
 'val_view_version' => 'View this version',
 'val_validate_version' => 'Validate this version',
+'val_user_validations' => 'This user has validated $1 pages.',
 
 # Move page
 #