DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:discussion

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
plugin:discussion [2017-09-22 09:10] – [Discussion Plugin] 222.247.47.162plugin:discussion [2024-02-06 08:11] (current) – [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?] Aleksandr
Line 6: Line 6:
 email      : michael@content-space.de email      : michael@content-space.de
 type       : syntax, action, admin, helper type       : syntax, action, admin, helper
-lastupdate : 2017-08-24 +lastupdate : 2021-12-31 
-compatible : Detritus, Hrun, Ponder Stibbons, Elenor of Tsort, Frusterick Manners+compatible : Detritus, Hrun, Ponder Stibbons, Elenor of Tsort, Frusterick Manners, Greebo, Hogfather
 depends    : pagelist depends    : pagelist
 conflicts  : sidebar # please report also an issue report about the conflict conflicts  : sidebar # please report also an issue report about the conflict
Line 16: Line 16:
 sourcerepo : https://github.com/dokufreaks/plugin-discussion sourcerepo : https://github.com/dokufreaks/plugin-discussion
 ---- ----
 +
 ===== Description ===== ===== 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. +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. 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.
Line 25: Line 26:
  
 ==== Comments-section ==== ==== 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~~%%''. 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~~
Line 33: Line 35:
   ~~DISCUSSION|Custom Title String~~   ~~DISCUSSION|Custom Title String~~
   ~~DISCUSSION:closed|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): After each comment in the discussion section there may be up to three buttons (depending on your rights):
Line 40: Line 40:
   * 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.   * 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.   * 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!// +  * 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.+  * 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 [[:wiki:syntax|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.
  
