Extension talk:MW-EditCount/Archive 01

Note that the name of this extension conflicts with one in Subversion, which will have priority in terms of documentation at this title. robchurch | talk 00:24, 30 April 2007 (UTC)
 * I'll cross that bridge when I come to it. Gutworth 22:09, 5 May 2007 (UTC)

Edit count not working
I installed and enabled the extension (1.1) on Mediawiki 1.9.3. But I'm not getting a link in the special pages. But i get a link "User Edit Count" in the toolbox menu of a user page. when i click on that page, the error messsage says "You have requested an invalid special page........". plz help

Jack
 * What language are you using? Gutworth 00:11, 30 May 2007 (UTC)


 * English


 * I'm working on this issue and I issue with 1.6. I'll release a new version when I've fixed the bugs. Gutworth 00:59, 1 June 2007 (UTC)


 * I tried this my self and didn't get the error. Why don't you try with the newer version I released. Gutworth 00:58, 2 June 2007 (UTC)

I downloaded the new version and see no difference. I included the in the admin user page and then i could see the number of edits. that's it! What am I missing? how can I display some debugging messages?
 * Jack


 * So, the parser functions work, but the link on the tool bar doesn't work? Gutworth 22:35, 4 June 2007 (UTC)


 * Exactly. The message I'm getting is

You have requested an invalid special page,a list of valid special pages may be found at Special:Specialpages. Return to Main Page

The URL is ..wiki/index.php?title=Special:EditCount&target=Admin


 * When you look at Special:Specialpages, is Edit Count on there? Gutworth 16:25, 7 June 2007 (UTC)


 * No it's not there. But it's showing up in Special:Version


 * Would you mind sending me your LocalSettings.php? I don't need the passwords or anything you deem to sensitive. 128.101.248.111 16:15, 11 June 2007 (UTC)

Here is the relevent portion
require_once("$IP/extensions/EditCount/EditCount.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;
 * Sorry, that's not enough. It works fine on my 1.9.3 wiki with default settings so I'm wondering if any of your custom settings are causing it not to work? Have you made any changes to the code base? 65.112.121.29 19:08, 13 June 2007 (UTC)

No changes I made.

if( defined( 'MW_INSTALL_PATH' ) ) { $IP = MW_INSTALL_PATH; } else { $IP = dirname( __FILE__ ); }

$path = array( $IP, "$IP/includes", "$IP/languages" ); set_include_path( implode( PATH_SEPARATOR, $path ) . PATH_SEPARATOR . get_include_path );

require_once( "includes/DefaultSettings.php" );

ini_set( 'memory_limit', '50M' );
 * 1) If PHP's memory limit is very low, some operations may fail.

if ( $wgCommandLineMode ) { if ( isset( $_SERVER ) && array_key_exists( 'REQUEST_METHOD', $_SERVER ) ) { die( "This script must be run from the command line\n" ); } } elseif ( empty( $wgNoOutputBuffer ) ) { ## Compress output if the browser supports it	if( !ini_get( 'zlib.output_compression' ) ) @ob_start( 'ob_gzhandler' ); }

$wgSitename        = "SunWiki"; $wgScriptPath      = "/sunwiki"; $wgScript          = "$wgScriptPath/index.php"; $wgRedirectScript  = "$wgScriptPath/redirect.php"; $wgArticlePath     = "$wgScript/$1";
 * 1) $wgArticlePath      = "$wgScript?title=$1";

$wgStylePath       = "$wgScriptPath/skins"; $wgStyleDirectory  = "$IP/skins"; $wgLogo            = "$wgStylePath/common/images/sunwiki.png";

$wgUploadPath      = "$wgScriptPath/images"; $wgUploadDirectory = "$IP/images"; $wgAllowUserJs = true; $wgEnableEmail     = true; $wgEnableUserEmail = true;

$wgEmergencyContact = "$wgSitename"; $wgPasswordSender = "$wgSitename";

