From fd34e637d2479306770af640dbb648e6cd39027e Mon Sep 17 00:00:00 2001 From: Magnus Manske Date: Sat, 24 Jul 2004 10:44:33 +0000 Subject: [PATCH] Article validation code --- includes/SpecialValidate.php | 18 ++++++++++++++---- languages/Language.php | 1 + 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/includes/SpecialValidate.php b/includes/SpecialValidate.php index 346d855684..a7cf40830d 100644 --- a/includes/SpecialValidate.php +++ b/includes/SpecialValidate.php @@ -64,7 +64,7 @@ class Validation $validationtypes = $wgLang->getValidationTypes() ; if ( $article_title == "" ) { - $article_title = $_GET['article'] ; + $article_title = $_GET['article_title'] ; $heading = "

" . $article_title . "

\n" ; } else $heading = "" ; @@ -130,6 +130,11 @@ class Validation # Generating HTML $html = "" ; + + $skin = $wgUser->getSkin() ; + $staturl = $skin->makeSpecialURL ( "validate" , "mode=stat_page&article_title={$article_title}" ) ; + $html .= "" . wfMsg('val_stat_link_text') . "" ; + $tabsep = "" ; $topstyle = "style='border-top:2px solid black'" ; foreach ( $val AS $time => $stuff ) @@ -187,8 +192,9 @@ class Validation function getPageStatistics ( $article_title = "" ) { + global $wgLang, $wgUser ; $validationtypes = $wgLang->getValidationTypes() ; - $article_title = $_GET['article'] ; + $article_title = $_GET['article_title'] ; $html = "

Page validation statistics

\n" ; $d = $this->getData ( -1 , $article_title , -1 ) ; if ( count ( $d ) ) $d = array_shift ( $d ) ; @@ -203,8 +209,11 @@ class Validation $html .= "\n" ; foreach ( $d AS $version => $data ) { + $title = Title::newFromDBkey ( $article_title ) ; + $version_link = $title->getFullURL( "action=validate×tamp={$version}" ) ; + $version_link = "" . gmdate("F d, Y H:i:s",wfTimestamp2Unix($version)) . "" ; $html .= "" ; - $html .= "{$version}" ; + $html .= "{$version_link}" ; $vmax = array() ; $vcur = array() ; @@ -213,7 +222,8 @@ class Validation if ( !isset ( $vcur[$type] ) ) $vcur[$type] = 0 ; if ( !isset ( $vmax[$type] ) ) $vmax[$type] = 0 ; $vcur[$type] += $x->val_value ; - $vmax[$type] += $title[3] ; + $temp = explode ( "|" , $validationtypes[$type]) ; + $vmax[$type] += $temp[3] - 1 ; } diff --git a/languages/Language.php b/languages/Language.php index 54edfc6153..694c6d0cc5 100644 --- a/languages/Language.php +++ b/languages/Language.php @@ -1265,6 +1265,7 @@ Type the name of the user in the box and press the button to make the user an ad 'val_this_version' => "

This version

\n", 'val_version_of' => "

Version of $1

\n" , 'val_table_header' => "Class$1Opinion$1Comment\n", +'val_stat_link_text' => 'Validation statistics for this article', # Move page # -- 2.20.1