Extension talk:MW-EditCount/LQT Archive 1

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)