* v1.8
* Removed most custom CSS classes * Now uses .even and .odd CSS classes from sortable JS voodoo when the sortable class is present * Removed .css file - instead force custom definition in MediaWiki:Common.css
This commit is contained in:
parent
09904dbc02
commit
b003197ddb
3 changed files with 19 additions and 22 deletions
|
@ -1,7 +0,0 @@
|
||||||
/* ContributionScores.css */
|
|
||||||
.contributionscores-wrapper { }
|
|
||||||
.contributionscores-title { background-color: #aaaaaa; margin-bottom: 0px; padding-left: .4em; }
|
|
||||||
.contributionscores-tableheadings { background-color: #cccccc; border-bottom: 1px solid #999999; }
|
|
||||||
.contributionscores-altrow { background-color: #eeeeee; }
|
|
||||||
.contributionscores-headercell { font-weight: bold; padding-left: .2em; padding-right: .2em; }
|
|
||||||
.contributionscores-contentcell { padding-left: .2em; padding-right: .2em; }
|
|
|
@ -15,7 +15,7 @@ $wgExtensionCredits['specialpage'][] = array(
|
||||||
'author'=>'Tim Laqua',
|
'author'=>'Tim Laqua',
|
||||||
'description'=>'Polls wiki database for highest user contribution volume',
|
'description'=>'Polls wiki database for highest user contribution volume',
|
||||||
'descriptionmsg' => 'contributionscores-desc',
|
'descriptionmsg' => 'contributionscores-desc',
|
||||||
'version'=>'1.7.1'
|
'version'=>'1.8'
|
||||||
);
|
);
|
||||||
|
|
||||||
define( 'CONTRIBUTIONSCORES_PATH', dirname( __FILE__ ) );
|
define( 'CONTRIBUTIONSCORES_PATH', dirname( __FILE__ ) );
|
||||||
|
@ -43,7 +43,10 @@ function efContributionScores() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Depreciated in v1.8 - manually add CSS via MediaWiki:Common.css
|
||||||
|
/*
|
||||||
function efContributionScores_addHeadScripts(&$out) {
|
function efContributionScores_addHeadScripts(&$out) {
|
||||||
$out->addScript( '<link rel="stylesheet" type="text/css" href="' . CONTRIBUTIONSCORES_EXTPATH . '/ContributionScores.css" />' . "\n" );
|
$out->addScript( '<link rel="stylesheet" type="text/css" href="' . CONTRIBUTIONSCORES_EXTPATH . '/ContributionScores.css" />' . "\n" );
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
|
@ -90,20 +90,20 @@ class ContributionScores extends IncludableSpecialPage
|
||||||
|
|
||||||
$sortable = in_array('nosort', $opts) ? '' : ' sortable';
|
$sortable = in_array('nosort', $opts) ? '' : ' sortable';
|
||||||
|
|
||||||
$output = "<table class=\"wikitable plainlinks{$sortable}\" >\n".
|
$output = "<table class=\"wikitable contributionscores plainlinks{$sortable}\" >\n".
|
||||||
"<tr class='contributionscores-tableheadings'>\n".
|
"<tr class='header'>\n".
|
||||||
"<td class=\"contributionscores-headercell\">" . wfMsgHtml( 'contributionscores-score' ) . "</td>\n" .
|
"<td>" . wfMsgHtml( 'contributionscores-score' ) . "</td>\n" .
|
||||||
"<td class=\"contributionscores-headercell\">" . wfMsgHtml( 'contributionscores-pages' ) . "</td>\n" .
|
"<td>" . wfMsgHtml( 'contributionscores-pages' ) . "</td>\n" .
|
||||||
"<td class=\"contributionscores-headercell\">" . wfMsgHtml( 'contributionscores-changes' ) . "</td>\n" .
|
"<td>" . wfMsgHtml( 'contributionscores-changes' ) . "</td>\n" .
|
||||||
"<td class=\"contributionscores-headercell\">" . wfMsgHtml( 'contributionscores-username' ) . "</td>\n";
|
"<td>" . wfMsgHtml( 'contributionscores-username' ) . "</td>\n";
|
||||||
|
|
||||||
$skin =& $wgUser->getSkin();
|
$skin =& $wgUser->getSkin();
|
||||||
$altrow = '';
|
$altrow = '';
|
||||||
while ( $row = $dbr->fetchObject( $res ) ) {
|
while ( $row = $dbr->fetchObject( $res ) ) {
|
||||||
$output .= "</tr><tr class='{$altrow}'>\n<td class='contributionscores-contentcell'>" .
|
$output .= "</tr><tr class='{$altrow}'>\n<td class='content'>" .
|
||||||
round($row->wiki_rank,0) . "\n</td><td class='contributionscores-contentcell'>" .
|
round($row->wiki_rank,0) . "\n</td><td class='content'>" .
|
||||||
$row->page_count . "\n</td><td class='contributionscores-contentcell'>" .
|
$row->page_count . "\n</td><td class='content'>" .
|
||||||
$row->rev_count . "\n</td><td class='contributionscores-contentcell'>" .
|
$row->rev_count . "\n</td><td class='content'>" .
|
||||||
$skin->userLink( $row->user_id, $row->user_name );
|
$skin->userLink( $row->user_id, $row->user_name );
|
||||||
|
|
||||||
# Option to not display user tools
|
# Option to not display user tools
|
||||||
|
@ -111,9 +111,9 @@ class ContributionScores extends IncludableSpecialPage
|
||||||
$output .= $skin->userToolLinks( $row->user_id, $row->user_name );
|
$output .= $skin->userToolLinks( $row->user_id, $row->user_name );
|
||||||
|
|
||||||
$output .= "</td>\n";
|
$output .= "</td>\n";
|
||||||
|
|
||||||
if ($altrow == '')
|
if ( $altrow == '' && !empty($sortable) )
|
||||||
$altrow = 'contributionscores-altrow ';
|
$altrow = 'odd ';
|
||||||
else
|
else
|
||||||
$altrow = '';
|
$altrow = '';
|
||||||
}
|
}
|
||||||
|
@ -136,7 +136,8 @@ class ContributionScores extends IncludableSpecialPage
|
||||||
function execute( $par ) {
|
function execute( $par ) {
|
||||||
global $wgRequest, $wgVersion, $wgOut, $wgHooks;
|
global $wgRequest, $wgVersion, $wgOut, $wgHooks;
|
||||||
|
|
||||||
$wgHooks['BeforePageDisplay'][] = 'efContributionScores_addHeadScripts';
|
# Depreciated - manually set styles in MediaWiki:Common.css
|
||||||
|
# $wgHooks['BeforePageDisplay'][] = 'efContributionScores_addHeadScripts';
|
||||||
|
|
||||||
if( version_compare( $wgVersion, '1.11', '>=' ) )
|
if( version_compare( $wgVersion, '1.11', '>=' ) )
|
||||||
wfLoadExtensionMessages( 'ContributionScores' );
|
wfLoadExtensionMessages( 'ContributionScores' );
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue