Extension:MW-EditCount

The MW-EditCount extension creates a special page where one can view the edit count of a user per namespace. It includes the percent of edits that user made in certain namespace as well as total edits. As of version 1.1.0, it includes a parser function which can inline a users edit count. After the name of the user, in 1.2.0, you can put the number or name of a namespace (0 for Main) and get that EditCount.

Parser function examples
Shows the count of the user Benjamin

in the 4 namespace

in the main namespace

and in the Talk namespace

Installation
This extension is hosted at SourceForge.

Once you download it, and decompress it to the extensions directory. Add the following line to LocalSettings.php (old code uses EditCount instead of mw-editcount):

Compatibility issues
This extension, as supplied, does not work with MediaWiki 1.18 (or later), nor does it work with PHP 5.3 (or later). It is not currently being maintained and the original author is nowhere to be found.

It is possible to modify the code as follows to continue to use the extension on a current MediaWiki installation:
 * MW 1.18+ is broken by the use of $wgMessageCache to add localised messages; this functionality was removed from Mediawiki and replaced with a newer i18n (internationalisation) system. It is possible to disable the lines which use this, but then you will need to create the messages manually.
 * PHP 5.3+ is broken as "Namespace" is now a PHP reserved word; the PHP class created by Mediawiki's includes/Namespace.php has been renamed as "MWNamespace". Change "Namespace::" to "MWNamespace::" wherever it appears (which should be once, a little over two hundred lines down in EditCount.php) and the error should disappear.

Without these modifications, installing this extension will make your wiki inaccessible (HTTP Error 500, PHP Fatal Error in httpd's error_log, zero bytes on every page) until you either remove or patch the extension code.

MW 1.20+ now requires PHP 5.3

MediaWiki versions

 * Unsuccessfully tested in MediaWiki 1.13.4 PHP 5.1.6(apache2handler) MySQL 5.0.22
 * Working in MediaWiki 1.17
 * Broken by the deprecation of $wgMessageCache as of MediaWiki 1.18

To remove the broken $wgMessageCache functionality, disable lines 141 and 145-147 in EditCount.php (shown below with #). Making a few changes to EditCount.i18n.php and EditCount.php will allow the messages to function properly again.

MediaWiki's new format uses $wgExtensionMessagesFiles to call the language files. Add the following below the extension credits on line 51.

Next, edit EditCount.i18n.php and place $messages = array; before the language messages. The only thing you need to do next is replace all instances of $weECMessages with $messages.

There is one other change required under MW 1.19 (and possibly 1.18) on line 171 of EditCount.php, replacing:

with:

Any attempt to deploy MW-EditCount without these modifications under the current versions of MediaWiki will generate 'PHP fatal error' and render the wiki inoperable.

Configuration
Remember: Change these only in your LocalSettings.php!

If you want to help
EditCount needs translators. Feel free to download it and translate it into your native (or non-native) language. Then email the .i18.php file to [mailto:fahadsadah@gmail.com fahadsadah@gmail.com]. See the language table for more information.

Feedback and bugs
To report bugs or give feedback, please leave a message on the |talk page.