Index: trunk/extensions/RelationLinks/RelationLinks.php |
— | — | @@ -28,7 +28,6 @@ |
29 | 29 | $wgHooks['BeforePageDisplay'][] = 'addRelationLinks'; |
30 | 30 | |
31 | 31 | function addRelationLinks( &$out, &$sk ) { |
32 | | - global $wgArticlePath; |
33 | 32 | $rlMainpage = Title::newFromText(wfMsg('Mainpage')); |
34 | 33 | $out->addLink( array( |
35 | 34 | 'rel' => 'start', |
Index: trunk/extensions/FormatNum/FormatNum.php |
— | — | @@ -4,21 +4,21 @@ |
5 | 5 | */ |
6 | 6 | // Check environment |
7 | 7 | if ( !defined( 'MEDIAWIKI' ) ) { |
8 | | - echo( "This is an extension to the MediaWiki package and cannot be run standalone.\n" ); |
9 | | - die( -1 ); |
| 8 | + echo( "This is an extension to the MediaWiki package and cannot be run standalone.\n" ); |
| 9 | + die( -1 ); |
10 | 10 | } |
11 | 11 | |
12 | 12 | /* Configuration */ |
13 | 13 | |
14 | 14 | // Credits |
15 | 15 | $wgExtensionCredits['parserhook'][] = array ( |
16 | | - 'path'=> __FILE__ , |
17 | | - 'name'=>'FormatNum', |
18 | | - 'url'=>'http://www.mediawiki.org/wiki/Extension:FormatNum', |
19 | | - 'description'=>'Passes formatnum to php number_format', |
20 | | - 'descriptionmsg' => 'formatnum-desc', |
21 | | - 'author'=>'[http://www.dasch-tour.de DaSch]', |
22 | | - 'version'=>'0.1.1', |
| 16 | + 'path'=> __FILE__ , |
| 17 | + 'name'=>'FormatNum', |
| 18 | + 'url'=>'http://www.mediawiki.org/wiki/Extension:FormatNum', |
| 19 | + 'description'=>'Passes formatnum to php number_format', |
| 20 | + 'descriptionmsg' => 'formatnum-desc', |
| 21 | + 'author'=>'[http://www.dasch-tour.de DaSch]', |
| 22 | + 'version'=>'0.2.0', |
23 | 23 | ); |
24 | 24 | $dir = dirname( __FILE__ ) . '/'; |
25 | 25 | |
— | — | @@ -31,9 +31,9 @@ |
32 | 32 | $wgHooks['LanguageGetMagic'][] = 'efFormatNumParserFunction_Magic'; |
33 | 33 | |
34 | 34 | function efFormatNumParserFunction_Setup( $parser ) { |
35 | | - # Set a function hook associating the "example" magic word with our function |
36 | | - $parser->setFunctionHook( 'formatnum', 'efFormatNumParserFunction_Render' ); |
37 | | - return true; |
| 35 | + # Set a function hook associating the "example" magic word with our function |
| 36 | + $parser->setFunctionHook( 'formatnum', 'efFormatNumParserFunction_Render' ); |
| 37 | + return true; |
38 | 38 | } |
39 | 39 | |
40 | 40 | function efFormatNumParserFunction_Magic( &$magicWords, $langCode ) { |
— | — | @@ -49,9 +49,17 @@ |
50 | 50 | # The parser function itself |
51 | 51 | # The input parameters are wikitext with templates expanded |
52 | 52 | # The output should be wikitext too |
53 | | - if ($param4 == '_') { |
54 | | - $param4 = ' '; |
| 53 | + if ($param4 == '_' ){ |
| 54 | + $param4 = ' '; |
55 | 55 | } |
56 | 56 | $output = number_format($param1, $param2, $param3, $param4); |
| 57 | + switch ($param4) { |
| 58 | + case 't': |
| 59 | + $output = str_replace ( 't' , ' ' , $output); |
| 60 | + break; |
| 61 | + case 'n': |
| 62 | + $output = str_replace ( 'n' , ' ' , $output); |
| 63 | + break; |
| 64 | + } |
57 | 65 | return $output; |
58 | 66 | } |
\ No newline at end of file |