Extension:ArticleComments

From MediaWiki.org

Jump to: navigation, search
Manual on MediaWiki Extensions
List of MediaWiki Extensions
ArticleComments

Release status: beta

Implementation Tag
Description Inserts blog-like comment forms into articles.
Author(s) Jim R. Wilson (Jimbojw)
Version 0.4.2
MediaWiki 1.6.x, 1.8.x, 1.9.x
Download ArticleComments.php
Example ArticleComments Test Page

The ArticleComments Extension is a MediaWiki extension that provides a means for creating inline blog-like comment forms for regular wiki articles.

Please see the official project homepage for up-to-date installation notes, usage tips and advanced features.

Project Homepage
ArticleComments Extension - Jimbojw.com
Source Code
ArticleComments.php
Demo
ArticleComments Test Page (try before you buy)
Licensing
ArticleComments is released under The MIT License.

Contents

[edit] Installation

  1. Download ArticleComments, and be sure to rename the downloaded file to ArticleComments.php.
  2. Drop this script in $IP/extensions
    Note: $IP is your MediaWiki install directory.
  3. Enable the extension by adding this line to your LocalSettings.php:
require_once('extensions/ArticleComments.php');

[edit] Usage

Once installed, you (or editors of your wiki) may add comment forms to any article.

To do so, simply add this text to the body of your page where you'd like the comment form to appear:

<comments />

That's it!

[edit] Technical Details

In addition to providing a parser hook for the <comments> tag, the ArticleComments Extension implements a SpecialPage which acts as the recipient of the submitted comment.

Though this special page shows up in Special:Specialpages as "Process Comment", it is not meant to be accessed directly - only via a comment submission form.

When a comment is submitted, if all fields are correctly filled, with no illegal values, the comment is appended to the end of the Article's Talk page. If the comment form is itself on a Talk page, then the comment is appended to the end of that same page. (Comments are always appended to Talk pages - never pages in any other namespace).

[edit] Extension Points

As of version 0.4, this extension registers its own hook called "ArticleCommentsSpamCheck" and provides a default rudimentary implementation.

This is to aid future development of more robust spam checking mechanisms without altering the extension's core code.

[edit] Caveats and Gotchas

This extension does not implement any permission checks other than whether the user or ip address is blocked from making edits. This means that if a comment form is placed on an article, any user or guest my use that form to supply a comment.

The goal of this extension is to provide comment forms that are intuitive for people who are not wiki experts, not just to make it easier to append content to an article's talk page. It is presumed that if an editor places a <comments /> flag in an article, then that article is designated as accepting input from any users.

A future version of this extension may be more permissions-aware however.

[edit] Related Works

For those of you brave enough to try (and extend/augment) this extension, feel free to list your works below. --Jimbojw

[edit] Forum-like CSS

Description
Article which shows alternate CSS for a more forum-like appearance. Also illustrates some basic configuration options.
Documentation
How to add comment guestbook forum to MediaWiki (LeerWiki.nl)

[edit] Comments in place

I've hacked this extension into posting comments just above the <comments /> tag (on whatever page the tag is on), and signing the comment with ~~~~ (i.e. not asking for the user's name, using IP address if not logged in). If anyone wants a diff, shoot me an email. —alxndr (t) 04:06, 15 September 2007 (UTC)

[edit] I've had a play with is and a couple of other extensions

I hope this is clear when I describe it if not I'll try to set up an externally accessible wiki as an example.

Our wiki is used by people with little or no IT skills so I liked the look of 'ArticleComments' Extension:ArticleComments as it would allow me to have a small web form on the article pages that allows users to post comments to the discussion page without using the wiki editing system.

However ArticleComments requires a tag <comments /> to be added to pages that you want the form to appear on, not wanting to have to do this manually on each page, I solved this using an extension HeaderFooter Extension:Header_Footer that will add a standard header / footer to any page within a name space.

I also wanted the ability to add comments, be available only to people who have logged in, we display the following on each page if users are not logged in:-

  • Log In at the top of the page to add your own comments or suggestions about this topic for other staff to read on the 'Discussion' page.
(Use the Submit Feedback link on the left it you want to contact the policy officers)

To do this I used the extension ConditionalShow Extension:ConditionalShow so I have a template :-

<cshow Logged="1" InGroup="user" >*<comments /></cshow>
<cshow Logged="0" InGroup="" >* '''Log In at the top of the page''' to add your own comments or suggestions about this topic for other staff to read on the 'Discussion' page. <br />(Use the '''[[Submit Feedback]]''' link on the left it you want to contact the policy officers)</cshow>

So basically conditional show is used to decide what to display in the footer either the comments form or the login message, based on whether the user has logged in, HeaderFooter adds this as a footer to the relevant pages, and if it's the tag <comment /> then the user gets the comments form.

[edit] See also

Personal tools