Jump to content

Extension:MW-EditCount: Difference between revisions

From mediawiki.org
Content deleted Content added
Carlb (talk | contribs)
MediaWiki versions: - found second issue breaking this under MW1.18/1.19, posting workaround...
Carlb (talk | contribs)
{{Unmaintained extension}} - author attempted to pass this to an editor with <10 edits here and nothing since 2009, so nothing is being done.
Line 3: Line 3:
|text = '''Note:''' This is not the extension found in [http://svn.wikimedia.org/viewvc/mediawiki/trunk/extensions/Editcount/ MediaWiki Subversion] (or Wikia).
|text = '''Note:''' This is not the extension found in [http://svn.wikimedia.org/viewvc/mediawiki/trunk/extensions/Editcount/ MediaWiki Subversion] (or Wikia).
}}
}}
{{Unmaintained extension|alternative=[[Extension:EditCount|EditCount]]|author=Gutworth}}
{{Extension
{{Extension
|name = EditCount
|name = EditCount
Line 9: Line 10:
|type2 = special
|type2 = special
|type3 = user activity
|type3 = user activity
|author = [[User:gutworth|Benjamin Peterson]], [[w:User:Fahadsadah|Fahad Sadah]]
|author = [[User:gutworth|Benjamin Peterson]]
|image = EditCount.png
|image = EditCount.png
|version = 1.2.9
|version = 1.2.9

Revision as of 04:18, 15 February 2012

MediaWiki extensions manual
EditCount
Release status: stable
File:EditCount.png
Implementation Parser function , Special page , User activity
Description Displays a detailed edit count of users.
Author(s) Benjamin Peterson
Latest version 1.2.9 (2008-01-11)
MediaWiki at least 1.6.10
Licence GNU General Public License (any version)
Download from SourceForge
Example template

What can this extension do?

This 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
{{#ec:Benjamin}}

in the 4 namespace
{{#ec:Benjamin|4}}

in the main namespace
{{#ec:Benjamin|0}}

and in the Talk namespace
{{#ec:Benjamin|Talk}}

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):

require_once("$IP/extensions/mw-editcount/EditCount.php");

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 #). Note that this will require that any system messages in the Mediawiki: namespace be created manually for the output to display properly.

if (!$msgsLoaded) {
    $weECMessages = array();
    require_once "EditCount.i18n.php";
    if ($before17) {
         //1.6 doesn't support multiple languages
         $code = $wgContLang->getCode();
         if (!array_key_exists($code, $weECMessages)) {
                $code = "en";
         }
#        $wgMessageCache->addMessages($weECMessages[$code], $code);
    }
    else {
         //add all the message to fill in language gaps
#        foreach ($weECMessages as $code => $msgs) {
#               $wgMessageCache->addMessages($weECMessages[$code], $code);
#        }

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

 $title = $skinTemplate->mTitle;

with:

 $title = $skinTemplate->getTitle();

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!

/**
 * True to turn on parser function and false to not
 */
$egECParserFunction = true;

/**
 * An array of the names of the parser functions
 * 
 * This array of parser function names must be single words (can have - and _).
They are not case sensitive.
These will have "#" appended to the front of them in wikimarkup.
 * @var array
 */
$egECParserFunctionNames = array("editcount", "ec");

/**
 * True to enable the Special:EditCount page
 */
$egECEnableSpecialPage = true;

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 fahadsadah@gmail.com. See the language table for more information.

Language information

Language Translated by Other notes
Brazilian Portuguese SoQuadrinhos  
Dutch warddr  
English -  
Finnish Drall  
French BigSmooth  
German Mooncrater  
Polish Mori Akaice  

Feedback and bugs

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