Table of Contents
Discussion Plugin
Compatible with DokuWiki
- 2024-02-06 "Kaos" unknown
- 2023-04-04 "Jack Jackrum" unknown
- 2022-07-31 "Igor" unknown
- 2020-07-29 "Hogfather" yes
Description
The Discussion 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
Comments-section
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~~
.
~~DISCUSSION~~ ~~DISCUSSION:off~~ ~~DISCUSSION:closed~~
A custom title can be appended after the separator |.
~~DISCUSSION|Custom Title String~~ ~~DISCUSSION:closed|Custom Title String~~
After each comment in the discussion section there may be up to three buttons (depending on your rights):
- 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. - 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.
- Delete: Registered users and admin all comments.
Attention: If there are replies to a comment, removing it will also remove all replies! - 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. Registered users can only hide their own comments. Hiding a comment, is hiding its replies as well.
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 syntax
This displays a list of all pages of the given namespace with a discussion section. The list is sorted by the most recent comment.
{{threads>[namespace]&[count=n]&[flags]&skipempty}}
[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 |
---|---|---|
[count=n] | the number of discussions which should be displayed (valid values: n > 0) | optional |
[flags] | pagelist flags delimited by & , see flags | optional |
skipempty | Do not print discussions with no comments | optional |
nonewthreadform | Do not show the new thread form form below the table | optional |
Default a new thread form is shown below the list. See threads_formposition
setting for moving it to the top of the list, or to disable this form.
Configuration
The plugin can be configured using DokuWiki's configuration manager available in the admin menu.
automatic | automatically enables discussions on all pages |
---|---|
excluded_ns | list of namespaces for which to revert the automatic config setting (a regular expression e.g. /(playground|wiki)/ , delimiter should be included e.g. '/' at start and end ) |
visibilityButton | Enable button for toggling the visibility of the entire discussion section |
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 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) |
wikisyntaxok | allow wiki syntax in comments1) |
threads_formposition | position of the new thread form shown with the {{threads> }} syntax (before or below the thread listing) |
subscribe | allow comment subscription (uses double opt-in), if page-subscriptions are used it is only used for not-logged users. |
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 |
moderatorgroups | add groups to delegate administrative control (e. g. @coadmins,@mods ) |
moderatorsnotify | send a notification to all specified moderators whenever a new comment was submitted |
Bugs / Feature Requests
Please report bugs or feature requests at the Bug tracker.
Changes
- Merge pull request #348 from atisne/fix-avoid_warning (2024-02-13 16:28)
- PHP8: Avoid warnings (2024-02-13 16:22)
- Merge pull request #345 from dokuwiki-translate/lang_update_707_16956… (2023-09-25 22:00)
- translation update (2023-09-25 21:15)
- Merge pull request #343 from dokuwiki-translate/lang_update_686_16904… (2023-07-27 12:13)
- translation update (2023-07-27 00:56)
- Merge pull request #342 from dokuwiki-translate/lang_update_654_16866… (2023-06-13 09:45)
- translation update (2023-06-13 06:10)
- 2013-10-29:
- Use the current mailer API of DokuWiki, this fixes problems with PHP installations with disabled /e modifier. This makes the plugin incompatible with DokuWiki versions older than Adora Belle (2012-09-10)
- Fix the unsubscribe link in notification mails for logged in users
- Re-implemented the enable/disable handling, comments are disabled automatically now when the discussion syntax is removed and automatic discussions are disabled.
- Translation updates
- 2013-07-01: Fix the captcha check for logged-in users
- 2013-06-18:
- Make the discussion plugin compatible with current versions of the Captcha plugin
- Add the option to specify separate moderator groups for comments
- Use jQuery instead of the old JavaScript library, this makes the plugin compatible with DokuWiki version Weatherwax
- 2013-02-15: Security fix (XSS vulnerability), if you are using an older version of the discussion plugin you should upgrade ASAP!
FAQ
How do I allow plugin formatting within discussions?
I have DokuWiki formatting allowed in comments. I also have a LaTeX plugin. <math>\sum_x{x+5}</math> is not rendered within a discussion.
How do I prevent SPAM?
The plugin has built-in support for the CAPTCHA plugin. Additionally, one might also consider to use the Bad Behavior plugin.
Is it possible to show the newest entry on top?
Yes, use the newestfirst
config option.
Can admins subscribe to all discussions?
If you enable the notify option admins are notified for all comments.
How can I subscribe to a RSS feed of all discussionsor 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” is activated in the configuration, which enables subscriptions for changes per page and/or namespace.
Howto rename all Discussion section titles?
You can overwrite translated strings such as the default title with your own text.
- conf/plugin_lang/discussion/en/lang.php
<?php /** * Customization of the english language file * Copy only the strings that needs to be modified */ $lang['discussion'] = 'Discussion';
Where are discussions saved?
The comments are saved in special meta files inside the <dokuwiki>/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 {{threads>...}} syntax.
Is it somehow possible to show all discussions on one page (like in the admin area)?
You can list all discussions with:
{{threads>*}}
Beware that hidden comments are not shown. Not even to administrators.
This example
{{threads>:namespace_abc&nouser&header&skipempty&nonewthreadform}}
shows a list of pages inside namespace_abc with
- all pages which have comments, skipping the empty ones caused by e.g. deletion.
- columns Page including a link to the page, Date and Number of comments which is also a link to the comments section of the page. The usual User column is omitted as indicated by nouser.
- headers for each column.
- no new thread form below the list.
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.
Removing the shown IP of a guest comment and replacing it with 'Guest: name'
You will need to edit a line in the 'action.php' file which can be found in lib→plugins. Find the following line (281)
$comment['user']['id'] = 'test'.hsc($_REQUEST['user']);
and replace it with
$comment['user']['id'] = 'GUEST: '.hsc($_REQUEST['name']);
When I add a ~~DISCUSSION~~ to a page the toolbar for the editor for the main page text changes to the one for the discussion submission box with buttons like that for media removed. Is this expected behaviour?
I've detailed this issue but am unable to work around the problem that, with my wiki, I can't insert media on pages that also have discussions as the main page edit toolbar is replaced with the reduced toolbar for the discussions.
Issues and feature requests
Please report any bugs or feature wishes in the issue tracker!
- Please don't simply add other plugins as conflicts without explaining which part is broken either by reporting an issue (preferred) or explaining it on the discussion page.
- You can add and improve translations at http://translate.dokuwiki.org/plugin/discussion
Discussion
For the discussion refer to the discussion page.