Area for free-form discussion among members

Function: RenderDiscussionForum

Defines content for DiscussionForums topics. See also DiscussionForumsViewTemplate? which defines overall page layout.

Documentation

Parameters

  • PERMISSIONS - optionally set permissions restrictions to the discussion topics created. Enter using the standard topic permissions setting syntax. Here is an example from ModeratorGroupForum:
   * Set PERMISSIONS =    * Set ALLOWTOPICVIEW = %MAINWEB%.ModeratorGroup

Css

Implementation

%STARTINCLUDE%
%~~ DBQUERY{"topic = '%BASETOPIC%'"
~~~  web="%BASEWEB%"
~~~  format="---+ $expand(TopicTitle) 
~~~    $n <span style='font-size:1.2em;font-style:italic'>$expand(Summary)</span>
~~~    $n$n $expand(text)"
~~~ }%
%ICON{hand}% [[#StartNewDiscussion][Start a new discussion]]

%TABLE{tablewidth="700px" columnwidths="450px,50px,250px" sort="off" dataalign="left,center,left"}%
| *%FORMFIELD{"TopicTitle" topic="%BASEWEB%.%BASETOPIC%"}% Topics* | *Comments* | *Original Post / Most Recent Post* |
%~~ DBQUERY{"DiscussionForum = '%BASETOPIC%'" 
~~~  format="| %ICONURL{megaphone}% $topic %BR% $formfield(Summary)   | 
~~~    $percntSEARCH{\"$topic\" 
~~~       scope=\"topic\" 
~~~       web=\"%BASEWEB%\" 
~~~       nonoise=\"on\" 
~~~       format=\"$dollarcount(.*?([C]OMMENT_TAG) .*)\"
~~~    }$percnt | 
~~~    $percntREVINFO{topic=\"$topic\"
~~~        rev=\"1\"
~~~        format=\"$wikiusername on $date - $hours:$minutes\"
~~~     }$percnt <br />
~~~    %MAINWEB%.$expand(info.author) on $formatTime(info.date, '$day $month $year - $hours:$minutes')  |"
~~~  separator="$n"
~~~  sort="modified"
~~~  reverse="on"
~~~  footer="$n<b>Topics found: $count</b>"
~~~  }%

#StartNewDiscussion
---++ Start New Discussion
%IFDEFINEDTHEN{"%WIKINAME%" as=".*Guest" glue="on"}%
__Please %LOGIN% or [[%SYSTEMWEB%.TWikiRegistration][register]] to start a new discussion.__
%ELSEDEFINED%
<script type="text/javascript" src="%PUBURL%/%TWIKIWEB%/TWikiJavascripts/twiki.js"></script>
<script type="text/javascript">
//<![CDATA[
function submitForm(form) {
   if (form.TopicTitle.value == "") {
         alert("Please fill in Title field.");
         return false;
   }
   return true;
}
//]]>
</script>
<noautolink>
<form name="startDiscuss" action="%SCRIPTURL{save}%/%BASEWEB%" method="post" onsubmit="return submitForm(this);" >
<input type="hidden" name="templatetopic" value="DiscussionTopicTemplate" />
<input type="hidden" name="formtemplate" value="DiscussionTopicForm" />
<input type="hidden" name="TopicType" value="DiscussionTopic" />
<input type="hidden" name="DiscussionForum" value="%BASETOPIC%" />
<input type="hidden" name="topicparent" value="%BASETOPIC%" />
<input type="hidden" name="topic" value="FallbackName" /> 
%~~ IFDEFINED{"%PERMISSIONS%" 
~~~   then="<input type=\"hidden\" name=\"permissions\" value=\"$test\" />"
~~~   glue="off"
~~~ }%
%TABLE{tablewidth="100%" dataalign="right,left" }% 
|  *Title* <img src="%ICONURL{help}%" title="Enter title for your discussion topic." /> | 
~~~  <input type="text" name="TopicTitle" size="30" 
~~~     onblur="document.startDiscuss.topic.value=removeSpacesAndPunctuation(capitalize(this.value))"/>  |
|  *Summary* <img src="%ICONURL{help}%" title="Enter short summary of what discussion is about." /> | <input type="text" name="Summary" size="65" />  | 
|  *Message* <img src="%ICONURL{help}%" title="Enter your opening statement to kick off this discussion." /> | <textarea name="intro" rows="10" cols="63" ></textarea>  |
|| <input type="submit" value=" Post Discussion Topic " /> |
</form>
</noautolink>
%FIDEFINED%
%STOPINCLUDE%

Copyright

© 2007 LynnwoodBrown? lynnwood@Skyloom.com

r4 - 30 Jan 2009 - 16:11:42 - LynnwoodBrown
WikiRing: Professional Wiki Innovation and SupportWikiRing.com
This site is powered by Foswiki
Copyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding IntroEngineering.org Wiki? Send feedback
Syndicate this site RSSATOM