Installation instructions for Discussion extension

From commenterra

Revision as of 14:58, 15 August 2011 by WikiSysop (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search


1. Download latest version:


2. Extact files to the directory '$IP/extensions/Discussion' where '$IP' is your mediawiki installation directory.

3. Run the following SQL commands in the wiki database if $wfDBprefix is not set (or if you do not know what $wfDBprefix is):

	CREATE TABLE discussion(
		discussion_id INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(discussion_id),
		page_id INT NOT NULL,
		id TINYTEXT NOT NULL,
		page_url VARCHAR(255) COLLATE utf8_unicode_ci,
		page_name TINYTEXT COLLATE utf8_unicode_ci,

		view_group VARCHAR(16),
		post_group VARCHAR(16),
		restricted_post_group VARCHAR(16),
		moderator_group VARCHAR(16),

		max_depth INT,
		characters_max INT,
		author_characters_max INT,

		comment_num1 INT DEFAULT 0,
		comment_num2 INT DEFAULT 0,
		latest INT
	);

	CREATE TABLE discussion_comments(
		comment_id INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(comment_id),
		discussion_id INT NOT NULL,

		user_id INT,
		author_name TINYTEXT COLLATE utf8_unicode_ci,
		text TEXT COLLATE utf8_unicode_ci,
		time INT,
		edit_time INT,

		status INT,
		parent_id INT,
		depth INT,
		vote INT
	);

	CREATE INDEX IDX_discussion_page_id ON discussion (page_id);
	CREATE INDEX IDX_discussion_page_url ON discussion (page_url);
	CREATE INDEX IDX_discussion_comments_discussion_id ON discussion_comments (discussion_id);

If $wgDBprefix is set to some value, for example "en_", then the SQL statements above needs to be modified accordingly: from discussion to en_discussion and from discussion_comments to en_discussion_comments.

Note:
1. This has been tested only with MySQL. The syntax for different SQL servers may differ; here is, for example, the script for PostgreSQL (thanks to JustinG for providing it).
2. If you are migrating from version 1.03 or below, then see CHANGES.TXT on how to modify tables without losing existing comments.


4. Add

require_once('extensions/Discussion/Discussion.php');

to LocalSettings.php.


5 [Optional]. To add a default discussion tag to every wiki page in namespaces NS_MAIN and NS_TALK, add the following to LocalSettings.php after "require_once('extensions/Discussion/Discussion.php')":

$wgDiscussionDefaultText = "<discussion />"; // can be changed to any wiki text
$wgDiscussionDefaultNS = array(NS_MAIN, NS_TALK);

Disclaimer: adding text to every wiki page is a bit experimental - it uses undocumented mediawiki behaviour. Please leave a comment if you observe any problems.

Further customization

You can specify the following options in LocalSettings.php (these lines should come after "require_once('extensions/Discussion/Discussion.php')"):

$wgDiscussionInitComments=false; // do NOT include initial comments in the HTML file; use AJAX instead. Default is 'true'.
$wgDiscussionDisplayRealName = true; // display real user names, if available. Default is false.


Tested on MediaWiki 1.16.0 and 1.17.0. If you tried to install it on other versions of MediaWiki, please leave a comment below whether it was successful or not.

This extension has only been tested on a Unix server. It appears that it doesn't work on a Windows XP server (see comments below).


You need JavaScript enabled for viewing comments
Personal tools