Added rank column

Change-Id: If4da3aedb2a472150a93385bf2d349d16812603d
This commit is contained in:
Matt Smith 2013-09-22 22:54:28 -05:00 committed by Amir E. Aharoni
parent f78a5a64d0
commit 80f0175726
2 changed files with 12 additions and 3 deletions

View file

@ -16,6 +16,7 @@ $messages['en'] = array(
'contributionscores-days' => 'Last {{PLURAL:$1|day|$1 days}}',
'contributionscores-allrevisions' => 'All time',
'contributionscores-score' => 'Score',
'contributionscores-rank' => 'Rank',
'contributionscores-pages' => 'Pages',
'contributionscores-changes' => 'Changes',
'contributionscores-username' => 'Username',
@ -59,6 +60,8 @@ See also:
* {{msg-mw|Contributionscores-days}}',
'contributionscores-score' => 'Used as column header of the table.
{{Related|Contributionscores-score}}',
'contributionscores-rank' => '{{Related|Contributionscores-score}}
{{Identical|Rank}}',
'contributionscores-pages' => '{{Related|Contributionscores-score}}
{{Identical|Page}}',
'contributionscores-changes' => '{{Related|Contributionscores-score}}
@ -782,6 +785,7 @@ $messages['he'] = array(
'contributionscores-days' => 'ב{{PLURAL:$1|יום האחרון|יומיים האחרונים|־$1 הימים האחרונים}}',
'contributionscores-allrevisions' => 'מאז ומתמיד',
'contributionscores-score' => 'ניקוד',
'contributionscores-rank' => 'דירוג',
'contributionscores-pages' => 'דפים',
'contributionscores-changes' => 'שינויים',
'contributionscores-username' => 'שם משתמש',

View file

@ -92,12 +92,14 @@ class ContributionScores extends IncludableSpecialPage {
$output = "<table class=\"wikitable contributionscores plainlinks{$sortable}\" >\n" .
"<tr class='header'>\n" .
Html::element( 'th', array(), $this->msg( 'contributionscores-rank' )->text() ) .
Html::element( 'th', array(), $this->msg( 'contributionscores-score' )->text() ) .
Html::element( 'th', array(), $this->msg( 'contributionscores-pages' )->text() ) .
Html::element( 'th', array(), $this->msg( 'contributionscores-changes' )->text() ) .
Html::element( 'th', array(), $this->msg( 'contributionscores-username' )->text() );
$altrow = '';
$user_rank = 1;
$lang = $this->getLanguage();
foreach ( $res as $row ) {
@ -116,9 +118,10 @@ class ContributionScores extends IncludableSpecialPage {
}
$output .= Html::closeElement( 'tr' );
$output .= "<tr class='{$altrow}'>\n<td class='content'>" .
$lang->formatNum( round( $row->wiki_rank, 0 ) ) . "\n</td><td class='content'>" .
$lang->formatNum( $row->page_count ) . "\n</td><td class='content'>" .
$output .= "<tr class='{$altrow}'>\n<td class='content' style='padding-right:10px;text-align:right;'>" .
$lang->formatNum( round( $user_rank, 0 ) ) . "\n</td><td class='content' style='padding-right:10px;text-align:right;'>" .
$lang->formatNum( round( $row->wiki_rank, 0 ) ) . "\n</td><td class='content' style='padding-right:10px;text-align:right;'>" .
$lang->formatNum( $row->page_count ) . "\n</td><td class='content' style='padding-right:10px;text-align:right;'>" .
$lang->formatNum( $row->rev_count ) . "\n</td><td class='content'>" .
$userLink;
@ -134,6 +137,8 @@ class ContributionScores extends IncludableSpecialPage {
} else {
$altrow = '';
}
$user_rank++;
}
$output .= Html::closeElement( 'tr' );
$output .= Html::closeElement( 'table' );