Extension:CommentStreams

Introduction
CommentStreams is a commenting system for wikis. Users can post comments on a wiki page which are displayed with their username and time of posting. There are two levels of comment posts: a new thread, and replies to that thread. CommentStreams supports Semantic MediaWiki if installed, but also operates standalone.

Under the hood, CommentStreams stores comments in auto-incrementing pages in the CommentStreams namespace (e.g. CommentStreams:1, CommentStreams:2, etc). A database table matches contents from a comment's CommentStreams page to the page that the comment should reside on.

Installation
At a minimum, include the following in LocalSettings.php (MW 1.25+):

MW 1.24:

After requiring CommentStreams,  must be run to update the database with the CommentStreams tables.

Configuration Settings
CommentStreams has several configuration settings which should be included (below the require_once call in MW 1.24, or anywhere in LocalSettings.php on MW 1.25+):


 * You must define the value of NS_COMMENTSTREAMS in LocalSettings.php. Include this line:


 * defines whether CommentStreams should be enabled on talk pages. If true, for all namespaces that CommentStreams is enabled on, it is also enabled on the corresponding talk namespace. Defaults to false.


 * is an array which defines which namespaces CommentStreams should be enabled on. This array must take non-talk namespaces (even-numbered namespaces). Defaults to the wiki's content namespaces.


 * is an array which defines which namespaces will show all threads initially collapsed on page load. By default, if a namespace appears in  but not , all threads are initially expanded on page load. (If a namespace shows up here, but does not appear in  , it is ignored.)


 * defines the order in which streams (discussions) appear on the page. If true, the most chronologically recent streams appear on top. Defaults to false. Regardless of this variable, replies to discussions are always ordered with the newest replies at the bottom of the thread, as with a traditional forum/commenting system.

Semantic MediaWiki Support
CommentStreams defines the  constant for the CommentStreams namespace, which can be used alongside Semantic MediaWiki. The following variables may be used:
 * Enables the CommentStreams namespace to be searched by default in MediaWiki
 * Enables CommentStreams to work with Semantic MediaWiki
 * is a string which defines what SMW property the comment's title should be stored in on the CommentStreams page. Default value is 'Comment Title'. This allows comments to be queryable.
 * Enables CommentStreams to work with Semantic MediaWiki
 * is a string which defines what SMW property the comment's title should be stored in on the CommentStreams page. Default value is 'Comment Title'. This allows comments to be queryable.

Display Name Configuration Options
CommentStreams supports the use of real names instead of usernames in comments, with the following order of priority:
 * Highest priority: SMW integration. Set a real name property on a user's page - the property name is in variable  (default="Real Name").
 * Next priority: The value of the real_name field in the user table in MediaWiki.
 * Default: just shows username.

EditOwn Integration
Note: CommentStreams alone does not protect against manual editing of other peoples' comments. (It is unlikely to accidentally occur, because there are no direct links to the comment pages in the CommentStreams namespace, but it is technically possible for a skilled user.) We recommend the use of the EditOwn extension (and companion EditOwnIncludedNamespaces) to protect the CommentStreams namespace. See example configuration below.

Example Configuration
In this configuration:
 * Six namespaces will have CommentStreams enabled: main, user, and BIB_CITATION, along with their corresponding talk pages.
 * The main and BIB_CITATION namespaces will load pages with threads expanded initially, while the user namespace will load with threads collapsed initially.
 * The order of threads on any CommentStreams-enabled page will show newest streams on top.
 * CommentStreams has been enabled with SMW, and all comments will have their comment title stored in a property 'My Title' on their corresponding CommentStreams pages.
 * The  call to EditOwn and EditOwnIncludedNamespaces protects the CommentStreams namespace, preventing comments from being edited by anyone except their owners.

Disabling On A Page
CommentStreams also offers a tag function,, which disables CommentStreams on a page. By default, this instead places a message at the bottom alerting readers that comments are disabled on that page; suppress this message by using.

Known Issues

 * If CommentStreams is used on a page which uses HeaderTabs, and a comment is posted which transcludes another page using HeaderTabs, the JavaScript on the page breaks.
 * Workaround: Don't transclude pages with HeaderTabs onto pages with HeaderTabs.

Developer Notes
See Extension:CommentStreams/Developer Notes for notes on the structure of the CommentStreams extension.