====== 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 : 2010-11-16 compatible : 2010-11-07 (Anteater) depends : pagelist conflicts : sidebar similar : tags : discussion downloadurl: https://github.com/dokufreaks/plugin-discussion/tarball/master bugtracker : https://github.com/dokufreaks/plugin-discussion/issues sourcerepo : https://github.com/dokufreaks/plugin-discussion/ ---- ===== Download ===== ^ Download | [[http://github.com/dokufreaks/plugin-discussion/tarball/master|Latest Archive]] | ===== 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~~ ~~DISCUSSION|Custom Title String~~ ~~DISCUSSION:closed|Custom Title String~~ 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~~%%''. A custom title can be appended after the separator %%|%%. 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. ==== 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 DokuWiki's configuration manager available in the admin menu. ^ ''automatic'' | automatically enables discussions on all pages | ^ ''allowguests'' | allow/disallow unregistered users to leave comments| ^ ''showguests'' | show/hide comments to unregistered users | ^ ''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 (before or below the thread listing) | ^ ''subscribe'' | allow comment subscription (uses double opt-in) | ^ ''newestfirst'' | Invert the comments display order | ^ ''usethreading'' | enable/disable threaded comments | ^ ''userealname'' | Display the real name instead of the user name of registered wiki users | ^ ''moderate'' | moderate new comments | ===== Demo ===== You can try this plugin using the [[http://chimeric.de/_demo/plugin:discussion|live demo]].FIXME (link broken) ===== Bugs / Feature Requests ===== Please report bugs or feature requests at the [[http://github.com/dokufreaks/plugin-discussion/issues|Bug tracker]]. ===== Further Resources ===== * [[http://github.com/dokufreaks/plugin-discussion/tree/master|Git Repository]] * [[http://github.com/dokufreaks/plugin-discussion/issues|Bug Tracker]] ===== Changes ===== {{rss>http://github.com/feeds/dokufreaks/commits/plugin-discussion/master date}} ===== FAQ ===== ==== How do I allow plugin formatting within discussions? ==== I have DokuWiki formatting allowed in comments. I also have a LaTeX plugin. \sum_x{x+5} is not rendered within a discussion. ==== 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? ==== Yes, use the ''newestfirst'' option. ==== Can admins subscribe to all discussions? ==== If you enable the [[config:notify]] option admins are notified for all comments. ==== Where are discussions saved? ==== The comments are saved in special meta files inside the ''/data/meta'' directory. Each page which has a discussion has a corresponding ''pagename.comments'' file. ==== How can I change the discussion box size? ==== You can change the size of the box by using the following CSS class: div.dokuwiki div.comment_wrapper {} ==== Why do comments not appear in the latest changes list? ==== Because it would break DokuWiki's revisions system. Alternative: use the pagelist plugin to make an overview of "latest discussion" by using the **%%{{thread>...}}%%** syntax. ==== When I use the sidebar plugin the discussions disappear. ===== This is a know problem with the sidebar plugin which needs to be fixed by it's author. If you're looking for working alternatives in the meanwhile I suggest to have a look at the [[plugin:sidebarng|sidebarng plugin]]. ==== Is it somehow possible to show all discussions on one page (like in the admin area)? ==== You can list all discussions with: {{threads>*}} ==== i can add tags to a discussion, but they don't seem to end up in the tag cloud, or being noticed by the tag plugin ==== Discussions aren't stored like regular wiki pages. This will not work. ==== How can I subscribe to a RSS feed of all discussions or threads ==== This is possible using the [[feed]] plugin, please see there how it works. ==== No subscribe/unsubscribe to comments for logged-in users ==== The plugin disables subscription for logged-in users when the option "subscribers" ($conf['subscribers']) is activated in the configuration. ==== send_redirect() error ==== When you submit a discussion post, you may get the following error: Call to undefined function send_redirect() This is because you're running an older version of dokuwiki that does not support the send_redirect() function. There are a few options to remedy this. - Upgrade to a later version of DokuWiki - Pull the send_redirect() function from the source code of a later version dokuwiki and put it in lib/plugins/discussion/action.php or in inc/common.php - Edit lib/plugins/discussion/action.php file and comment out the call to send_redirect() (around line 306), replacing it with something like this: print "Redirecting to $url"; Newest development version of the plugin (since [[https://github.com/dokufreaks/plugin-discussion/pull/34|pull-request 34]]) should not have that problem with 2008-05-05 anymore, but not all current features may work with 2008-05-05 (preview and subscription for example). ==== Wrong URL is used by the plugin manager ==== After upgrading to "Anteater" the discussion-plugin doesn't work in my DW too. The url of the discussion-plugin has changed. Now, I installed the plugin from this url: [[https://github.com/downloads/dokufreaks/plugin-discussion/plugin-discussion.tgz|Discussion-Plugin]] and it works fine again. :) (I got help on IRC #dokuwiki) --- [[user>leolein]] //2010/11/20 19:40// ==== Prevent displaying ip addresses of guest user ==== Change the following line (#249) in action.php $comment['user']['id'] = 'test'.hsc($_REQUEST['user']); to $comment['user']['id'] = 'Guest'; ===== Discussion-box appears although it is disabled by ~~Discussion:off~~ ===== I've solved this by changing in ''syntax/comments.php'' if ($match == ':off') $status = 0; else if ($match == ':closed') $status = 2; else $status = 1; Into if ($match == ':open') $status = 1; else if ($match == ':closed') $status = 2; else $status = 0; ===== Localization ===== ===== Discussion/Comments ===== Please refer to the [[plugin:discussion:discussion|discussion]] page.