|
Cookbook /
How to create ZAPForumSummary: Step by step instructions for creating a forum using ZAP.
Version:
Prerequisites: PmWiki, ZAP, AuthUser
Status: discontinued
Maintainer: Caveman (+ Jiri)
Categories: DeleteCandidate,Obsolete
This recipe works with ZAP modules pre2007. Now I am testing JForum (with ZAP200703!) which I expect to release in the middle of Apr 2007. Jiri The instructions below will give you a nice threaded forum with controlled access.
Prerequisities:
Changes: 5.1.2007
These pages are shared in all ZAPforums created according to this recipe in the site. Step 1 - Chose the forum nameChose the forum name (for example ForumExample - this name is used in following text).
Step 2 - Create forum home page
(:title ForumExample :) (:noGroupFooter:) (:include Forms/ForumAddThread #start#end:) Replace ForumExample strings with the forum name and adjust the title Step 3 - Create forum group footer page
(:include Forms/ForumContents:) Step 4 - maintain securityUse .../ForumExample/GroupAttributes?action=attr
Use steps 1 - 4 to create any forum (i.e. ForumFilms, Trobleshooting etc.) Following steps create 2 pages in Forms group and an optional PmWikiLc.XLPageLocal page for I18n. Step 5 - Create Forms.ForumAddThread pageinsert snippet
[[#start]]
(:zapget:)
(:if !equal {$addthread} "yes":)
(:zapform name=formNew action={$PageUrl}?addthread=yes:)
(:input submit value="$[New thread]" formNew:)
(:ifend:)
(:if equal {$addthread} "yes":)
(:zapdata {$Group}.#:)
'''$[Create new thread]:'''
(:zapform name=formthread:)
(:zap datapage="{$Group}.#" formthread:)
(:zap nextpage="{$Group}.#" formthread:)
(:input hidden addthread " ":)
(:input hidden ThreadId value={#g {$Group}|thread}:)
(:input hidden DateWritten "{#t +|%e.%m.%Y %R}":)
||border=0
|| ||(:input hidden WrittenBy value={$AuthId}:)
||$[Thread]: ||(:input text Topic size=40:)
||$[Post]: ||(:textarea name=Post cols=40 rows=5:)(:keep {$MagicBox}:)(:textareaend:)
|| ||(:input submit value="$[Submit]" formthread:)
(:zap savedata="ThreadId,DateWritten,WrittenBy,Topic,Post" formthread:)
(:tableend:)
(:ifend:)
(:zapend:)
----
(:if !equal {$addthread} "yes":)
[[#forumthreadslist]]
'''$[Threads]:'''
(:pagelist group="{$Group}" name=-*C*,-{$Group},-New,-RecentChanges,-GroupAttributes,-GroupFooter, fmt=Forms/ForumAddThread#forumthreadsfmt:)
[[#forumthreadslistend]]
(:ifend:)
[[#end]]
[[#forumthreadsfmt]]
(:if equal {<$Group}:)||border=1 cellpadding=5px bgcolor=#ffffcc cellspacing=0px
||'''ID''' ||'''$[Thread]''' || '''$[Date]'''||'''$[By]'''
(:ifend:)
||[[{=$Group}/{=$Name}]] ||{=$:Topic} || {=$:DateWritten}||{=$:WrittenBy}
[[#forumthreadsfmtend]]
(:noGroupFooter:)
Step 6 - Create Forms.ForumContents pageinsert snippet
[[#gfstart]]
(:zapdata:)
>>right<<[[{$PageUrl}?action=rss?order=-time?group={*$Group}?name={*$Name}*,-{*$Name}C*?list=normal |Pic:/feed.gif"{$Topic}"]]
>><<
(:table border=0:)
(:cellnr valign=bottom:)$[Thread]:
(:cell:)
>><<
{$Topic}
>><<
(:cellnr:)Id:
(:cell:){*$Name}
(:cellnr:)$[Author]:
(:cell:){$WrittenBy}
(:cellnr:)$[Date]:
(:cell:) {$DateWritten}
(:cellnr valign=top:)$[Post]:
(:cell:)
>><<
{$Post}
>><<
(:tableend:)
''$[The most recent comments are listed first]''
(:pagelist name="{*$Group}.{*$Name}C*" fmt="Forms/ForumContents#forumcomments" -RecentChanges -GroupHeader -GroupFooter order=-time:)
'-[[#gfstart|↑ $[up] ]]-'
----
[[#addcom]]
'-$[Add comment]:-'
(:zapdata:)
(:zapform:)
(:input hidden WrittenBy value={$AuthId}:)\\
(:input hidden time "{#t +|%e.%m.%Y %R}":)
(:input hidden ThreadId value={*$Name}:)
(:textarea name=Remark cols=60 rows=4:)(:keep {$MagicBox}:)(:textareaend:)\\
(:zap datapage="{$Group}.{$Name}C+":)
(:zap savedata="WrittenBy,Remark,time,ThreadId":)
(:input submit value="Submit":)
(:zapend:)
'-[[#gfstart|↑ $[up] ]]-'
(:if false:)
[[#forumcomments]]
(:table cellpadding=2px cellspacing=0px width=95%:)
(:cellnr bgcolor=#ffffcc:)$[commented by] '''{=$:WrittenBy}'''
(:cell bgcolor=#ffffcc align=right width=100:)'-{=$:time}-'
(:cellnr :){=$:Remark}
(:tableend:)
[[#forumcommentsend]]
(:ifend:)
Notes:
There is the RSS feed icon in the begining - remove the right aligned block if you don't wish the icon. I used Pic:/feed.gif - this works if you have defined "Pic" in the Site.InterMap Step 7 - Create PmWikiLc.XLPageLocal (optional)to display text constans in proper language.
If no local translation is present, the default language is English. ## Jiri's ZAPForum snippets 'TimeFmt' => '%Y-%m-%d %H:%M EET' 'Follow all threads' =>'', 'follow this thread' =>'', 'This is a threads list and links to their comments' =>'', 'Choose any thread and add your comment' =>'', 'create new thread' => '', 'Threads' =>'', 'Thread' =>'', 'New thread' =>'', 'login' =>'', 'Create new thread' =>'', 'Post' =>'', 'Submit' =>'', 'group' =>'', 'Author' =>'', 'Date' =>'', 'add comment' =>'', 'The most recent comments are listed first' =>'', 'up' =>'', 'By' =>'', 'commented by' =>'', Jiri, 5.1.2007 Comments:: Expiration NoticeIt Seems to be that http://www.zapsite.org resgistration has expired. E. Marte Dic-17-2007 |