$wgEnotifUserTalk = true; # UPO $wgEnotifWatchlist = true; # UPO $wgEmailAuthentication = true; /** For email notification on page changes */ $wgPasswordSender = $wgEmergencyContact; $wgDBmwschema      = "mediawiki"; $wgDBts2schema     = "public";
 * 1) For a detailed description of the following switches see
 * 2) http://meta.wikimedia.org/Enotif and http://meta.wikimedia.org/Eauthent
 * 3) There are many more options for fine tuning available see
 * 4) /includes/DefaultSettings.php
 * 5) UPO means: this is also a user preference option
 * 1) Email notification settings
 * 1) Schemas for Postgres

$wgDBmysql5 = false;
 * 1) Experimental charset support for MySQL 4.1/5.0.

$wgMainCacheType = CACHE_NONE; $wgMemCachedServers = array;
 * 1) Shared memory settings

$wgEnableUploads      = true; $wgUseImageResize     = true;
 * 1) To enable image uploads, make sure the 'images' directory
 * 2) is writable, then set this to true:
 * 1) $wgUseImageMagick = true;
 * 2) $wgImageMagickConvertCommand = "/usr/bin/convert";


 * 1) If you want to use image uploads under safe mode,
 * 2) create the directories images/archive, images/thumb and
 * 3) images/temp, and make them all writable. Then uncomment
 * 4) this, if it's not already uncommented:
 * 5) $wgHashedUploadDirectory = false;

$wgUseTeX          = false; $wgMathPath        = "{$wgUploadPath}/math"; $wgMathDirectory   = "{$wgUploadDirectory}/math"; $wgTmpDirectory    = "{$wgUploadDirectory}/tmp";
 * 1) If you have the appropriate support software installed
 * 2) you can enable inline LaTeX equations:

$wgLocalInterwiki  = $wgSitename;

$wgLanguageCode = "en";

$wgProxyKey = "41e81720836933d46871c6c405c4e9114232362148295b56b9e946a4cf5f79d";

$wgDefaultSkin = 'monobook';
 * 1) Default skin: you can change the default skin. Use the internal symbolic
 * 2) names, ie 'standard', 'nostalgia', 'cologneblue', 'monobook':

$wgEnableCreativeCommonsRdf = false; $wgRightsPage = "Copyright"; # Set to the title of a wiki page that describes your license/copyright $wgRightsUrl = "http://creativecommons.org/licenses/by-nc-nd/3.0/"; $wgRightsText = "SunTec's Non Disclosure Agreement"; $wgRightsIcon = "http://i.creativecommons.org/l/by-nc-nd/3.0/88x31.png";
 * 1) For attaching licensing metadata to pages, and displaying an
 * 2) appropriate copyright notice / icon. GNU Free Documentation
 * 3) License and Creative Commons licenses are supported so far.
 * 1) $wgRightsCode = "by-nc-nd"; # Not yet used

$wgDiff3 = "";

$configdate = gmdate( 'YmdHis', @filemtime( __FILE__ ) ); $wgCacheEpoch = max( $wgCacheEpoch, $configdate ); $wgGroupPermissions['*']['createaccount'] = true; $wgGroupPermissions['*']['edit'] = false; $wgGroupPermissions['*' ]['read']           = true; // Implicit group for all logged-in accounts $wgGroupPermissions['user' ]['move']           = false; $wgGroupPermissions['user' ]['edit']           = true; $wgGroupPermissions['user' ]['delete']         = false; $wgGroupPermissions['user' ]['createpage']     = true; $wgGroupPermissions['user' ]['createtalk']     = true; $wgGroupPermissions['user' ]['upload']         = true; $wgGroupPermissions['user' ]['reupload']       = true; $wgGroupPermissions['user' ]['reupload-shared'] = true; $wgGroupPermissions['user' ]['minoredit']      = false; // Most extra permission abilities go to this group $wgGroupPermissions['sysop']['block']          = true; $wgGroupPermissions['sysop']['createaccount']  = true; $wgGroupPermissions['sysop']['delete']         = true; $wgGroupPermissions['sysop']['deletedhistory'] = true; // can view deleted history entries, but not see or restore the text $wgGroupPermissions['sysop']['editinterface']  = true; $wgGroupPermissions['sysop']['import']         = true; $wgGroupPermissions['sysop']['importupload']   = true; $wgGroupPermissions['sysop']['move']           = true; $wgGroupPermissions['sysop']['patrol']         = true; $wgGroupPermissions['sysop']['autopatrol']     = true; // not in version 1.6.9, 1.8.2, 1.8.3 $wgGroupPermissions['sysop']['protect']        = true; $wgGroupPermissions['sysop']['proxyunbannable'] = true; //not in version 1.6.9 $wgGroupPermissions['sysop']['rollback']       = true; $wgGroupPermissions['sysop']['trackback']      = true; //not in version 1.6.9 $wgGroupPermissions['sysop']['upload']         = true; $wgGroupPermissions['sysop']['reupload']       = true; $wgGroupPermissions['sysop']['reupload-shared'] = true; $wgGroupPermissions['sysop']['unwatchedpages'] = true; $wgGroupPermissions['sysop']['autoconfirmed']  = true; /*LDAP authentication require_once( "$IP/extensions/LdapAuthentication.php" ); $wgAuth = new LdapAuthenticationPlugin; $wgLDAPUseLocal = true; $wgLDAPEncryptionType = array( "suntecsbs.com"=>"ssl" ); $wgLDAPDebug = 0; $wgLDAPDomainNames = array("suntecsbs.com"); $wgLDAPServerNames = array("suntecsbs.com"=>"suntecsbs.com"); $wgLDAPSearchStrings = array("suntecsbs.com"=>"SUNTECSBS\\USER-NAME"); $wgMinimalPasswordLength = 1; $wgLDAPSearchAttributes = array("suntecsbs.com"=>"sAMAccountName"); $wgLDAPBaseDNs = array("suntecsbs.com"=>"OU=SunTec Business Solutions,DC=suntecsbs,DC=com"); $wgShowExceptionDetails = true; //Flash-http://www.mediawiki.org/wiki/Extension:Flash include('extensions/Flash.php'); //mp3 file-http://www.mediawiki.org/wiki/Extension:FlashMP3 include('extensions/flashmp3.php'); //pdf file include('extensions/pdf.php'); //sorting lists include_once("$IP/extensions/sort.php"); //add color include_once("$IP/extensions/colorize.php"); // show latest pages //http://svn.wikimedia.org/svnroot/mediawiki/trunk/extensions/NewestPages/NewestPages require_once( 'extensions/NewestPages.php' ); $wgUseCategoryBrowser=true; require_once( 'extensions/CategoryTree/CategoryTree.php' ); $wgAjaxExportList[] = 'wfSajaxSearchImageFCKeditor'; require_once("extensions/Hierarchy.php"); require_once("extensions/SpecialHOC.php"); //allow full html $wgRawHtml = true; //Edit count-http://www.mediawiki.org/wiki/Extension:EditCount require_once("$IP/extensions/EditCount/EditCount.php"); $egECParserFunction = true; $egECParserFunctionNames = array("editcount", "ec"); $egECEnableSpecialPage = true;
 * 1) When you make changes to this configuration file, this will make
 * 2) sure that cached pages are cleared.
 * 1) prevent anonymous from editing
 * Sorry, I tried it with your setup (extensions (except LDAP) and Mediawiki 1.9.3); it worked just great for me. The only thing I can recommend now is upgrading to Mediawiki 1.10. Gutworth 14:15, 15 June 2007 (UTC)

help
I have mediawiki 1.6.10, I m not sur that fonction with. But when I put hte "magic word", i display correctly bur when I put Special:EditCount&target=user, it display

(SQL query hidden)depuis la fonction « __METHOD__ ». MySQL show « 1146: Table 'guild_wars_wiki.revision' doesn't exist (sql.free.fr) ». Because my table is 'guild_wars_wiki.(that is a prefix)wiki_revision' and i don't know how to change this. So i want some help, please.(sorry for my bad english, im french).--Add 18:55, 19 June 2007 (UTC)


 * As far as I can tell, the extension is not aware of $wgDBprefix - this is a bug. As a temporary fix, you can manually adjust the SQL statements in EditCountPage.php, though (I just did the same thing). -- Schneelocke 20:48, 21 June 2007 (UTC)


 * How and where exatcly? please


 * Don't sweat! I fixed it in the 1.2.6 release. Gutworth 02:50, 27 June 2007 (UTC)
 * in EditCount.php, you use wgDBPrefix, but the variable's name is wgDBprefix (with a small 'p')... ;) I use Wikimedia 1.11. 82.231.203.194 16:23, 2 November 2007 (UTC)


 * I use 1.6.10 and the SQL error still happens on the default install with v1.2.7. Replacing all instances of wgDBPrefix with wgDBprefix (8 of them) in EditCountPage.php fixes this --BrillyuntWebby 18:48, 8 November 2007 (UTC)

mmmh, in fact, I've made some hacks on your code because some things does'nt work on my wiki. 1) On the main page in special:edit count, I change the form because I use some strange IIS scripts to redirect my http request, and your code doesn't work: before $form .= wfElement("form", array("name" => "editcountform", "method" => "get", "action" => $ct->getLocalURL), null); After $form .= wfElement("form", array("name" => "editcountform", "method" => "get", "action" => $wgScriptPath . "/index.php"), null);	$form .= wfElement("input", array("type" => "hidden", "name" => "title", "value" => "Special:EditCount"), "") . " "; 2) in function getTotal (I'doesn't know php and mysql, so don't ask my why) before return $this->db->selectField("{$wgDBprefix}revision", "COUNT(*)", array("rev_user_text" => $this->user->getName), __METHOD__); after return $this->db->selectField("revision", "COUNT(*)", array("rev_user_text" => $this->user->getName), __METHOD__); Note: argl, it works with both the old and the new code now... 82.231.203.194 16:53, 2 November 2007 (UTC)
 * Thanks, everybody. I've hopefully fixed your concerns in 1.2.8. Gutworth 03:58, 14 November 2007 (UTC)

French translation
Hello, Here is my french (fr) translation of the extension:

$weECMessages['fr'] = array( 	"editcount" => "Compteur d'éditions", 	"editcount-des" => "Saisir un nom d'utilisateur ou une IP pour voir le nombre d'édition de l'utilisateur.", 	"editcount-edits" => "Editions", 	"editcount-namespace" => "Espaces de noms", 	"editcount-noedits" => "Aucune edition trouvée pour $1.", 	"editcount-notuser" => "$1 n'est pas un utilisateur valide.", 	"editcount-percent" => "Poucentage d'éditions", 	"editcount-percentsym" => "%", 	"editcount-show" => "Montrer le nombre d'éditions", 	"editcount-toolbox" => "Compteur d'éditions de l'utilisateur", 	"editcount-total" => "Total", 	"editcount-username" => "Utilisateur:" );

BigSmooth

Brazilian Portuguese translation
Hi, Here is my contribution, brazilian portuguese (pt-br) translation of the extension: $weECMessages['pt-br'] = array(	"editcount" => "Contador de Edições",	"editcount-des" => "Incira um nome de usuário ou IP para ver a contagem de edições do usuário.",	"editcount-edits" => "Edições",	"editcount-namespace" => "Espaço do nome",	"editcount-noedits" => "Não foram encontradas edições para $1.",	"editcount-notuser" => "$1 não é um usuário válido.",	"editcount-percent" => "Porcentagem do total de edições",	"editcount-percentsym" => "%",	"editcount-show" => "Mostrar Contagem",	"editcount-toolbox" => "Contagem de Edições do Usuário",	"editcount-total" => "Total",	"editcount-username" => "Nome de Usuário:" ); by SoQuadrinhos

Thanks so much for the translations
I hope the title says it all! Gutworth 01:54, 22 December 2007 (UTC)
 * I've added the latest 3 translations to 1.2.9. Gutworth 19:08, 12 January 2008 (UTC)

Opposite problem: EditCount works, does not
Using MediaWiki 1.9.3, Special:EditCount works when used in a link. I've edited LocalSettings.php as per the instructions in http://www.mediawiki.org/wiki/Extension:EditCount, confirmed that the changes are being used when I reload (get the path wrong in the 'require_once', and you get an error), confirmed that is duly replaced by 5, confirmed that EditCount.php matches the download from that page. Yet remains stubbornly unreplaced.

I noticed that ParserFunctions.php had nothing in it about ec. So as an experiment I added to that file so that now gets replaced by the result of calling a function with a username parameter! What should I use as the function, to get the correct ec functionality, or is there a better fix?
 * I'm not exactly sure what your problem is. The parser function for EditCount is in EditCount.php. I guess that for some reason it's not being called? Is this more information you can give? Gutworth 17:06, 1 March 2008 (UTC)

New fonction ..
Hi, I use that extension since a long time and I'am very filled of it. But i thing that if you add fonction like pourcent ... (Like Extension:Contribution Scores), It could be the better extension of this wiki. I hope you can do that Thanks and sorry for my bad english (french powa ^^) --Add 11:31, 16 February 2008 (UTC)


 * You can implement this with Wiki-Code, for Example:

User has  Edits, which are %.
 * This will only work with Extension:ParserFunctions installed. 79.193.251.87 17:47, 30 March 2008 (UTC)


 * This gave me an idea. Could the extension be upgraded to have parser functions that list the total number of edits in a namespace for the whole wiki? You know, how many edits of were in a certain namespace.--Matt 00:22, 28 November 2008 (UTC)

Initialization inside of efEditCount not working
Hi, I had some trouble getting EditCount to work... but then I yanked a subset of the initialization out of the efEditCount function and put it up above and things worked fine.

I had to pull out $before17 = version_compare($wgVersion, "1.7", "<"); //for cross version compatibility if ($before17) { //autoloading not supported require_once "EditCountPage.php"; }	//add to special page (object if less than 1.7) if ($before17) { $wgSpecialPages["EditCount"] = new EditCountPage; } else { $wgSpecialPages["EditCount"] = "EditCountPage"; } and I put that inside of the  at the top of the file (outside of any functions) and it started working.

Thanks for the extension! - Sean Colombo 15:40, 6 April 2008 (UTC)


 * Yeah, I put that in the next version. I had forgotten about autoloading not working. Thanks! Gutworth 13:49, 23 April 2008 (UTC)

Editcount turns off Edit
I am using MW 1.12. I turned on EditCount with the following:

require_once( $IP . "/extensions/EditOwn/EditOwn.php" );

$egECParserFunction     = true;

$egECParserFunctionNames = array("editcount", "ec");

$egECEnableSpecialPage  = true;

All pages show View Source now and will not allow any editing of the pages. Any idea what would cause that?
 * I doubt that it's EditCount's fault. You probably have changed some other setting or permissions. If I'm wrong, do tell me, though. Gutworth 21:43, 3 May 2008 (UTC)

[RESOLVED] Special Page?
Using MW 1.12.0rc and the Special Page is not found (with $egECEnableSpecialPage = true; in LocalSettings). Rest works fine for my needs though. --Subfader 20:51, 14 May 2008 (UTC)
 * Ok got it working moving the block over other extension requires in LocalSettings --Subfader 08:35, 15 May 2008 (UTC)
 * I've used the same solution for MW 1.10.1 successfully. But why has the position of the extension in LocalSettings.php this result? --ThT 14:02, 19 June 2008 (UTC)

More features?
The extension works fine. I'd like to be able to give out more in the same way: Cheers. --Subfader 22:20, 14 May 2008 (UTC)
 * user's number of different pages edited (Extension:Contribution Scores)
 * date of user's last edit (Extension:UserSnoop)
 * user's registration date (Extension:UserSnoop)
 * user's last login date (Extension:LastLoginTime)
 * user's number of watched pages (Extension:WhoIsWatching)
 * Remember this is about counting edits, not user snooping. If you really want them, I may accept patches. Gutworth 22:47, 21 May 2008 (UTC)

