Broken/Special:Badtitle/NS104:ArticleComments

From Future Of Mankind

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 editing main pages 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 the group.
$wgAutopromote['emailconfirmed'] = APCOND_EMAILCONFIRMED;
# Hide group from user list. 
$wgImplicitGroups[] = 'emailconfirmed';
# Enable editing of all pages for groups "editors" and "sysop"
$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;

# 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. 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, 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 try comment out the following line to refresh your MW cache (or if already commented out, try uncomment it) or just wait 24 hours:

$wgCacheEpoch = max( $wgCacheEpoch, gmdate( 'YmdHis', @filemtime( __FILE__ ) ) );

How to customize the extension

  • Multiple forms per page will work. Each form is automatically given a different CSS "ID" attribute.
  • 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

Email me any questions

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