mediawiki-extensions-Contri.../ContributionScores.php

50 lines
1.7 KiB
PHP
Raw Normal View History

2007-12-10 15:01:29 +00:00
<?php
/** \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')) {
echo "Contribution Scores extension";
exit(1);
2007-08-22 19:25:22 +00:00
}
2007-08-22 19:25:22 +00:00
$wgExtensionCredits['specialpage'][] = array(
'name'=>'Contribution Scores',
'url'=>'http://www.mediawiki.org/wiki/Extension:Contribution_Scores',
'author'=>'Tim Laqua',
'description'=>'Polls wiki database for highest user contribution volume',
'descriptionmsg' => 'contributionscores-desc',
'version'=>'1.7.1'
2007-08-22 19:25:22 +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';
2008-01-04 01:40:33 +00:00
if( version_compare( $wgVersion, '1.11', '>=' ) ) {
$wgExtensionMessagesFiles['ContributionScores'] = CONTRIBUTIONSCORES_PATH . '/ContributionScores.i18n.php';
} 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;
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 );
}
2008-01-04 01:40:33 +00:00
}
function efContributionScores_addHeadScripts(&$out) {
$out->addScript( '<link rel="stylesheet" type="text/css" href="' . CONTRIBUTIONSCORES_EXTPATH . '/ContributionScores.css" />' . "\n" );
return true;
}