Compare commits
60 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
486fa570d9 | ||
|
|
f080c3ce10 | ||
|
|
3031f91dbc | ||
|
|
1ca172c6e0 | ||
|
|
4c860f6bef | ||
|
|
7354e142d2 | ||
|
|
8671afa6e4 | ||
|
|
9ecfb20fda | ||
|
|
3a318b2213 | ||
|
|
e9d41f2802 | ||
|
|
b36c1ce02c | ||
|
|
b96a33abc1 | ||
|
|
7a6ffab525 | ||
|
|
84f4a7ef4e | ||
|
|
3b23c3280c | ||
|
|
31cb5396c0 | ||
|
|
202862f94c | ||
|
|
bae10087f1 | ||
|
|
4a0c79e7be | ||
|
|
c66d73fab1 | ||
|
|
0ad366000a | ||
|
|
339165a1ea | ||
|
|
264ef3edaf | ||
|
|
0eb05feefb | ||
|
|
1490eb27d8 | ||
|
|
54f6bca0d9 | ||
|
|
a02eed03d7 | ||
|
|
08ae0e8c9c | ||
|
|
a907e0d520 | ||
|
|
3d4fd708bb | ||
|
|
4bceabbff7 | ||
|
|
1220679e98 | ||
|
|
57e90d522b | ||
|
|
de8a6e2b80 | ||
|
|
6eecf33f62 | ||
|
|
9b2b44dfae | ||
|
|
6491b540d0 | ||
|
|
f27d216db4 | ||
|
|
0015d679a2 | ||
|
|
c4fe3f1299 | ||
|
|
a9f3501885 | ||
|
|
48de9ffb9c | ||
|
|
1596f72632 | ||
|
|
0ce5c7301a | ||
|
|
602c9f64e6 | ||
|
|
597009e391 | ||
|
|
563437b6d4 | ||
|
|
d12a4b515f | ||
|
|
ff0afca339 | ||
|
|
39aaed456c | ||
|
|
49ee65dd4d | ||
|
|
b1cf5cd2d8 | ||
|
|
229cd30f65 | ||
|
|
a15633c951 | ||
|
|
87a139a76c | ||
|
|
f700b733a2 | ||
|
|
00e5d65eac | ||
|
|
9643d293b4 | ||
|
|
d8e87e1a08 | ||
|
|
da2586fde8 |
5
.gitignore
vendored
Normal file
5
.gitignore
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
.svn
|
||||
*~
|
||||
*.kate-swp
|
||||
.*.swp
|
||||
.idea
|
||||
6
.gitreview
Normal file
6
.gitreview
Normal file
@@ -0,0 +1,6 @@
|
||||
[gerrit]
|
||||
host=gerrit.wikimedia.org
|
||||
port=29418
|
||||
project=mediawiki/extensions/ContributionScores
|
||||
defaultbranch=master
|
||||
defaultrebase=0
|
||||
@@ -23,12 +23,27 @@ $specialPageAliases['arz'] = array(
|
||||
'ContributionScores' => array( 'نتايج_المساهمه' ),
|
||||
);
|
||||
|
||||
/** Breton (Brezhoneg) */
|
||||
/** Assamese (অসমীয়া) */
|
||||
$specialPageAliases['as'] = array(
|
||||
'ContributionScores' => array( 'বৰঙনিৰ_মূল্যায়ন' ),
|
||||
);
|
||||
|
||||
/** Bashkir (башҡортса) */
|
||||
$specialPageAliases['ba'] = array(
|
||||
'ContributionScores' => array( 'Өлөш_мәрәйҙәре' ),
|
||||
);
|
||||
|
||||
/** Banjar (Bahasa Banjar) */
|
||||
$specialPageAliases['bjn'] = array(
|
||||
'ContributionScores' => array( 'Skor_sumbangan' ),
|
||||
);
|
||||
|
||||
/** Breton (brezhoneg) */
|
||||
$specialPageAliases['br'] = array(
|
||||
'ContributionScores' => array( 'Skor_Degasadennoù' ),
|
||||
);
|
||||
|
||||
/** Bosnian (Bosanski) */
|
||||
/** Bosnian (bosanski) */
|
||||
$specialPageAliases['bs'] = array(
|
||||
'ContributionScores' => array( 'DoprinosiBodovi' ),
|
||||
);
|
||||
@@ -38,12 +53,17 @@ $specialPageAliases['de'] = array(
|
||||
'ContributionScores' => array( 'Beitragspunkte' ),
|
||||
);
|
||||
|
||||
/** Zazaki (Zazaki) */
|
||||
$specialPageAliases['diq'] = array(
|
||||
'ContributionScores' => array( 'Skorêİştiraxan' ),
|
||||
);
|
||||
|
||||
/** Esperanto (Esperanto) */
|
||||
$specialPageAliases['eo'] = array(
|
||||
'ContributionScores' => array( 'Kontribuatingoj' ),
|
||||
);
|
||||
|
||||
/** Estonian (Eesti) */
|
||||
/** Estonian (eesti) */
|
||||
$specialPageAliases['et'] = array(
|
||||
'ContributionScores' => array( 'Kaastööpunktid' ),
|
||||
);
|
||||
@@ -53,12 +73,12 @@ $specialPageAliases['fa'] = array(
|
||||
'ContributionScores' => array( 'امتیازهای_مشارکت' ),
|
||||
);
|
||||
|
||||
/** Finnish (Suomi) */
|
||||
/** Finnish (suomi) */
|
||||
$specialPageAliases['fi'] = array(
|
||||
'ContributionScores' => array( 'Muokkauspisteet' ),
|
||||
);
|
||||
|
||||
/** Galician (Galego) */
|
||||
/** Galician (galego) */
|
||||
$specialPageAliases['gl'] = array(
|
||||
'ContributionScores' => array( 'Puntuación_das_contribucións' ),
|
||||
);
|
||||
@@ -73,12 +93,12 @@ $specialPageAliases['ht'] = array(
|
||||
'ContributionScores' => array( 'PwentajKontribisyon' ),
|
||||
);
|
||||
|
||||
/** Hungarian (Magyar) */
|
||||
/** Hungarian (magyar) */
|
||||
$specialPageAliases['hu'] = array(
|
||||
'ContributionScores' => array( 'Szerkesztési_pontok' ),
|
||||
);
|
||||
|
||||
/** Interlingua (Interlingua) */
|
||||
/** Interlingua (interlingua) */
|
||||
$specialPageAliases['ia'] = array(
|
||||
'ContributionScores' => array( 'Scores_de_contributiones' ),
|
||||
);
|
||||
@@ -98,6 +118,11 @@ $specialPageAliases['km'] = array(
|
||||
'ContributionScores' => array( 'ពិន្ទុអ្នករួមចំណែក' ),
|
||||
);
|
||||
|
||||
/** Korean (한국어) */
|
||||
$specialPageAliases['ko'] = array(
|
||||
'ContributionScores' => array( '기여점수' ),
|
||||
);
|
||||
|
||||
/** Colognian (Ripoarisch) */
|
||||
$specialPageAliases['ksh'] = array(
|
||||
'ContributionScores' => array( 'MetmaacherZahle' ),
|
||||
@@ -113,7 +138,7 @@ $specialPageAliases['lb'] = array(
|
||||
'ContributionScores' => array( 'Score_vun_de_Kontributiounen' ),
|
||||
);
|
||||
|
||||
/** Macedonian (Македонски) */
|
||||
/** Macedonian (македонски) */
|
||||
$specialPageAliases['mk'] = array(
|
||||
'ContributionScores' => array( 'БодувањеНаПридонесите' ),
|
||||
);
|
||||
@@ -128,7 +153,7 @@ $specialPageAliases['mr'] = array(
|
||||
'ContributionScores' => array( 'योगदानप्राविण्य' ),
|
||||
);
|
||||
|
||||
/** Norwegian Bokmål (Norsk (bokmål)) */
|
||||
/** Norwegian Bokmål (norsk (bokmål)) */
|
||||
$specialPageAliases['nb'] = array(
|
||||
'ContributionScores' => array( 'Bidragspoeng' ),
|
||||
);
|
||||
@@ -143,22 +168,27 @@ $specialPageAliases['nl'] = array(
|
||||
'ContributionScores' => array( 'Gebruikersscores', 'Bijdragenscores' ),
|
||||
);
|
||||
|
||||
/** Polish (Polski) */
|
||||
/** Polish (polski) */
|
||||
$specialPageAliases['pl'] = array(
|
||||
'ContributionScores' => array( 'Punkty_za_edycje' ),
|
||||
);
|
||||
|
||||
/** Russian (русский) */
|
||||
$specialPageAliases['ru'] = array(
|
||||
'ContributionScores' => array( 'Очки_вклада' ),
|
||||
);
|
||||
|
||||
/** Sanskrit (संस्कृतम्) */
|
||||
$specialPageAliases['sa'] = array(
|
||||
'ContributionScores' => array( 'योगदानप्राप्ताङ्क' ),
|
||||
);
|
||||
|
||||
/** Slovak (Slovenčina) */
|
||||
/** Slovak (slovenčina) */
|
||||
$specialPageAliases['sk'] = array(
|
||||
'ContributionScores' => array( 'SkórePríspevkov' ),
|
||||
);
|
||||
|
||||
/** Swedish (Svenska) */
|
||||
/** Swedish (svenska) */
|
||||
$specialPageAliases['sv'] = array(
|
||||
'ContributionScores' => array( 'Bidragspoäng' ),
|
||||
);
|
||||
@@ -170,7 +200,7 @@ $specialPageAliases['th'] = array(
|
||||
|
||||
/** Tagalog (Tagalog) */
|
||||
$specialPageAliases['tl'] = array(
|
||||
'ContributionScores' => array( 'Mga puntos ng ambag' ),
|
||||
'ContributionScores' => array( 'Mga_puntos_ng_ambag' ),
|
||||
);
|
||||
|
||||
/** Turkish (Türkçe) */
|
||||
@@ -178,12 +208,12 @@ $specialPageAliases['tr'] = array(
|
||||
'ContributionScores' => array( 'KatkıSkorları', 'KatkıPuanları' ),
|
||||
);
|
||||
|
||||
/** Simplified Chinese (中文(简体)) */
|
||||
/** Simplified Chinese (中文(简体)) */
|
||||
$specialPageAliases['zh-hans'] = array(
|
||||
'ContributionScores' => array( '贡献得分' ),
|
||||
);
|
||||
|
||||
/** Traditional Chinese (中文(繁體)) */
|
||||
/** Traditional Chinese (中文(繁體)) */
|
||||
$specialPageAliases['zh-hant'] = array(
|
||||
'ContributionScores' => array( '貢獻得分' ),
|
||||
);
|
||||
File diff suppressed because it is too large
Load Diff
@@ -15,7 +15,7 @@ $wgExtensionCredits['specialpage'][] = array(
|
||||
'url' => 'https://www.mediawiki.org/wiki/Extension:Contribution_Scores',
|
||||
'author' => 'Tim Laqua',
|
||||
'descriptionmsg' => 'contributionscores-desc',
|
||||
'version' => '1.15'
|
||||
'version' => '1.16'
|
||||
);
|
||||
|
||||
$dir = dirname( __FILE__ ) . '/';
|
||||
@@ -77,10 +77,10 @@ function efContributionScores_Render( &$parser, $usertext, $metric = 'score' ) {
|
||||
$row = $dbr->fetchObject( $res );
|
||||
$output = $wgLang->formatNum( $row->page_count );
|
||||
} else {
|
||||
$output = wfMsg( 'contributionscores-invalidmetric' );
|
||||
$output = wfMessage( 'contributionscores-invalidmetric' )->text();
|
||||
}
|
||||
} else {
|
||||
$output = wfMsg( 'contributionscores-invalidusername' );
|
||||
$output = wfMessage( 'contributionscores-invalidusername' )->text();
|
||||
}
|
||||
|
||||
return $parser->insertStripItem( $output, $parser->mStripState );
|
||||
|
||||
@@ -23,11 +23,12 @@ class ContributionScores extends IncludableSpecialPage {
|
||||
*
|
||||
* @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.
|
||||
* @param $title Title (default null)
|
||||
* @param $options array of options (default none; nosort/notools)
|
||||
* @return Html Table representing the requested Contribution Scores.
|
||||
*/
|
||||
function genContributionScoreTable( $days, $limit, $title = null, $options = 'none' ) {
|
||||
global $wgContribScoreIgnoreBots, $wgContribScoreIgnoreBlockedUsers, $wgContribScoresUseRealName, $wgLang;
|
||||
global $wgContribScoreIgnoreBots, $wgContribScoreIgnoreBlockedUsers, $wgContribScoresUseRealName;
|
||||
|
||||
$opts = explode( ',', strtolower( $options ) );
|
||||
|
||||
@@ -55,7 +56,6 @@ class ContributionScores extends IncludableSpecialPage {
|
||||
|
||||
if ( $wgContribScoreIgnoreBots ) {
|
||||
$sqlWhere .= " {$nextPrefix} rev_user NOT IN (SELECT ug_user FROM {$userGroupTable} WHERE ug_group='bot')";
|
||||
$nextPrefix = "AND";
|
||||
}
|
||||
|
||||
$sqlMostPages = "SELECT rev_user,
|
||||
@@ -92,13 +92,14 @@ class ContributionScores extends IncludableSpecialPage {
|
||||
|
||||
$output = "<table class=\"wikitable contributionscores plainlinks{$sortable}\" >\n" .
|
||||
"<tr class='header'>\n" .
|
||||
Html::element( 'th', array(), wfMsg( 'contributionscores-score' ) ) .
|
||||
Html::element( 'th', array(), wfMsg( 'contributionscores-pages' ) ) .
|
||||
Html::element( 'th', array(), wfMsg( 'contributionscores-changes' ) ) .
|
||||
Html::element( 'th', array(), wfMsg( 'contributionscores-username' ) );
|
||||
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 = '';
|
||||
|
||||
$lang = $this->getLanguage();
|
||||
foreach ( $res as $row ) {
|
||||
// Use real name if option used and real name present.
|
||||
if ( $wgContribScoresUseRealName && $row->user_real_name !== '' ) {
|
||||
@@ -116,9 +117,9 @@ class ContributionScores extends IncludableSpecialPage {
|
||||
|
||||
$output .= Html::closeElement( 'tr' );
|
||||
$output .= "<tr class='{$altrow}'>\n<td class='content'>" .
|
||||
$wgLang->formatNum( round( $row->wiki_rank, 0 ) ) . "\n</td><td class='content'>" .
|
||||
$wgLang->formatNum( $row->page_count ) . "\n</td><td class='content'>" .
|
||||
$wgLang->formatNum( $row->rev_count ) . "\n</td><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'>" .
|
||||
$lang->formatNum( $row->rev_count ) . "\n</td><td class='content'>" .
|
||||
$userLink;
|
||||
|
||||
# Option to not display user tools
|
||||
@@ -140,15 +141,21 @@ class ContributionScores extends IncludableSpecialPage {
|
||||
$dbr->freeResult( $res );
|
||||
|
||||
if ( !empty( $title ) )
|
||||
$output = Html::rawElement( 'table', array( 'cellspacing' => 0, 'cellpadding' => 0,
|
||||
'class' => 'contributionscores-wrapper', 'lang' => $wgLang->getCode(), 'dir' => $wgLang->getDir() ),
|
||||
"\n" .
|
||||
"<tr>\n" .
|
||||
"<td style='padding: 0px;'>{$title}</td>\n" .
|
||||
"</tr>\n" .
|
||||
"<tr>\n" .
|
||||
"<td style='padding: 0px;'>{$output}</td>\n" .
|
||||
"</tr>\n" );
|
||||
$output = Html::rawElement( 'table',
|
||||
array(
|
||||
'style' => 'border-spacing: 0; padding: 0',
|
||||
'class' => 'contributionscores-wrapper',
|
||||
'lang' => htmlspecialchars( $lang->getCode()),
|
||||
'dir' => $lang->getDir()
|
||||
),
|
||||
"\n" .
|
||||
"<tr>\n" .
|
||||
"<td style='padding: 0px;'>{$title}</td>\n" .
|
||||
"</tr>\n" .
|
||||
"<tr>\n" .
|
||||
"<td style='padding: 0px;'>{$output}</td>\n" .
|
||||
"</tr>\n"
|
||||
);
|
||||
|
||||
return $output;
|
||||
}
|
||||
@@ -171,8 +178,6 @@ class ContributionScores extends IncludableSpecialPage {
|
||||
* @param $par
|
||||
*/
|
||||
function showInclude( $par ) {
|
||||
global $wgOut, $wgLang;
|
||||
|
||||
$days = null;
|
||||
$limit = null;
|
||||
$options = 'none';
|
||||
@@ -199,20 +204,20 @@ class ContributionScores extends IncludableSpecialPage {
|
||||
}
|
||||
|
||||
if ( $days > 0 ) {
|
||||
$reportTitle = wfMsgExt( 'contributionscores-days', 'parsemag', $wgLang->formatNum( $days ) );
|
||||
$reportTitle = $this->msg( 'contributionscores-days' )->numParams( $days )->text();
|
||||
} else {
|
||||
$reportTitle = wfMsg( 'contributionscores-allrevisions' );
|
||||
$reportTitle = $this->msg( 'contributionscores-allrevisions' )->text();
|
||||
}
|
||||
$reportTitle .= " " . wfMsgExt( 'contributionscores-top', 'parsemag', $wgLang->formatNum( $limit ) );
|
||||
$reportTitle .= " " . $this->msg( 'contributionscores-top' )->numParams( $limit )->text();
|
||||
$title = Xml::element( 'h4', array( 'class' => 'contributionscores-title' ), $reportTitle ) . "\n";
|
||||
$wgOut->addHTML( $this->genContributionScoreTable( $days, $limit, $title, $options ) );
|
||||
$this->getOutput()->addHTML( $this->genContributionScoreTable( $days, $limit, $title, $options ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the special page
|
||||
*/
|
||||
function showPage() {
|
||||
global $wgOut, $wgLang, $wgContribScoreReports;
|
||||
global $wgContribScoreReports;
|
||||
|
||||
if ( !is_array( $wgContribScoreReports ) ) {
|
||||
$wgContribScoreReports = array(
|
||||
@@ -222,19 +227,20 @@ class ContributionScores extends IncludableSpecialPage {
|
||||
);
|
||||
}
|
||||
|
||||
$wgOut->addWikiMsg( 'contributionscores-info' );
|
||||
$out = $this->getOutput();
|
||||
$out->addWikiMsg( 'contributionscores-info' );
|
||||
|
||||
foreach ( $wgContribScoreReports as $scoreReport ) {
|
||||
list( $days, $revs ) = $scoreReport;
|
||||
if ( $days > 0 ) {
|
||||
$reportTitle = wfMsgExt( 'contributionscores-days', 'parsemag', $wgLang->formatNum( $days ) );
|
||||
$reportTitle = $this->msg( 'contributionscores-days' )->numParams( $days )->text();
|
||||
} else {
|
||||
$reportTitle = wfMsg( 'contributionscores-allrevisions' );
|
||||
$reportTitle = $this->msg( 'contributionscores-allrevisions' )->text();
|
||||
}
|
||||
$reportTitle .= " " . wfMsgExt( 'contributionscores-top', 'parsemag', $wgLang->formatNum( $revs ) );
|
||||
$reportTitle .= " " . $this->msg( 'contributionscores-top' )->numParams( $revs )->text();
|
||||
$title = Xml::element( 'h2', array( 'class' => 'contributionscores-title' ), $reportTitle ) . "\n";
|
||||
$wgOut->addHTML( $title );
|
||||
$wgOut->addHTML( $this->genContributionScoreTable( $days, $revs ) );
|
||||
$out->addHTML( $title );
|
||||
$out->addHTML( $this->genContributionScoreTable( $days, $revs ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user