2007-12-10 15:01:29 +00:00
|
|
|
<?php
|
2007-08-26 14:39:17 +00:00
|
|
|
/** \file
|
|
|
|
* \brief Contains setup code for the Contribution Scores Extension.
|
|
|
|
*/
|
|
|
|
|
2007-08-22 19:25:22 +00:00
|
|
|
# Not a valid entry point, skip unless MEDIAWIKI is defined
|
|
|
|
if (!defined('MEDIAWIKI')) {
|
2007-11-27 13:38:37 +00:00
|
|
|
echo "Contribution Scores extension";
|
|
|
|
exit(1);
|
2007-08-22 19:25:22 +00:00
|
|
|
}
|
2007-11-27 13:38:37 +00:00
|
|
|
|
2007-08-22 19:25:22 +00:00
|
|
|
$wgExtensionCredits['specialpage'][] = array(
|
2007-11-27 13:38:37 +00:00
|
|
|
'name'=>'Contribution Scores',
|
|
|
|
'url'=>'http://www.mediawiki.org/wiki/Extension:Contribution_Scores',
|
2007-11-27 20:29:24 +00:00
|
|
|
'author'=>'Tim Laqua',
|
2007-11-27 13:38:37 +00:00
|
|
|
'description'=>'Polls wiki database for highest user contribution volume',
|
2008-02-05 14:54:15 +00:00
|
|
|
'descriptionmsg' => 'contributionscores-desc',
|
2007-12-19 17:23:43 +00:00
|
|
|
'version'=>'1.7.1'
|
2007-08-22 19:25:22 +00:00
|
|
|
);
|
2007-11-27 13:38:37 +00:00
|
|
|
|
2007-12-19 01:24:52 +00:00
|
|
|
define( 'CONTRIBUTIONSCORES_PATH', dirname( __FILE__ ) );
|
|
|
|
define( 'CONTRIBUTIONSCORES_EXTPATH', str_replace( $_SERVER['DOCUMENT_ROOT'], '/', CONTRIBUTIONSCORES_PATH ) );
|
|
|
|
define( 'CONTRIBUTIONSCORES_MAXINCLUDELIMIT', 50 );
|
|
|
|
$contribScoreReports = null;
|
|
|
|
|
|
|
|
$wgAutoloadClasses['ContributionScores'] = CONTRIBUTIONSCORES_PATH . '/ContributionScores_body.php';
|
2007-08-22 19:25:22 +00:00
|
|
|
$wgSpecialPages['ContributionScores'] = 'ContributionScores';
|
2007-11-27 20:29:24 +00:00
|
|
|
|
2008-01-04 01:40:33 +00:00
|
|
|
if( version_compare( $wgVersion, '1.11', '>=' ) ) {
|
2007-12-19 01:24:52 +00:00
|
|
|
$wgExtensionMessagesFiles['ContributionScores'] = CONTRIBUTIONSCORES_PATH . '/ContributionScores.i18n.php';
|
2007-11-27 20:29:24 +00:00
|
|
|
} else {
|
|
|
|
$wgExtensionFunctions[] = 'efContributionScores';
|
|
|
|
}
|
|
|
|
|
|
|
|
///Message Cache population for versions that did not support $wgExtensionFunctions
|
|
|
|
function efContributionScores() {
|
2008-01-04 01:40:33 +00:00
|
|
|
global $wgMessageCache;
|
2007-12-16 18:38:50 +00:00
|
|
|
|
2008-01-04 01:40:33 +00:00
|
|
|
#Add Messages
|
|
|
|
require( CONTRIBUTIONSCORES_PATH . '/ContributionScores.i18n.php' );
|
|
|
|
foreach( $messages as $key => $value ) {
|
|
|
|
$wgMessageCache->addMessages( $messages[$key], $key );
|
2007-12-19 01:24:52 +00:00
|
|
|
}
|
2008-01-04 01:40:33 +00:00
|
|
|
}
|
2007-12-19 01:24:52 +00:00
|
|
|
|
|
|
|
function efContributionScores_addHeadScripts(&$out) {
|
|
|
|
$out->addScript( '<link rel="stylesheet" type="text/css" href="' . CONTRIBUTIONSCORES_EXTPATH . '/ContributionScores.css" />' . "\n" );
|
|
|
|
return true;
|
|
|
|
}
|