Index: trunk/extensions/StalePages/StalePages_body.php |
— | — | @@ -27,6 +27,7 @@ |
28 | 28 | } |
29 | 29 | |
30 | 30 | function execute( $parameters ) { |
| 31 | + global $wgVersion; |
31 | 32 | if( version_compare( $wgVersion, '1.12alpha', '>=' ) ) { |
32 | 33 | wfLoadExtensionMessages( 'Stalepages' ); |
33 | 34 | } |
Index: trunk/extensions/ContributionScores/ContributionScores_body.php |
— | — | @@ -92,9 +92,12 @@ |
93 | 93 | } |
94 | 94 | |
95 | 95 | function execute( $par ) { |
96 | | - global $wgRequest, $wgOut, $contribScoreReports; |
97 | | - wfLoadExtensionMessages( 'ContributionScores' ); |
98 | | - |
| 96 | + global $wgRequest, $wgOut, $contribScoreReports, $wgVersion; |
| 97 | + |
| 98 | + if( version_compare( $wgVersion, '1.12alpha', '>=' ) ) { |
| 99 | + wfLoadExtensionMessages( 'ContributionScores' ); |
| 100 | + } |
| 101 | + |
99 | 102 | $this->setHeaders(); |
100 | 103 | |
101 | 104 | # Get request data from, e.g. |
Index: trunk/extensions/ContributionScores/ContributionScores.php |
— | — | @@ -12,13 +12,28 @@ |
13 | 13 | $wgExtensionCredits['specialpage'][] = array( |
14 | 14 | 'name'=>'Contribution Scores', |
15 | 15 | 'url'=>'http://www.mediawiki.org/wiki/Extension:Contribution_Scores', |
16 | | - 'author'=>'Tim Laqua, Siebrand Mazeland', |
| 16 | + 'author'=>'Tim Laqua', |
17 | 17 | 'description'=>'Polls wiki database for highest user contribution volume', |
18 | 18 | 'version'=>'1.5' |
19 | 19 | ); |
20 | 20 | |
21 | | -$dir = dirname(__FILE__) . '/'; |
22 | | -$wgExtensionMessagesFiles['ContributionScores'] = $dir . 'ContributionScores.i18n.php'; |
23 | 21 | $wgAutoloadClasses['ContributionScores'] = $dir . 'ContributionScores_body.php'; |
| 22 | +$wgSpecialPages['ContributionScores'] = 'ContributionScores'; |
24 | 23 | |
25 | | -$wgSpecialPages['ContributionScores'] = 'ContributionScores'; |
| 24 | +if( version_compare( $wgVersion, '1.12alpha', '>=' ) ) { |
| 25 | + $dir = dirname(__FILE__) . '/'; |
| 26 | + $wgExtensionMessagesFiles['ContributionScores'] = $dir . 'ContributionScores.i18n.php'; |
| 27 | +} else { |
| 28 | + $wgExtensionFunctions[] = 'efContributionScores'; |
| 29 | +} |
| 30 | + |
| 31 | +///Message Cache population for versions that did not support $wgExtensionFunctions |
| 32 | +function efContributionScores() { |
| 33 | + global $wgMessageCache; |
| 34 | + |
| 35 | + #Add Messages |
| 36 | + require( dirname( __FILE__ ) . '/ContributionScores.i18n.php' ); |
| 37 | + foreach( $messages as $key => $value ) { |
| 38 | + $wgMessageCache->addMessages( $messages[$key], $key ); |
| 39 | + } |
| 40 | +} |