r4453 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r4452‎ | r4453 | r4454 >
Date:15:14, 31 July 2004
Author:magnus_manske
Status:old
Tags:
Comment:
Article validation code (number of user validations)
Modified paths:
  • /trunk/phase3/includes/SpecialContributions.php (modified) (history)
  • /trunk/phase3/includes/SpecialValidate.php (modified) (history)
  • /trunk/phase3/languages/Language.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/SpecialValidate.php
@@ -325,7 +325,16 @@
326326 $html .= "</table>\n" ;
327327 return $html ;
328328 }
329 -
 329+
 330+ function countUserValidations ( $userid )
 331+ {
 332+ $sql = "SELECT count(DISTINCT val_title) AS num FROM validate WHERE val_user={$userid}" ;
 333+ $res = wfQuery( $sql, DB_READ );
 334+ if ( $s = wfFetchObject( $res ) ) $num = $s->num ;
 335+ else $num = 0 ;
 336+ return $num ;
 337+ }
 338+
330339 }
331340
332341 function wfSpecialValidate( $page = "" )
Index: trunk/phase3/includes/SpecialContributions.php
@@ -142,6 +142,12 @@
143143 ucListEdit( $sk, $ns, $t, $ts, $topmark, $comment, ( $me > 0), $isnew, $usertext );
144144 }
145145 $wgOut->addHTML( "</ul>\n" );
 146+
 147+ # Validations
 148+ $val = new Validation ;
 149+ $val = $val->countUserValidations ( $id ) ;
 150+ $val = str_replace ( "$1" , $val , wfMsg ( 'val_user_validations' ) ) ;
 151+ $wgOut->addHTML( $val );
146152 }
147153
148154
Index: trunk/phase3/languages/Language.php
@@ -1280,6 +1280,7 @@
12811281 'val_stat_link_text' => 'Validation statistics for this article',
12821282 'val_view_version' => 'View this version',
12831283 'val_validate_version' => 'Validate this version',
 1284+'val_user_validations' => 'This user has validated $1 pages.',
12841285
12851286 # Move page
12861287 #

Status & tagging log