From b003197ddb53f6e257f603006658f5489fa7c273 Mon Sep 17 00:00:00 2001 From: Tim Laqua Date: Mon, 14 Apr 2008 17:22:51 +0000 Subject: [PATCH] * 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 --- ContributionScores.css | 7 ------- ContributionScores.php | 5 ++++- ContributionScores_body.php | 29 +++++++++++++++-------------- 3 files changed, 19 insertions(+), 22 deletions(-) delete mode 100644 ContributionScores.css diff --git a/ContributionScores.css b/ContributionScores.css deleted file mode 100644 index 15ac229..0000000 --- a/ContributionScores.css +++ /dev/null @@ -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; } diff --git a/ContributionScores.php b/ContributionScores.php index 4c3cd7c..d82fada 100644 --- a/ContributionScores.php +++ b/ContributionScores.php @@ -15,7 +15,7 @@ $wgExtensionCredits['specialpage'][] = array( 'author'=>'Tim Laqua', 'description'=>'Polls wiki database for highest user contribution volume', 'descriptionmsg' => 'contributionscores-desc', - 'version'=>'1.7.1' + 'version'=>'1.8' ); 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) { $out->addScript( '' . "\n" ); return true; } +*/ diff --git a/ContributionScores_body.php b/ContributionScores_body.php index fa0b02f..3776077 100644 --- a/ContributionScores_body.php +++ b/ContributionScores_body.php @@ -90,20 +90,20 @@ class ContributionScores extends IncludableSpecialPage $sortable = in_array('nosort', $opts) ? '' : ' sortable'; - $output = "\n". - "\n". - "\n" . - "\n" . - "\n" . - "\n"; + $output = "
" . wfMsgHtml( 'contributionscores-score' ) . "" . wfMsgHtml( 'contributionscores-pages' ) . "" . wfMsgHtml( 'contributionscores-changes' ) . "" . wfMsgHtml( 'contributionscores-username' ) . "
\n". + "\n". + "\n" . + "\n" . + "\n" . + "\n"; $skin =& $wgUser->getSkin(); $altrow = ''; while ( $row = $dbr->fetchObject( $res ) ) { - $output .= "\n\n\n"; - - if ($altrow == '') - $altrow = 'contributionscores-altrow '; + + if ( $altrow == '' && !empty($sortable) ) + $altrow = 'odd '; else $altrow = ''; } @@ -136,7 +136,8 @@ class ContributionScores extends IncludableSpecialPage function execute( $par ) { 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', '>=' ) ) wfLoadExtensionMessages( 'ContributionScores' );
" . wfMsgHtml( 'contributionscores-score' ) . "" . wfMsgHtml( 'contributionscores-pages' ) . "" . wfMsgHtml( 'contributionscores-changes' ) . "" . wfMsgHtml( 'contributionscores-username' ) . "
" . - round($row->wiki_rank,0) . "\n" . - $row->page_count . "\n" . - $row->rev_count . "\n" . + $output .= "
" . + round($row->wiki_rank,0) . "\n" . + $row->page_count . "\n" . + $row->rev_count . "\n" . $skin->userLink( $row->user_id, $row->user_name ); # Option to not display user tools @@ -111,9 +111,9 @@ class ContributionScores extends IncludableSpecialPage $output .= $skin->userToolLinks( $row->user_id, $row->user_name ); $output .= "