====== Discussion Plugin ====== ---- plugin ---- description: Add a comments section to Wiki pages. (previous authors: Esther Brunner) author : Gina Häußge, Michael Klier email : dokuwiki@chimeric.de type : syntax, action, admin, helper lastupdate : 2008-10-24 compatible : 2008-05-05 depends : pagelist conflicts : similar : tags : discussion, comments, talk ---- ===== Download ===== ^ Download | [[http://www.chimeric.de/_src/plugin-discussion.tgz|plugin-discussion.tgz]] | ===== Description ===== The Discussion [[plugins|Plugin]] adds a discussion section after your wiki page for user comments. This is useful to separate page content and the discussion thereof and also, if you don't want to give normal users the right to edit the page but still want user contributed notes. A second component of this plugin shows a list of all pages in a namespace with a discussion section (called discussion threads) ordered by most recent comments. This allows you to create a very simple discussion forum in your wiki. ===== Components ===== ==== Discussion Comments ==== ~~DISCUSSION~~ ~~DISCUSSION:off~~ ~~DISCUSSION:closed~~ This is the main part of the plugin. By including the ''%%~~DISCUSSION~~%%'' instruction in your wiki page, a discussion section will be appended after the normal wiki page content. To turn it off again, use ''%%~~DISCUSSION:off~~%%''. If you want to show the existing discussion but don't want to allow new comments / replies, use ''%%~~DISCUSSION:closed~~%%''. After each comment there may be up to three buttons (depending on your rights): * Edit: Registered users can edit their comments; admins can edit all comments. To remove a comment, just edit it, clear the text and save the empty comment -- like you would do with a wiki page. Attention: If there are replies to a comment, removing it will also remove all replies! * Reply: To reply to a comment (vs. commenting on the wiki page content), click the ''Reply'' button. The comment entry form will then be placed accordingly. * Hide / Show: Admins can deactivate and reactivate comments easily by this button. Hidden comments aren't shown to normal users and are displayed dimmed to admins. Of course, the whole DokuWiki [[:|syntax]] can be used in comments as well. But there are problems with headers and footnotes as they may produce conflicting IDs and thus invalid XHTML. I'm looking for a way to either allow only a subset of the wiki syntax or automatically create unique IDs. There is no [[:|toolbar]]. I don't consider this a major drawback, as raw text is usually enough for comments. Advanced users who know the wiki [[:syntax]] are still free to use it. A toolbar for inexperienced users would be nice, but it's currently not possible to reuse the DokuWiki toolbar or a subset thereof. ==== Threads ==== {{threads>[namespace]&[flags]}} ^ [namespace] | the namespace for which you want a discussion thread list; '':'' is the top namespace, ''.'' is the same namespace as the page lies in, ''*'' the whole wiki | required | ^ [flags] | pagelist flags delimited by ''&'', see [[pagelist#flags]] | optional | This displays a list of all pages of the given namespace with a discussion section. The list is sorted by the most recent comment. ===== Configuration ===== The plugin can be configured using DokuWikis configuration manager available in the admin menu. ^ ''automatic'' | automatically enables discussions on all pages | ^ ''allowguests'' | allow/disallow unregistered users to leave comments| ^ ''linkmail'' | link username with the supplied mail address | ^ ''useavatar'' | display avatars (requires the [[plugin:avatar]] plugin) | ^ ''urlfield'' | allow to submit a homepage URL (will be linked with the name unless ''linkmail'' is set)| ^ ''addressfield'' | allow to submit a address | ^ ''adminimport'' | admin can supply all fields (for import only) | ^ ''usecocomment'' | use [[http://cocomment.com|CoComment]] tracking (disabled by default) | ^ ''wikisyntaxok'' | allow [[doku>syntax|wiki syntax]] in comments | ^ ''threads_formposition'' | position of the new thread form | ===== Demo ===== You can try this plugin [[http://chimeric.de/_demo/plugin:discussion|here]]. ===== Bugs ===== Please report bugs at the [[http://bugs.chimeric.de/index.php?project=9&switch=1&do=index|Bug tracker]]. ===== Conversion from old Blog Plugin ===== Since 2006-10-06 the plugin package contains a conversion script to convert discussion pages generated by the [[doku>plugin:blog:old|old Blog Plugin]]((for DokuWiki 2006-03-09 and earlier)) into new .comments meta files. Here is how to do it: - If the name of the discussion namespaces in your wiki was something else than "discussion", you need to edit line 10 of the script first: ''define('DISCUSSION_NS', 'discussion');''. - Run the conversion script by entering the following URL: ''http://path.to/dokuwiki/lib/plugins/discussion/convert.php''. - If you have lots of pages, the script will take quite a while. Don't interrupt it. - After the conversion is done, the script disables itself. If, for any reason, you need to re-run the script, delete the file "convert_completed". ===== Further Resources ===== * [[http://darcs.chimeric.de/darcsweb.cgi?r=discussion|Darcs Repository]] * [[http://bugs.chimeric.de/index.php?project=9&switch=1&do=index|Bug tracker]] * [[http://dev.chimeric.de/codereference/nav.html?plugins/discussion/index.html|Source code]] ===== Changes ===== {{rss>http://darcs.chimeric.de//darcsweb.cgi?r=discussion;a=rss}} ===== FAQ ===== ==== How do I prevent SPAM? ==== The plugin has built-in support for the [[plugin:captcha]] plugin. Additionally, one might also consider to use the [[plugin:badbehaviour|Bad Behavior plugin]]. ==== My dates are shown wrong. What can I do? ==== You're probably not running the latest version of the plugin. Try to update to the latest version first. ==== Is it possible to show the newest entry on top? ==== Not yet but a [[http://bugs.chimeric.de/index.php?do=details&task_id=73|feature request]] has been filed. > I've currently modified the ''_show(...)'' function in actions.php to do this. I'm not sure if it's a good solution (most likely it's not), but right after the comment "now display the comments", insert ''$data['comments'] = array_reverse($data['comments'], true);'' immediately after the isset test and immediately before the foreach loop. This reverses the comment entries before they are iterated.\\ --- //maradori// ===== Discussion ===== I've added a small syntax plugin that allows you to write [[discuss>:some:discussion:somewhere]] which will be replaced by //xx Comments//, linked to :some:discussion:somewhere#discussion__section if there is a discussion on that page. \\ "xx" will be the number of comments on that page. I can't upload it here. With a bit of luck, find it here: \\ http://pike.kw.nl/files/software/pike/recent/php/dokuwiki/discuss.php.txt //*-pike // Is there a possibility to show a text like "Only registered user may discuss" when turning allowguest to false ? --- //[[sokrates013@googlemail.com|Nadir]] 2008/06/05 06:48// > No, you can file a feature request at the bug tracker linked on this page. --- //[[chi@chimeric.de|Michael Klier]] 2008/08/09 10:50// ---- I have the newest version from 2008-08-08, bit the date is still not shown.. only "Y/m/d H:i" in the discussionarticle.. what is wrong? Last modified date in footer is shown correctly? --- //Micha Meyer 2008/08/18 // > DokuWiki version, pagelist plugin version? Are they all up to date? I've had the same problem and made a bugfix in the action.php. action.php uses the strftime function which requires an other laout for string formatting (including % signs). The $conf['dformat'] in the wiki settings is used without % signs (standard DokuWiki use). Change the strftime to dat function and it works correctly| Se the following diff: # diff action.orig action.php 507c507 < strftime($conf['dformat'], $created).''; --- > date($conf['dformat'], $created).''; 509c509 < strftime('%Y-%m-%dT%H:%M:%SZ', $modified).'">'.strftime($conf['dformat'], $modified). --- > strftime('%Y-%m-%dT%H:%M:%SZ', $modified).'">'.date($conf['dformat'], $modified). 879c879 < strftime($conf['dformat'], $comment['date']['created']), --- > date($conf['dformat'], $comment['date']['created']), 900c900 < strftime($conf['dformat'], $comment['date']['created']), --- > date($conf['dformat'], $comment['date']['created']), 1031c1031 < '@DATE@' => strftime($conf['dformat']), --- > '@DATE@' => date($conf['dformat']), Maybe this can be incorparated to the source??? --- //[[l.vgorkum@cjib.minjus.nl|Luitzen van Gorkum]] 2008/09/01 15:29// This works great! Thank you!! --- //Micha Meyer 2008/09/09 // > You're both probably not using the latest DokuWiki version (which uses strftime in the dformat setting)! The plugin works correct ... --- //[[chi@chimeric.de|Michael Klier]] 2008/09/10 23:26// v: 2008-08-08: action.php, line 684. tabindex=="6" should be tabindex="6" ==== have only names required for posting a comment ==== My dokuwiki installation runs locally and in house so that for me a name would be sufficient and I don't need to worry about spam. I had a look at the options but name & email is the simples thing I can do. Is there a simple way to modify the code in order to have only a name required? (or only a email) --- //[[sebastian.spiess@o.u.to.t.ec.com|Sebastian Spiess]] 2008/08/27 00:08// === solved (quick and dirty) === OK, here is what I did and it seems to work. **But** as I have not much of a clue regarding php it might not be the right way to do it. :-? So please FIXME --- //[[sebastian.spiess@ou.t.ot.ec.com|Sebastian Spiess]] 2008/08/27 00:29// I uncommented line 616 to 621 in the //action.php// using ''''
==== Fix of lang sv ==== this is my little fix for the Swedish language translation of this plugin * @auther Gustav Hartvigsson */ $lang['discussion'] = 'Diskussion'; $lang['comment'] = 'Kommentar'; $lang['comments'] = 'Kommentarer'; /*** *Gustavs code * ***/ $lang['date'] = 'Datum'; $lang['entercomment'] = 'Skriv in din kommentar'; $lang['wikisyntax'] = 'wiki syntax är tillåten'; $lang['older'] = 'Äldre Diskussioner'; $lang['newer'] = 'Nyare Diskussioner'; $lang['btn_reply'] = 'Svara'; $lang['btn_hide'] = 'Göm'; $lang['btn_show'] = 'Visa'; $lang['btn_change'] = 'Ändra'; $lang['statuschanged'] = 'Diskussion status ändrad'; $lang['wordblock'] = 'din kommentar blir blockerad som spam.'; $lang['mail_newcomment'] = 'Ny kommentar'; $lang['subscribe'] = 'Prenumerera på denna diskussion'; $lang['status'] = 'Status'; $lang['off'] = 'off'; $lang['open'] = 'Öppna'; $lang['closed'] = 'Stäng'; $lang['reply'] = 'Svara'; $lang['replies'] = 'Svar'; $lang['newthread'] = 'Ny Tråd'; $lang['threads'] = 'Trådar'; //Setup VIM: ex: et ts=2 enc=utf-8 : === Can admins subscribe to all discussions? === Looks like the new version has a feature where users can get email notifications of new changes. Can an admin subscribe to all articles and get notifications for any comments sitewide? // DLO - 08-31-2008 // ==== Latest changes ==== Why posting in discussion does not make the page appear in the "latest changes" list? > Because it would break DokuWikis revisions system. --- //[[chi@chimeric.de|Michael Klier]] 2008/10/08 13:02// >> Alternative: use the pagelist plugin to make an overview of "latest discussion" by using the **%%{{thread>...}}%%** syntax, but I agree that it would be nice to have an overview of both edited and commented pages in one view: eg by including the "commentslist" to the recent changes but with different color.