Broken/Special:Badtitle/NS104:ArticleComments

From Future Of Mankind

About the ArticleComments extension

This is the same extension as the one at http://www.mediawiki.org/wiki/Extension:ArticleComments but with the code updated to:

  • be compatible with MediaWiki 1.20wmf10,
  • allow specific user groups to make a comment via this extension to the discussion/talk pages without being able to directly edit the talk page,
  • allow multiple comment forms on the same page,
  • allow the user to enter their town and country,
  • allow the style to be more easily customisable,
  • allow additional languages to be added,
  • use JQuery instead of vanilla Javascript to provide "form prefilling".
  • use the ResourceLoader functions to load the CSS (also the JS in a later version)

This extension is installed on this Wiki. See the form in action at http://www.futureofmankind.co.uk/Billy_Meier/Extension:ArticleCommentsTest.

Where to download the ArticleComments extension

How to install the ArticleComments extension

  1. Unzip it within your extensions folder
  2. Add the following lines to your LocalSettings.php to only allow users, who have registered and confirmed their email address, the ability to use the ArticleComments form to post comments to the discussion page. This will also only allow users who are members of the "editors" group to edit main pages or talk pages. You might already have a different group called something other than "editors" and in that case you should substitute "editors" for your custom group.
# Disable the editing of all pages in all namespaces for everyone including anonymous users.
$wgGroupPermissions['*']['edit']              = false;
# Disable for users, too: by default 'user' is allowed to edit, even if '*' is not.
$wgGroupPermissions['user']['edit']           = false;
# Make it so users with confirmed e-mail addresses are in a new group called 'emailconfirmed'.
$wgAutopromote['emailconfirmed'] = APCOND_EMAILCONFIRMED;
# Hide group from user list. 
$wgImplicitGroups[] = 'emailconfirmed';
# Enable editing of all pages for groups "editors" and "sysop" only
$wgGroupPermissions['editors']['edit'] = true;
$wgGroupPermissions['sysop']['edit'] = true;
# Enable posting of comments for specific groups
$wgGroupPermissions['emailconfirmed']['comment'] = true;
$wgGroupPermissions['editors']['comment'] = true;
$wgGroupPermissions['sysop']['comment'] = true;
# Just grant everyone the ability to use the comment form (if you uncomment this then also check the $wgArticleCommentsDefaults['disableanon'] setting below)
#$wgGroupPermissions['*']['comment'] = true;

# enable ArticleComments extension
require_once("$IP/extensions/ArticleComments/ArticleComments.php");
# allow the ArticleComments form to be displayed in specific namespaces
$wgArticleCommentsNSDisplayList = array(NS_MAIN, NS_TALK, NS_HELP, NS_HELP_TALK);
# whether to hide the form with a link called "Leave a comment..." which expands when clicked on
$wgArticleCommentsDefaults['hideform'] = false;
# whether to show the URL / Website form field within the form
$wgArticleCommentsDefaults['showurlfield'] = false;
# whether to show the Town & Country form field within the form
$wgArticleCommentsDefaults['showtowncountryfield'] = true;
# whether to disable the forms controls for anonymous users (users that havent logged into the wiki)
$wgArticleCommentsDefaults['disableanon'] = true;

How to display the form

  • Add the <comments /> tag to any page where you want to display the form, one or more times. To automatically add <comments /> to all pages and talk pages try the Header_Footer extension (http://www.mediawiki.org/wiki/Extension:Header_Footer). With the Header_Footer extension, to have the comments form displayed at the bottom of each page, add the <comments /> tag to the following pages of your Wiki:
    • MediaWiki:Hf-nsfooter-
    • MediaWiki:Hf-nsfooter-Talk

Troubleshooting

  • If you experience unexpected behaviour with your form add the following lines to your LocalSettings.php to disable parser cache but enable others:
/**
 ** Caching settings
 **/
 
// Do not keep parsed pages in a cache (objectcache table, turck, or memcached) , ArticleComments extension doesnt like this set to true
$wgEnableParserCache = false;

// Allow client-side caching of pages
$wgCachePages = true;

// Enable the server-side file cache
$wgUseFileCache = true; /* default: false */
$wgFileCacheDirectory = "$IP/cache";
$wgShowIPinHeader = false;

// Disable output compression (required in order to use $wgUseGzip = true;)
$wgDisableOutputCompression = true;

// Gzip cached HTML pages to save disk space
$wgUseGzip = true;

// Cache the sidebar navigation links
$wgEnableSidebarCache = true;

How to customize the extension

  • To customize the colours, fonts, layout and button (the CSS), edit the extensions/ArticleComments/modules/ext.ArticleComments.form.css file as required.
  • To customize the form's html, edit the extensions/ArticleComments/ArticleComments.hooks.php
  • To customize the text displayed on the form, edit the extensions/ArticleComments/ArticleComments.i18n.php

How to ensure that bots cannot easily register a username on your wiki

If they cannot register then they cannot post. Try the QuestyCaptcha at http://www.mediawiki.org/wiki/Extension:QuestyCaptcha then configure easy questions that fool bots, for example, "What is the second letter of the word superman?"

Email me any questions

james [at] futureofmankind [dot] co [dot] uk

<comments />