Discussion Plugin

discussion plugin by Gina Häußge, Michael Klier
Add a comments section to Wiki pages. (previous authors: Esther Brunner)

Last updated on 2009-05-11. Provides Syntax, Helper, Admin, Action.
Compatible with DokuWiki 2009-04-14, 2008-05-05.

Requires pagelist.
Similar to blogtng, disqus.

Tagged with comments, discussion, talk.

Download

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

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 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
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)
usecocomment use CoComment tracking (disabled by default)
wikisyntaxok allow wiki syntax in comments
threads_formposition position of the new thread form
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 live demo.

Conversion from old Blog Plugin

Since 2006-10-06 the plugin package contains a conversion script to convert discussion pages generated by the old Blog Plugin1) into new .comments meta files. Here is how to do it:

  1. 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');.
  2. Run the conversion script by entering the following URL: http://path.to/dokuwiki/lib/plugins/discussion/convert.php.
  3. If you have lots of pages, the script will take quite a while. Don't interrupt it.
  4. 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”.

Bugs / Feature Requests

Please report bugs or feature requests at the Bug tracker.

Further Resources

Changes

FAQ

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.

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 notify option admins are notified for all comments.

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 {{thread>...}} syntax.

Is it somehow possible to show all discussions on one page (like in the admin area)?

Is it possible to only display pages with comments in the discussion area using Threads?

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

Sidebar-Plugin

I use the sidebar plugin. Now I tried to use the discussion plugin too. But it seems there is a conflict. Discussions are only displayed at the sidebar page, not on the others. Is there any solution for this problem?

Greetings Maik


Like Maik above, and like “Ham”, who added a note under the sidebar plugin, the discussion and sidebar plugins do not seem to work together for me either.

When I enable the sidebar plugin through the administrator's configuration settings, discussion boxes disappear.

When I disable the sidebar plugin through the administrator's configuration settings, discussion boxes re-appear.

I'm using

  1. DokuWiki version 20090214-1 (Debian Linux)
  2. discussion plugin version 2009-05-11
  3. sidebar plugin version 2009-06-05
  4. mmKanso template version 2.5

It seems to me that this might be further diagnosed by

  1. enabling debugging,
  2. experimenting with various administrative configurations of
    1. the sidebar plugin,
    2. the discussion plugin,
    3. the mmKanso template, and
  3. involving the plugins' authors.

June 17, 2009
Kingsley


Update: Enabling debugging and experimenting with administrative configurations didn't work.

June 17, 2009
Kingsley


Update 2: The discussion and sidebar plugins also conflict when used with the “default” template.

June 19, 2009
Kingsley

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 and email is the simplest 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 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 FIXMESebastian Spiess 2008/08/27 00:29

I uncommented line 616 to 621 in the action.php using <!– xxx –>

<div class="comment_mail">
                <label class="block" for="discussion__comment_mail">
                  <span><?php echo $lang['email'] ?>:</span>
                  <input type="text" class="edit" name="mail" id="discussion__comment_mail" size="50" tabindex="2" value="<?php echo hsc($_REQUEST['mail'])?>" />
                </label>
              </div>

Further functionality

About Edit, Delete and Hide buttons : Can the discussion plugin be configured in order to let some non admin user use this buttons in the discussion section ?

Cordially,

Etienne Fort ~ fortetienne@gmail.com

Switching off

Using ~~DISCUSSION:off~~ doesn't work all the time when global discussion is off. I noticed that sometimes it works again adding a newline before and after ~~DISCUSSION:off~~. Any same experiences and how to resolve it are welcome. (version 2008-07-12, DokuWiki 2008-05-05) RH

Please post bugs at the bug tracker linked on this page. Thanks! — Michael Klier 2009/01/07 12:12

Subscribing to Comments

Even with the configuration setting turned on, I do not see the “Subscribe to comments” checkbox. Are there additional settings that need to be configured? Fantastic Plug-in, by the way.

If you have 'useacl' set for the wiki, and you do not allow unregistered users to post comments, then the checkbox won't be shown. In this case, users subscribed to the page/namespace will be subscribed to comments. But this only works when there is a 'notify' address configured. http://bugs.chimeric.de/index.php?do=details&task_id=114&project=9
Even with useacl, subscribe to comments and allow unregistered comments selected I am unable to subscribe to the discussion section of an entry. Any other ideas?

Comments only visible for logged in users?

Is it possible to show comments only to logged in users? I have set comments in the way that only logged in users can write comments and write in articles. Currently all comments are visible for any visitor, but I would like to show the comments only to those who are logged in. Is it possible to show comments only to logged in users?

Thank you very much!

Markus

Prefilled Name + eMail + Date

How about prefilled Name, eMailadress and Date? My Users (internal DokuWiki) are complaining that they should Type in there Data every Time they want to discuss. Now they are mostly not use it anymore because of that. All of them have their Data correctly in the Wiki user Data, so all what is needed is to take this existing Data and prefill the Form with it.

2009-02-19 muetze

When they are logged in to the wiki they don't have to type their credentials. — Michael Klier 2009/05/11 11:45

After an entry is saved by a logged-in user the message's attribution line contains only the date and no name. With the form present (no one is logged-in) the name shows up fine. Possible bug? Using latest DokuWiki (2009-02-14)

2009-06-11 ham

AutoSubmit issue

After clicking on toolbar “Horizontal Rule” form doing submit. — Mikhail I. Izmestev 2009/05/28

Probable encoding issue

Discussion plugin doesn't work for pages edited locally (UTF-8 encoded), then uploaded. It works though when discussion is enabled on every page through the configuration manager, or when the discussion instruction is typed in the wiki directly. — Beñat Dagorret 2009/05/29

Runaway Comments

2009-2-14 release: adding a single comment seems to send the wiki off into an infinite loop producing literally hundreds of copies of that comment. Sorry to raise the issue here, but this a serious problem for us. An identical (copy of the) installation on a laptop runs fine (Apache server) but on the main server )IIS goes crazy. Help please!

comment me

I add function utf8_encode($s) { return iconv('iso-8859-1', 'utf-8', $s);}

function utf8_decode($s) { return iconv('utf-8', 'iso-8859-1', $s);} and all work

Archive Stale Threads

I really love the Discussion plugin, but once the discussion gets long it is hard to navigate.

Is it possible to have stale threads (say threads that have been inactive for more than a certain period of time) moved to an archive section that is accessible by a link? – A. Pascall, 2009-6-29

1) for DokuWiki 2006-03-09 and earlier
 
plugin/discussion.txt · Last modified: 2009/07/04 04:33 by 87.251.148.161
 
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Noncommercial-Share Alike 3.0 Unported
Imprint Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki
WikiForumIRCBugsDarcsXRefTranslate