Mattsmith321 has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/85678


Change subject: Added rank column. Change-Id: 
If4da3aedb2a472150a93385bf2d349d16812603d
......................................................................

Added rank column.
Change-Id: If4da3aedb2a472150a93385bf2d349d16812603d
---
M ContributionScores.i18n.php
M ContributionScores_body.php
2 files changed, 11 insertions(+), 3 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ContributionScores 
refs/changes/78/85678/1

diff --git a/ContributionScores.i18n.php b/ContributionScores.i18n.php
index 9a77b78..ca30998 100644
--- a/ContributionScores.i18n.php
+++ b/ContributionScores.i18n.php
@@ -16,6 +16,7 @@
        '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 @@
 * {{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}}
diff --git a/ContributionScores_body.php b/ContributionScores_body.php
index 5a9151a..e736901 100644
--- a/ContributionScores_body.php
+++ b/ContributionScores_body.php
@@ -92,12 +92,14 @@
 
                $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 @@
                        }
 
                        $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 @@
                        } else {
                                $altrow = '';
                        }
+                       
+                       $user_rank++;
                }
                $output .= Html::closeElement( 'tr' );
                $output .= Html::closeElement( 'table' );

-- 
To view, visit https://gerrit.wikimedia.org/r/85678
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: If4da3aedb2a472150a93385bf2d349d16812603d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ContributionScores
Gerrit-Branch: master
Gerrit-Owner: Mattsmith321 <m...@smitty.net>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to