User:AndiRay/Article Comments

'''This is under construction... not finished yet!!!''' 

I wanted to have a "leave comment..." statement at the bottom of every site (except mainsites, like User:Subfader/Article Comments) and I wanted it to open a talkpage to each article (like the extension does by default). On the talkpage I wanted the "leave comment..." statement to stand at the top... beneath the comments should be displayed like [] but the newest ontop.

I came across alot of differculties by trying to achieve this... like:
 * double or tripple posting of the "leave comment..." statement
 * the statement was shown on the wrong sites
 * the statements werent shown on the right sites

Now I thought I should write about it... maybee it hepls some other noobs like me ^^

I will just write what I did... with my changes

First step the normal 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'); $wgArticleCommentDefaults['showurlfield']=false;//removes the URL field from the comment form $wgArticleCommentsNSDisplayList = array(NS_MAIN,NS_TALK,100,102,104,2); //the namespaceID's work (beware to use the right ones)

then I followed the instructions from: []


 * Go to the special page MediaWiki:Article-comments-new-comment
 * Edit the page with

$3 said...      $4 $2

//$3 said... is one of thos small changes that make a difference... this will make the name displayed in the comment link to his userpage


 * Go to the special page Mediawiki:Article-comments-commenter-said
 * Edit the page with

$3 said ...

Also put the following CSS in your theme-CSS (...\mediawiki\skins\monobook)

div.comment { border: 1px solid silver; padding: 1px; margin-bottom: 16px; } div.commenttop { padding: 4px; background: #EEEEEE; } div.username { font: 11px verdana, arial, sans-serif; font-weight: bold; width: auto; float: left; } div.date { width: auto; text-align: right; } div.commentpost { padding: 4px; background: #F9F9F9; }

then i followed the instructions on []

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.



//another change I hade to make

Edit extension/ArticleComments.php, find... # Display the form if (in_array($title->getNamespace, $nsList)) { echo(wfArticleCommentForm($title, $params)); }

to... or maybee copypaste my file

$mystring = $wgTitle; $findme1 = 'discussion'; $findme2 = 'talk'; $pos1 = strpos($mystring, $findme1); $pos2 = strpos($mystring, $findme2); if (in_array($title->getNamespace, $nsList)			&& $wgTitle != 'Main Page' 		&& $wgTitle != 'Other Page' 			) {		if ($pos1 === false && $pos2 === false) {				echo(wfArticleCommentForm($title, $params));#if its not a discussionpage it will perform }   	}
 * 1) Needet to search trough the link to find out if its a talkpage or whatever
 * 1) Display the form,
 * 2) && $wgTitle != 'sitename' on these sites the "leave comment ..." statement wont appear

my ArticleComments.php file

<?php //

hmm i guess that was it...