Broken/Special:Badtitle/NS104:ArticleComments: Difference between revisions
From Future Of Mankind
Line 15: | Line 15: | ||
==Where to download the ArticleComments extension== | ==Where to download the ArticleComments extension== | ||
* Download it from here: [[File:ArticleComments.zip]] or | * Download it from here: [[File:ArticleComments.zip]] or http://www.futureofmankind.co.uk/Billy_Meier/File:ArticleComments.zip | ||
http://www.futureofmankind.co.uk/Billy_Meier/ | |||
==How to install the ArticleComments extension== | ==How to install the ArticleComments extension== |
Revision as of 00:43, 8 September 2012
About the ArticleComments extension
This is the same extension 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".
This extension is installed on this Wiki. See the form in action at the bottom of this page.
Where to download the ArticleComments extension
- Download it from here: File:ArticleComments.zip or http://www.futureofmankind.co.uk/Billy_Meier/File:ArticleComments.zip
How to install the ArticleComments extension
- Unzip it within your extensions folder
- 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. 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
<comments />