Was this page helpful?

Create a simple forum in DekiScript

    Table of contents
    No headers

    This code has been superceeded by a more recent rewrite.  If you are interested in implementing a simple forum in your wiki, then please also look at http://deki-examples.wik.is/Template...scussion_Forum

    Create a simple forum in DekiScript Contributors
    Sample Forums Views: 5420
    Resources: 

    This concept was first created and documented by craigsivils.  This is simply a revision that I made to make it a little easier to manage.  I also added class="table" to the <table> tag to have it inherit the correct table CSS form the skin (doesn't work in wiki.developer.mindtouch.com but will work in all other Fiesta skins).  Any and all suggestions, improvements etc are welcome.  Thanks again to craigsivils for starting this awesome DekiScript app. 

    <h1>Simple Forum</h1>
    <p>{{wiki.create("Create New Topic",page.path,_,true,"Put Your Title Here")}}</p>
    <table init="var topics = page.subpages;" block="let topics = list.sort(map.values(topics), _, true, 'date.compare($left.date, $right.date)');" class="table" style="font-size: _cke_saved_style="font-size: 12px;">
        <tbody>
            <tr>
                <th valign="top" style="width: 70%;">Topic/Starter</th>
                <th valign="top" style="width: 15%;">Last Post</th>
                <th valign="top" style="width: 7%;">#Views</th>
                <th valign="top" style="width: 7%;">#Replies</th>
            </tr>
            <tr class="{{__count % 2 == 0 ? 'bg1' : 'bg2'}}" foreach="var t in topics">
                <td init="var revxml = web.xml(t.api..'/revisions?revision=1');"><span style="font-size: 17px; font-weight: bold;">{{web.link(t.uri,t.title)}}</span><br />
                {{var u = wiki.getuser(xml.text(revxml, 'user.author/username'));web.link(u.uri,u.name);}}</td>
                <td>{{t.date}}<br />
                by {{web.link(page.author.uri,page.author.name)}}</td>
                <td>{{t.viewcount}}</td>
                <td>{{#t.comments}}</td>
            </tr>
        </tbody>
    </table>
    
    

    Topic/Starter Last Post #Views #Replies
    mimi
    Object reference not set to an instance of an object (click for details)
    Fri, 01 Jul 2011 20:51:03 GMT
    by melder
    253 0
    test
    Object reference not set to an instance of an object (click for details)
    Tue, 22 Feb 2011 19:36:24 GMT
    by melder
    446 0
    un nouveau topic
    Object reference not set to an instance of an object (click for details)
    Thu, 04 Feb 2010 01:39:33 GMT
    by melder
    716 0
    Mit Problem
    Object reference not set to an instance of an object (click for details)
    Wed, 09 Dec 2009 16:03:09 GMT
    by melder
    954 2
    Put Your Title Here 2
    Object reference not set to an instance of an object (click for details)
    Wed, 29 Apr 2009 20:26:20 GMT
    by melder
    934 0
    Test Topic
    Object reference not set to an instance of an object (click for details)
    Fri, 27 Mar 2009 19:57:25 GMT
    by melder
    993 2
    Test Topic 2
    Object reference not set to an instance of an object (click for details)
    Fri, 27 Mar 2009 19:56:04 GMT
    by melder
    1061 0
    Known errors with the DekiScript Forum
    Object reference not set to an instance of an object (click for details)
    Thu, 12 Mar 2009 19:04:55 GMT
    by melder
    1260 3
    General Forum
    Object reference not set to an instance of an object (click for details)
    Thu, 12 Mar 2009 18:51:00 GMT
    by melder
    1078 2
    Was this page helpful?
    Tag page
    You must login to post a comment.

    Copyright © 2011 MindTouch, Inc. Powered by