Inconsistance
First off, I have Extension:Contribution Scores installed and the total ammount varies to using. Addionally the Special Page reads crap so I don't trust the function at all. Example for some user:


 * Contribution Scores tells me that user has made 1222 edits in total
 * Special:EditCount: Edits in main namespace: 1155 (117.5%), total 983 - screenshot --Subfader 08:49, 15 May 2008 (UTC)


 * That is very curious. I wonder if it has to do with your database. Gutworth 22:47, 21 May 2008 (UTC)

1.12 and the API
This extension is breaking the API for me, when I have it turned on as the only extension I can't log in through the API. If I remove it the API functions perfectly. --Coban 14:53, 9 June 2008 (UTC)

Looking for a new maintainer
I'm sorry to say that as busy as I am with Python work, I no longer have the bandwidth to maintain this extension. If you are interested in inheriting it, please email me and I will make you an admin on the SF project and send you my Subversion repo. Thanks. Gutworth 14:05, 28 June 2008 (UTC)

RSS and Atom feed loading error
In the latest version of EditCount there's a little typo at the end of the i18n file :

There's a linebreak and a space after the "?>" statement : it corrupts the XML sent to the browser (read also : this post in the mailing-list).

Hope it helps ;) --Ouroboros 17:56, 18 August 2008 (UTC)
 * Fixed, and I will release as soon as I figure out git :P Fahadsadah 13:38, 29 May 2009 (UTC)

bad "require once"
should  be  ? Bud0011 06:28, 15 June 2009 (UTC)

Count of new articles initiated...
Its a very useful extension. Could you please extend this extension so that it also shows the number of articles initiated by the specified user?

In some of the wikis (like mine which contains poems) getting the count of articles created gives a better view of a user's performance. Once a poem is typed in a new page -there is seldom a need to edit that page again.

If a user types the entire poem -his edit count goes up by 1... but if another user just corrects a spelling mistake he also gets the edit count increase of 1... this is not really fair in the wiki where articles are usually created by one person and others only make tiny changes like correcting spelling mistakes.

On Special:Contributions Mediawiki shows whether a page was created by the user. Being able to get a count of such pages would be of great help.

Thanks for your important work!

Lalit Kuamr

Sugestion
It would be nice if there was a parameter to return the first edit date. For exemple,  would return the timestamp of first edit. It would be useful to verifi the vote right with a template and to calculate users edit frequencies. Danilo.mac 22:06, 20 February 2010 (UTC)

Voting
How do we encourage Wikimedia to implement? Svanslyck 00:06, 11 May 2010 (UTC)

Parser function don't work
...in Extension:RandomSelection, appears when this is in. Mateus95860 Cont. 01:55, 30 June 2010 (UTC)
 * This appears to be a limitation of the RandomSelection algorithm; you're trying to make it do something it was never designed to support. The same result would appear with any other parser function embedded in &lt;choose/option&gt; tags, for instance: "    " yields 4 and not forty-four (as the result one would've expected for sufficiently large values of two). --Carlb 13:53, 4 July 2010 (UTC)

PHP 5.3 incompatibility
This code appears valid in PHP 5.1.6 (the circa-2006 PHP version which ships with current RH/CentOS distributions) but under the newest PHP versions generates an error:
 * PHP Parse error: syntax error, unexpected T_PAAMAYIM_NEKUDOTAYIM, expecting T_NS_SEPARATOR in .../extensions/EditCount.php on line 206

where the affected block of code (with line 206 #'ed out) is:

Not sure what about $index = Namespace::getCanonicalIndex(strtolower($param2)); PHP 5.3 doesn't like, but this line just seems to be needed for invocations of this extension as a parser function and then only when pointed to a specific, named namespace. Disable it (using MediaWiki 1.17alpha and APC cache in both cases) and the rest of the extension executes normally despite PHP 5.3? --Carlb 13:53, 4 July 2010 (UTC)


 * Namespace is a reserved word in PHP 5.3+, the MediaWiki class was renamed to MWNamespace. --Jack Phoenix (Contact) 14:10, 4 July 2010 (UTC)