Hi
there,
--
DokuWiki mailing list - more info at
http://wiki.splitbrain.org/wiki:mailinglist
I'm new. To this list. To wikis. To DokuWiki. And ... unfortunately ;) ... to PHP. But I am willing to contribute more than some whishes and I am willing to learn. I thought about a discussion-feature like e.g. wikipedia has: a button or action-link leading from namespace:wikipage to discussion:namespace:wikipage. And back again of course. The existing plugins proposing discussion-features are more giving opportunity for "commenting" than "discussing". I love to use them in blog-like pages later on, but first I have to build up the very wiki-part of my site. Not knowing, if anyone else here started to work such a feature, I stumbled around a lot in my main.php and am happy to announce, that the feature nearly is ready. I am including the snippet later in this e-mail. And you can see it at work on http://www.litwiki.de/doku.php (you will immediately see the problem(s), when klicking around) For those of you speaking german - don't mind the content, it is all **very beta** there. This is the way I suppose the feature to be helpful to other DW-user, every comment, critique etc. is welcome and considered to be helpful as I surely do not have your deep knowlegde of what, where and how @DW: 1. switch the feature on/off in local.php e.g. with a var named $conf['discuss'] = 0|1 2. set namespace and the label of the button or (action?)link in lang.php e.g. $discussNS, $btn_discuss + $btn_article 3. have a $tpl_discuss to use in other templates than DW's 4. in DW's template, a "discuss this article"-button next to "edit" and "old revisions" is proposed (as I am working around with g21's mediawiki-like-template, I am using the feature as a (action)link and not as a button) So here is the code-snippet, which at the moment is included directly to main.php... <?php /** * Discussion feature to DokuWiki [in development!] * * @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 = 'diskussion'; // open discussion-pages in which namespace? $btn_discuss = 'Diskussion'; // label link/button to discussion-page $btn_article = 'Zurück zum Artikel'; // label link/button back to the "mothership-article" $wikipath = 'http://www.litwiki.de/doku.php/'; // there must be a better way! // check how $ID is separated if ($conf['useslash'] == '0') { $ns = ':'; } else { $ns = '/'; } // 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='' class='action discuss'>$btn_discuss</a>"; echo $discussLINK; } else { // determine the back-to-article link $articleID = $idknack[1].$ns.$idknack[2].$ns.$idknack[3].$ns.$idknack[4].$ns.$idknack[5].$ns.$idknack[6]; $articleLINK = "<a href='' class='action article'>$btn_article</a>"; echo $articleLINK; } ?> So there are the two sort of things to work on: 1. in the code itself 1.a - there must be a better way to get the $wikipath? $wikipath is dependant on A) what $conf['userewrite'] is set in local.php B) if $conf['userewrite'] = 1 on how .htaccess is configured C) if $conf['userewrite'] = 0 or 2 on where doku.php is lying around on server/domain and on if it is renamed(!) 1.b - how to clean up the back-to-article-link from obsolete $ns? I wasn't able to handle preg_match... ;o) 2. if feature is considered to be good by community and/or master of DW - include feature into DW's architecture 2.a - put the function where such a function belongs to 2.b - add necessary vars to lang.php and dokuwiki.php 2.c - create necessary template-buttons/links in template.php 2.d ......? (I am not sure if this is all...?) So thank you for your attention and for reading this far. I am open to any kind of commentation & critics. And to further development of course. ;) Greeting from Germany... Freddy |