User:Subfader/Article Comments

This explains a major tweak of Extension talk:ArticleComments I've set up myself and with the help of Jimbojw via IRC some while ago. It has been tested on MW 1.8.2 and 1.12.0

"Leave Comment" + all comments on all article pages
The following explains how to enable having the "Leave a comment" link per default at the bottom of all pages of the namespaces you define + how to display the left comments from the discussion page below the article.

All that per default without adding  or   code to each individual article.

This includes displaying the comments on your article discussion pages left before you installed this extension and displaying the "Leave a comment" link on maybe unrelated (like non exisiting) pages or pages you may better not want to have visitor comments on e.g. Main Page. Atm there is no way to diasable the form once you went through this. Disabling would require a Magic Word like __NOCOMMENTSHERE__. But it's still very useful if you already have hundreds of articles in your wiki...

Ok for you? Let's Go!

 * Install the extension.
 * Use the LeerWiki guestbook modification.
 * Tweaks:

Edit LocalSettings.php. Besides require_once('extensions/ArticleComments.php'); you should add the following so it looks like this: require_once('extensions/ArticleComments.php'); $wgArticleCommentDefaults['showurlfield']=false; $wgArticleCommentsNSDisplayList = array(NS_MAIN, NS_TALK) The second line removes the URL field from the comment form, remove the line if you want the field aynway. The third line defines the namespaces this will take effect on; adjust to your needs, e.g. NS_MAIN, NS_TALK, NS_HELP, NS_HELP_TALK.

Edit skins/monobook.php and find Add the following code inbetween or if you have content in that section already, add it to the very end.  getNamespace==NS_MAIN &&       (!$wgRequest->getVal('action') || $wgRequest->getVal('action')=='view')    ) { $talkTitle = $wgTitle->getTalkPage; if ($talkTitle->exists) { global $wgParser; $talkPage = new Article($talkTitle); $output = $wgParser->parse( $talkPage->getContent, $talkTitle, $wgParser->mOptions ); echo( " Comments \n" . $output->getText ); }   } ?>  Comments \n will add a new =Comment= headline after the first comment has been left; all coments below.

If you want to enable comments on more namespaces change the according line to something like:

At this point it already works, please test it now to understand the following. It still needs some modification to remove the second "Leave a comment" link and "Comments on ..." below the headline.

Edit extension/ArticleComments.php, find # Initialize the talk page's content. if ( $talkContent == '' ) { $talkContent = wfMsgForContent($ac.'talk-page-starter', $title->getPrefixedText ); Comment the second line out if you want to remove the complete section and get the comments listed below the headline right away. But it may also be a good way to leave a note for your visitors, since it will only be displayed after the first comment has been left, this cannot be instructions for what should be the content of the comments but something like "The comments below have been left by visitors or users. This site's operators cannot take responsibility for the content of the comments." To do so, don't comment this section out and change the content on MediaWiki:Article-comments-talk-page-starter to something like The comments below have been left by visitors or users. This site's operators cannot take responsibility for the content of the comments. . To style this line edit skins/monobook/main.css and add something like this somewhere div.commentstopmessage { font: 90% verdana, arial, sans-serif; color: grey; text-align: center; margin-top: -12px; margin-bottom: 4px; }

Latest Comments
This will list all talk pages with new comments of the Main namespace. Either go on Special:Newpages/namespace=Talk or create a page including this + some text you want to enter, e.g. create a page like "Help:Latest Comments", enter something like this:

This is a list of pages with new comments
Note that you're taken to the DISCUSSION page of the ARTICLE. The list only goes back a few days. more

1 list is only possible for 1 namespace imo. For other namespaces change "Special:Newpages/namespace=Talk" and "&namespace=1" in the "more" link.

--Subfader 15:56, 30 March 2008 (UTC)