-Of course, the whole DokuWiki [[:wiki:syntax|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 ====
  
-==== 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. This displays a list of all pages of the given namespace with a discussion section. The list is sorted by the most recent comment.
  
Line 55: Line 55:
 ^ [flags] | pagelist flags delimited by ''&'', see [[pagelist#flags]] | optional | ^ [flags] | pagelist flags delimited by ''&'', see [[pagelist#flags]] | optional |
 ^ skipempty | Do not print discussions with no comments | 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. 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 ===== ===== Configuration =====
 +
 The plugin can be configured using DokuWiki's configuration manager available in the admin menu. The plugin can be configured using DokuWiki's configuration manager available in the admin menu.
  
 ^ ''automatic'' | automatically enables discussions on all pages | ^ ''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)/%%'' )| +^ ''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 discussion section |+^ ''visibilityButton'' | Enable button for toggling the visibility of the entire discussion section |
 ^ ''allowguests'' | allow/disallow unregistered users to leave comments| ^ ''allowguests'' | allow/disallow unregistered users to leave comments|
 ^ ''showguests'' | show/hide comments to unregistered users | ^ ''showguests'' | show/hide comments to unregistered users |
 ^ ''linkmail'' | link username with the supplied mail address | ^ ''linkmail'' | link username with the supplied mail address |
-^ ''useavatar'' | display avatars (requires the [[plugin:avatar]] plugin) |+^ ''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)| ^ ''urlfield'' | allow to submit a homepage URL (will be linked with the name unless ''linkmail'' is set)|
 ^ ''addressfield'' | allow to submit a address | ^ ''addressfield'' | allow to submit a address |
 ^ ''adminimport'' | admin can supply all fields (for import only) | ^ ''adminimport'' | admin can supply all fields (for import only) |
-^ ''wikisyntaxok'' | allow [[doku>syntax|wiki syntax]] in comments((Uncheck this parameter to avoid problems with the {{https://www.dokuwiki.org/plugin:struct|struct plugin}})) |+^ ''wikisyntaxok'' | allow [[wiki:syntax|wiki syntax]] in comments((Uncheck this parameter to avoid problems with the [[plugin:struct|Struct plugin]] )) |
 ^ ''threads_formposition'' | position of the new thread form shown with the %%{{threads> }}%% syntax (before or below the thread listing) | ^ ''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) |+^ ''subscribe'' | allow comment subscription (uses double opt-in), if [[config:subscribers|page-subscriptions]] are used it is only used for not-logged users. |
 ^ ''newestfirst'' | Invert the comments display order | ^ ''newestfirst'' | Invert the comments display order |
 ^ ''usethreading'' | enable/disable threaded comments | ^ ''usethreading'' | enable/disable threaded comments |
Line 88: Line 89:
  
 ===== Changes ===== ===== Changes =====
 +
 {{rss>https://github.com/dokufreaks/plugin-discussion/commits/master.atom date}} {{rss>https://github.com/dokufreaks/plugin-discussion/commits/master.atom date}}
  
Line 97: Line 99:
   * **2013-07-01**: Fix the captcha check for logged-in users   * **2013-07-01**: Fix the captcha check for logged-in users
   * **2013-06-18**:   * **2013-06-18**:
-    * Make the discussion plugin compatible with current versions of the [[captcha]] plugin+    * Make the discussion plugin compatible with current versions of the [[Captcha]] plugin
     * Add the option to specify separate moderator groups for comments     * 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     * Use jQuery instead of the old JavaScript library, this makes the plugin compatible with DokuWiki version Weatherwax
Line 103: Line 105:
  
 ===== FAQ ===== ===== FAQ =====
- 
  
 ==== How do I allow plugin formatting within discussions?  ==== ==== 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.+ 
 +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? ==== ==== 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]]. 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? ==== ==== Is it possible to show the newest entry on top? ====
 +
 Yes, use the ''newestfirst'' config option. Yes, use the ''newestfirst'' config option.
  
 ==== Can admins subscribe to all discussions? ==== ==== Can admins subscribe to all discussions? ====
 +
 If you enable the [[config:notify]] option admins are notified for all comments. If you enable the [[config:notify]] option admins are notified for all comments.
  
 +==== 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" 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. 
 +<code php 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';
 +</code>
 ==== Where are discussions saved? ==== ==== 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. 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? ==== ==== How can I change the discussion box size? ====
 +
 You can change the size of the box by using the following CSS class: You can change the size of the box by using the following CSS class:
  
Line 131: Line 158:
  
 ==== Why do comments not appear in the latest changes list? ==== ==== Why do comments not appear in the latest changes list? ====
 +
 Because it would break DokuWiki's revisions system. 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. Alternative: use the pagelist plugin to make an overview of "latest discussion" by using the **%%{{threads>...}}%%** 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)? ==== ==== Is it somehow possible to show all discussions on one page (like in the admin area)? ====
 +
 You can list all discussions with: You can list all discussions with:
   {{threads>*}}   {{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 ==== ==== 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 ====
Line 146: Line 184:
 Discussions aren't stored like regular wiki pages. This will not work. 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. 
  
 ==== Removing the shown IP of a guest comment and replacing it with 'Guest: name' ==== ==== 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) 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']);+  $comment['user']['id'] = 'test'.hsc($_REQUEST['user']);
  
 and replace it with and replace it with
  
-$comment['user']['id'] = 'GUEST: '.hsc($_REQUEST['name']); +  $comment['user']['id'] = 'GUEST: '.hsc($_REQUEST['name']); 
-test +     
-==== Is ist possible to disable the email box for guest comments? ====+
  
-I'm not developer of the plugin but I believe you can do this if you comment out the following lines 283-287 and 291:+==== When add ~~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 [[https://github.com/dokufreaks/plugin-discussion/issues/316|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. 
 +              
  
-<code>                        
- // if(empty($_REQUEST['name']) or empty($_REQUEST['mail'])) return; 
- // if(!mail_isvalid($_REQUEST['mail'])) { 
- // msg($lang['regbadmail'], -1); 
- // return; 
- // } else { 
- $comment['user']['id'] = 'test'.hsc($_REQUEST['user']); 
- $comment['user']['name'] = hsc($_REQUEST['name']); 
- $comment['user']['mail'] = hsc($_REQUEST['mail']); 
- // }                   
-</code> 
- 
-and lines 983 - 988:                         
-                         
-<code> 
-              <!--<div class="comment_mail"> 
-                <label class="block" for="discussion__comment_mail"> 
-                   <span><?php echo $lang['email'] ?>:</span> 
-                      <input type="text" class="edit<?php if($_REQUEST['comment'] == 'add' && empty($_REQUEST['mail'])) echo ' error'?>" name="mail" id="discussion__comment_mail" size="50" tabindex="2" value="<?php echo hsc($_REQUEST['mail'])?>" /> 
-                </label> 
-              </div>-->  
-               
-</code> 
-                         
-in action.php inside the plugins directory. Anonymous users won't be able to subscribe tho. Please correct me if I'm breaking some other function with this. Until now there hasn't been a problem tho. Andy                      
-==== Hello, how to increase the size of the input form of the comments? I mean the white rectangle is only one row. How can i make it do be two or more lines? ==== 
 ===== Issues and feature requests ===== ===== Issues and feature requests =====
  
Line 200: Line 207:
   * You can add and improve translations at http://translate.dokuwiki.org/plugin/discussion   * You can add and improve translations at http://translate.dokuwiki.org/plugin/discussion
  
-=====Discussion====+===== Discussion ====
 For the discussion refer to the [[plugin:discussion:discussion|discussion]] page. For the discussion refer to the [[plugin:discussion:discussion|discussion]] page.
plugin/discussion.1506064226.txt.gz · Last modified: 2017-09-22 09:10 by 222.247.47.162

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki