[dokuwiki] Re: feature: discussion (WP-like), necessary? and who helps to work it out?

  • From: "litwiki.de" <w@xxxxxxxxxx>
  • To: dokuwiki@xxxxxxxxxxxxx
  • Date: Sun, 16 Oct 2005 20:44:30 +0200

Hi Chris,

thank you very much for your welcome & support. I got "my" discussion feature work and only language definition left for manual adjustment so far. Included at bottom of mail...

About where/how to specify discussionNS:

Chris Smith schrieb:

While a discussion namespace may work, I think you are better off using the same name and using a different extension, perhaps .discuss (or even _discuss.txt allowing the discussion to be accessed as a wiki page). you would also need to think about some system to apply access control to the discussion page.

My goals where:

1. discussion page should be accessed / used the same way as a wikipage. But maybe there is an advantage in creating a wikipage_discuss.txt or a wikipage.discuss?

2. I chose a separate discussion-NS to allow discussion globally. e.g. if there is a wikipage with rules, impressum or such things, there maybe a need to set them "read only" to users / visitors. Even though, they may want to discuss the content. Rules e.g. ... In my personal wiki-ethics ;o) discussion is always free to everyone, even if contribution in some (small) parts may be reserved to @user or even @admin. So a root-level-NS seemed convenient to me (as it obviously was to WP as well ;o) ).

But maybe there is someone who likes to program a switch for where to add discussNS: in front or at the end of article's $ID...?

On my part, there remains only the question if this feature is helpful to DokuWiki's sourcecode. If yes, who will do this, if not I otherwise try to include it a little more usefull, than directly to main.php in my DW-installation.

Freddy

Thank you very much, once more. I am proud to have completed my first feature in php quite smooth now:

<?php

/**
* Discussion feature to DokuWiki [betaversion: for use in main.php]
*
* @license    GPL 2 (http://www.gnu.org/licenses/gpl.html)
* @author     Friederike Wenner <f [dot] wenner [at] gmx [dot] de>
*/

 global $ID;
 global $ACT;

// @todo adjust these strings for localization! Can later be placed in lang.php.
$discussNS = 'discussion'; //root-level namespace for your wiki's discussion
$btn_discuss = 'discuss this page'; //label your link or button
$btn_article = 'back to article'; //label link/button back to article



// check how $ID is separated if ($conf['useslash'] == '0') { $ns = ':'; } else { $ns = '/'; }

 // prepare wikilink
 $wikipath          = wl();

 // check if we aren't already in discussionNS
 $idknack = explode($ns, $ID);
 if (!($idknack[0] == $discussNS)) {

// determine the discussion file and link
$discussID = $discussNS.$ns.$ID;
$discussLINK = "<a href='$wikipath$discussID' class='action discuss'>$btn_discuss</a>";
echo $discussLINK;
}
else {
// determine the back-to-article link
$articleID = substr($ID,strlen($discussNS)+1);
$articleLINK = "<a href='$wikipath$articleID' class='action article'>$btn_article</a>";
echo $articleLINK;
}
?>


See it work at:
http://www.litwiki.de/doku.php
--
DokuWiki mailing list - more info at
http://wiki.splitbrain.org/wiki:mailinglist

Other related posts: