Article validation code (number of user validations)

This commit is contained in:
Magnus Manske 2004-07-31 15:14:55 +00:00
parent d6b0fc1ab5
commit ff74ef5681
3 changed files with 17 additions and 1 deletions

View 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 );
}

View 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 = "" )

View 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
#