diff --git a/ContributionScores.i18n.php b/ContributionScores.i18n.php index dd68c82..1987967 100644 --- a/ContributionScores.i18n.php +++ b/ContributionScores.i18n.php @@ -1,7 +1,20 @@ array( - 'contributionscores' => 'Contribution Scores' + 'contributionscores' => 'Contribution Scores', + 'contributionscores-info' => "Scores are calculated as follows:\n". + "*1 point for each unique page edited\n". + "*Square Root of (Total Edits Made) - (Total Unique Pages) * 2\n". + "Scores calculated in this manner weight edit diversity over edit volume. Basically, this score measures". + " primarily unique pages edited, with consideration for high edit volume - assumed to be a higher quality ". + "article.", + 'contributionscores-top' => '(Top $1)', + 'contributionscores-days' => 'Last $1 Days', + 'contributionscores-allrevisions' => 'All Revisions' ), 'de' => array( 'contributionscores' => 'Benutzerbeiträge auswerten', diff --git a/ContributionScores.php b/ContributionScores.php index 43631e5..7324a3f 100644 --- a/ContributionScores.php +++ b/ContributionScores.php @@ -1,4 +1,8 @@ + */ class ContributionScores extends SpecialPage { function ContributionScores() { SpecialPage::SpecialPage("ContributionScores"); self::loadMessages(); } - + + ///Generates a "Contribution Scores" table for a given LIMIT and date range + /** + * Function generates Contribution Scores tables in HTML format (not wikiText) + * + * @param $days int Days in the past to run report for + * @param $limit int Maximum number of users to return (default 50) + * + * @return HTML Table representing the requested Contribution Scores. + */ function genContributionScoreTable( $days, $limit ) { - global $contribScoreIgnoreBots; + global $contribScoreIgnoreBots, $wgUser; $dbr =& wfGetDB( DB_SLAVE ); @@ -44,22 +66,23 @@ class ContributionScores extends SpecialPage $res = $dbr->query($sql); - $output = "{|class=\"wikitable sortable\"\n". - "|-\n". - "|style=\"font-weight: bold;\"|Score\n". - "|style=\"font-weight: bold;\"|Pages\n". - "|style=\"font-weight: bold;\"|Changes\n". - "|style=\"font-weight: bold;\"|Username\n"; + $output = "
Score | \n". + "Pages | \n". + "Changes | \n". + "Username | \n"; + $skin =& $wgUser->getSkin(); while ( $row = $dbr->fetchObject( $res ) ) { - $wikiUserName = $row->user_name; - $output .= "|-\n|" . - round($row->wiki_rank,0) . "\n|" . - $row->page_count . "\n|" . - $row->rev_count . "\n|" . - "[[User:".$wikiUserName."|".$wikiUserName."]] ([[User_talk:".$wikiUserName."|Talk]] | [[Special:Contributions/".$wikiUserName."|contribs]])" . "\n"; + $output .= "
" . + round($row->wiki_rank,0) . "\n | " . + $row->page_count . "\n | " . + $row->rev_count . "\n | " . + $skin->userLink( $row->user_id, $row->user_name ) . + $skin->userToolLinks( $row->user_id, $row->user_name ) . " | \n"; } - $output .= "|}"; + $output .= "