i'm confused by the 'post a comment' inputbox. what should i put in the edit box? the title of the page to post a comment to?
Can i have an easy 'comment on this page' link at the bottom of each page?
What extensions do you know that tackle this issue? i saw LiquidThreads. is there something stable? Is there an extension that integrates javascript, so the user can marks a text in the page and comment about it? this is useful for users to post corrections to pages.
Thanks, Ittay
On 28/12/06, Ittay Dror ittayd@qlusters.com wrote:
Can i have an easy 'comment on this page' link at the bottom of each page?
You've got one in the content actions bar for discussion pages; use of the __NEWSECTIONLINK__ magic word will also force this to appear for normal pages. Using this throws up a standard "add section" editor where the user enters a subject and their comment, and can then sign this and hit Save.
In the default skin, Monobook, this "add section" link shows up as a "+" sign next to the standard "edit" tab.
Rob Church
i wrote this code to allow to easily add comments to the discussion page. it's a special page function that will take a 'target' and 'comment' request parameters and add a wrapped text to the discussion page of 'target'. the entry will be something like: <!-- start entry ---> <div id="discussion_entry"> <table width="100%"> <tr> <td width="50%" valign="top" class="discussion_entry_user">[[User:Root|Root]] said:</td> <td align="right" width="50%" class="discussion_entry_date">On 09:48, 8 January 2007 (IST)<br/></td> </tr> <tr> <td colspan=2 class="discussion_entry_comment">"foobar"</td> </tr> <tr> <td colspan="2" class="discussion_entry_date" padding=5>[[User talk:Root#post|Reply to Root]] </td> </tr> </table> </div> <!-- end entry -->
(the entry layout and use of a special page are from wikihow)
now all i need is to figure out how to add an input box and button without too much hacking to the skin files.
here is the function:
function qwfSpecialPostcomment() { global $wgRequest, $wgOut, $wgUser, $wgContLang, $wgLocaltimezone; $comment = $wgRequest->getVal( 'comment' ); $title = $wgRequest->getVal( 'target' );
# $wgOut->addWikiText("Got $title, $comment"); $titleObj = Title::newFromUrl($title); $talkTitleObj = $titleObj->getTalkPage();
$article = new Article($talkTitleObj);
#$article->insertNewArticle($comment, "new comment", false, false, false, true); $rev = Revision::newFromTitle($article->getTitle());
$oldtext = $rev->getText();
$date = $wgContLang->timeanddate( date( 'YmdHis' ), false, false) . ' (' . date( 'T' ) . ')';
$username = $wgUser->getName(); $nickname = $wgUser->getOption( 'nickname' ); $nickname = $nickname === '' ? $username : $nickname; $userpage = $wgUser->getUserPage(); $sig = '[[' . $userpage->getPrefixedText() . '|' . wfEscapeWikiText( $nickname ) . ']] ' ; $reply = '[[' . $userpage->getTalkPage()->getPrefixedText() . '#post|Reply to ' . wfEscapeWikiText( $nickname ) . ']] ';
$commentEntry = <<<COMMENT <!-- start entry ---> <div id="discussion_entry"> <table width="100%"> <tr> <td width="50%" valign="top" class="discussion_entry_user">$sig said:</td> <td align="right" width="50%" class="discussion_entry_date">On $date<br/></td> </tr> <tr> <td colspan=2 class="discussion_entry_comment">$comment</td> </tr> <tr> <td colspan="2" class="discussion_entry_date" padding=5>$reply</td> </tr> </table> </div> <!-- end entry --> COMMENT; $text = $oldtext . "\n\n" . $commentEntry;
$article->updateArticle($text, '', false, false);
$wgOut->redirect($titleObj->getFullUrl()); return; }
Rob Church wrote:
On 28/12/06, Ittay Dror ittayd@qlusters.com wrote:
Can i have an easy 'comment on this page' link at the bottom of each page?
You've got one in the content actions bar for discussion pages; use of the __NEWSECTIONLINK__ magic word will also force this to appear for normal pages. Using this throws up a standard "add section" editor where the user enters a subject and their comment, and can then sign this and hit Save.
In the default skin, Monobook, this "add section" link shows up as a "+" sign next to the standard "edit" tab.
Rob Church _______________________________________________ MediaWiki-l mailing list MediaWiki-l@Wikimedia.org http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
i wrote this code to allow to easily add comments to the discussion page. it's a special page function that will take a 'target' and 'comment' request parameters and add a wrapped text to the discussion page of 'target'.
This looks interesting! Would you consider this production-ready? Also, have you considered turning this into a proper extension so other users can easily add it to their MediaWiki setup?
-- F.
my code is written as an extension, i'll post it soon. i also changed it so it is an ajax action (no special page)
but, in order for the form to appear, i have modified Monobook.php and monobook/main.css: - is there a way for an extension to add elements to Monobook.php? - how can i make the form appear only on article pages (not talk or special)?
Frederik Dohr wrote:
i wrote this code to allow to easily add comments to the discussion page. it's a special page function that will take a 'target' and 'comment' request parameters and add a wrapped text to the discussion page of 'target'.
This looks interesting! Would you consider this production-ready? Also, have you considered turning this into a proper extension so other users can easily add it to their MediaWiki setup?
-- F.
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
mediawiki-l@lists.wikimedia.org