+ Reply to Thread
Results 1 to 9 of 9

Thread: How to simulate a forum/discussion board in DekiWiki

  1. #1
    Join Date
    Feb 2008
    Posts
    286

    Default How to simulate a forum/discussion board in DekiWiki

    I finally have a decent simulation of a discussion board inside dekiwiki.

    The code and a working example can be found at http://wiki.developer.mindtouch.com/...a_simple_forum

    Many thanks to Gianluca and SteveB for the outstanding dekiscript examples.

  2. #2
    Join Date
    Jul 2006
    Location
    San Diego, CA
    Posts
    5,450

    Default

    That's freaking brilliant!!! Please move it under MindTouch_Deki/DekiScript/FAQ where all the samples are located.

    Really, very nice. I'm impressed!
    Steve G. Bjorg - Chief Architect
    Did you check the MindTouch FAQ?
    Found a bug? Report it.
    Follow me on Twitter
    Find us on IRC: irc.freenode.net #mindtouch

  3. #3

    Default

    I must be doing something wrong. I get
    <tr foreach="var p in subpages" class="reference to undefined name '__count'">
    <td valign="top">reference to undefined name 'p'</td>
    <td valign="top">reference to undefined name 'authors'</td>
    <td valign="top">reference to undefined name 'p'</td>
    <td valign="top">reference to undefined name 'p'</td>
    <td valign="top">reference to undefined name 'p'</td>

  4. #4
    Join Date
    Feb 2008
    Posts
    286

    Default

    Check the version of the wiki and that you pasted the entire script. I have setup forums on 3 different wiki's that I work with by pasting that script.

  5. #5
    Join Date
    Mar 2008
    Posts
    1,630

    Default

    Very nice indeed. We've been doing a lot of stuff here lately based on similar concepts, but this is a neat twist, particularly the code to sort based on most recent reply.

    At the risk of needlessly poking my nose in, I offer a modified version:
    1) Refactored the code to make fewer redundant function calls. I can only speculate whether this would put marginally less load on the server and perhaps render pages faster, but I find it cleaner and easier to read if nothing else. I perform some of the operations quite differently, some may find it instructive.
    2) Added code to display the originator of the topic, in addition to the most recent commenter.
    3) Reformatted the output a bit to look more like this forum (and more forum-like as a whole.)

    See it here.

  6. #6

    Default

    Not to be a total noob, but how exactly do you add this function to a page? Do you just add it to the custom html section in the visual appearances page?

    Also, will it be then added to every page or can you control which pages have that feature?

    I'd really like to start using this option, it's pretty nice!

  7. #7
    Join Date
    Feb 2007
    Posts
    1,871

    Default

    craigsivil's example can be pasted from the "HTML source" mode when you edit a page - the page you edit should be a parent page of your "forum post" deki pages.

  8. #8
    Join Date
    Feb 2008
    Posts
    286

    Default

    Quote Originally Posted by neilw View Post
    Very nice indeed. We've been doing a lot of stuff here lately based on similar concepts, but this is a neat twist, particularly the code to sort based on most recent reply.

    At the risk of needlessly poking my nose in, I offer a modified version:
    1) Refactored the code to make fewer redundant function calls. I can only speculate whether this would put marginally less load on the server and perhaps render pages faster, but I find it cleaner and easier to read if nothing else. I perform some of the operations quite differently, some may find it instructive.
    2) Added code to display the originator of the topic, in addition to the most recent commenter.
    3) Reformatted the output a bit to look more like this forum (and more forum-like as a whole.)

    See it here.
    Thank you!

    I couldn't find an example of a list of maps, and my few attempts on my own did not go well.

    I love the changes you made, my only comment is that I think you still need one more if statement to check if the edit date is greater than the last comment date. This is to cover the situation where the original post was edited.

    Please feel free to overwrite the code in the FAQ section. I want the best code to be there as an example, and yours is good enough I plan to replace my forum code inside my own wiki's.

    Craig

  9. #9
    Join Date
    Feb 2008
    Posts
    286

    Default

    I added the extra if statement, corrected a date formatting error that was in my original code (used m for minute rather than mm) and moved the code to http://wiki.developer.mindtouch.com/...scussion_board

    It is community code, so please feel free to improve as needed.

+ Reply to Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts