Threaded Discussions

Function: RenderComments

Renders all comments of a discussion

Parameters

NONE

Implementation

%STARTINCLUDE%
*~~ <!-- %CALC{"$SET(commentCounter, 0)"}% -->
~~~ <style type="text/css">.blogScroll { display:none }</style>
<div class="blogComments">
<a name="topComment"></a>
<div class="blogScroll">
~~~ <a href="#bottomComment" title="scroll down">&darr;</a>
~~~ <a href="#PageTop" title="scroll up">&uarr;</a>
~~~ </div>
%~~ DBRECURSE{"%BASEWEB%.%BASETOPIC%"
~~~   filter="TopicType='\bComment\b' AND TopicRef='$ref'"
~~~   hidenull="on"
~~~   header="<h2>$count Comments</h2>$n"
~~~   singleheader="<h2>One Comment</h2>$n" 
~~~   format="none"
~~~ }%
%IFDEFINEDTHEN{"%SKIN%" as="rss|atom|xml"}%
%ELSIFDEFINED{"$percntDBQUERY{topic=\"%BASEWEB%.%BASETOPIC%\" format=\"$expand(State or @BaseRef.State or 'open')\"}$percnt" as="open"}%
~~~ <div class="blogEntryFeed">
~~~  <a class="natFeedIcon blogFeedIcon" 
~~~     title="RSS feed for this discussion"
~~~     href="%SCRIPTURLPATH{"view"}%/Applications.DiscussionApp/WebRssDiscussion
*~~       ?theweb=%BASEWEB%&thetopic=%BASETOPIC%">RSS</a>
~~~ </div>
%FIDEFINED%
%~~ DBQUERY{"TopicType='Comment' AND TopicRef='%BASETOPIC%'"
~~~        order="Timestamp" web="%BASEWEB%" hidenull="on"
~~~        separator=" "
~~~        format="<!-- commentCounter=$percntCALC{\"$dollarSETM(commentCounter, +1) $dollarGET(commentCounter)\"}$percnt -->
~~~                <div class=\"blogComment
~~~                $percntCALC{\"$dollarIF(
~~~                              $dollarODD($dollarGET(commentCounter)),
~~~                              blogCommentOdd,
~~~                              blogCommentEven)\"}$percnt\">
~~~               %DBCALL{"Applications.DiscussionApp.RenderComment" section="format"}%
~~~               $percntDBCALL{\"Applications.DiscussionApp.RenderSubComments\" NAME=\"$topic\"}$percnt
~~~               <a class=\"blogReply\" href=\"$percntSCRIPTURLPATH{\"view\"}$percnt/$web/$topic#bottomComment\"
~~~                  title=\"comment on <nop>$topic\">reply</a>
~~~               </div>"
~~~        footer="
~~~          %IFDEFINEDTHEN{"%SKIN%" as="rss|atom|xml"}%
~~~          %ELSEDEFINED%
~~~            <a name=\"bottomComment\"></a>
~~~            <div class=\"blogScroll\">
~~~              <a href=\"#topComment\" title=\"scroll up\">&uarr;</a>
~~~            </div>
~~~          %FIDEFINED%
~~~          <style type=\"text/css\">.blogScroll { display:block }</style>
~~~        "
~~~ }%
~~~ </div> 
~~~
%STOPINCLUDE%

Test

Calls to 'RenderComments'

Applications.ApplicationTopic
TopicType: TopicFunction
Summary: Renders all comments of a discussion
TWikiApplication: DiscussionApp
r0 - 09 Aug 2007 - 12:53:19 - TWikiContributor
© giant orange extension cord that reeks hip-hop, funk & soul