Index: trunk/extensions/Contributionseditcount/Contributionseditcount.php |
— | — | @@ -8,44 +8,29 @@ |
9 | 9 | * @bug 1725 |
10 | 10 | * |
11 | 11 | * @author Ævar Arnfjörð Bjarmason <avarab@gmail.com> |
| 12 | + * @author Chad Horohoe <chad@anyonecanedit.org> |
12 | 13 | * @copyright Copyright © 2005, Ævar Arnfjörð Bjarmason |
13 | 14 | * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later |
14 | 15 | */ |
15 | 16 | |
16 | | -$wgExtensionFunctions[] = 'wfContributionseditcount'; |
17 | 17 | $wgExtensionCredits['other'][] = array( |
18 | 18 | 'path' => __FILE__, |
19 | 19 | 'name' => 'Contributionseditcount', |
20 | 20 | 'description' => 'Displays an edit count on Special:Contributions', |
21 | 21 | 'descriptionmsg' => 'contributionseditcount-desc', |
22 | | - 'author' => 'Ævar Arnfjörð Bjarmason', |
| 22 | + 'author' => array( 'Ævar Arnfjörð Bjarmason', 'Chad Horohoe' ), |
23 | 23 | 'url' => 'http://www.mediawiki.org/wiki/Extension:Contributionseditcount', |
24 | 24 | ); |
25 | | - |
26 | 25 | $wgExtensionMessagesFiles['Contributionseditcount'] = dirname( __FILE__ ) . '/Contributionseditcount.i18n.php'; |
| 26 | +$wgHooks['SpecialContributionsBeforeMainOutput'][] = 'wfContributionseditcount'; |
27 | 27 | |
28 | | -function wfContributionseditcount() { |
29 | | - |
30 | | - wfUsePHP( 5.0 ); |
31 | | - wfUseMW( '1.6alpha' ); |
32 | | - |
33 | | - class Contributionseditcount { |
34 | | - |
35 | | - public function __construct() { |
36 | | - global $wgHooks; |
37 | | - $wgHooks['SpecialContributionsBeforeMainOutput'][] = array( &$this, 'hook' ); |
38 | | - } |
39 | | - |
40 | | - public function hook( $uid ) { |
41 | | - global $wgOut, $wgLang; |
42 | | - if ( $uid != 0 ) |
43 | | - wfLoadExtensionMessages( 'Contributionseditcount' ); |
44 | | - $wgOut->addWikiText( wfMsgExt( 'contributionseditcount', array(), |
| 28 | +function wfContributionseditcount( $uid ) { |
| 29 | + if ( $uid != 0 ) |
| 30 | + global $wgOut, $wgLang; |
| 31 | + wfLoadExtensionMessages( 'Contributionseditcount' ); |
| 32 | + $wgOut->addWikiText( wfMsgExt( 'contributionseditcount', array( 'parsemag' ), |
45 | 33 | $wgLang->formatNum( User::edits( $uid ) ), |
46 | 34 | User::whoIs( $uid ) ) ); |
47 | | - return true; |
48 | | - } |
| 35 | + return true; |
49 | 36 | } |
50 | | - |
51 | | - new Contributionseditcount(); |
52 | 37 | } |