Decent Blogging using TWiki

Function: RenderSubComments

Render all BlogComments recursively

Parameters

  • NAME: topic name whose comments are rendered

Implementation

%STARTINCLUDE%
%~~ DBQUERY{"BlogRef='%NAME%'" order="createdate"
~~~        format="
*~~          <div class=\"blogSubComment\">
~~~            <a name=\"$topic\"></a><a name=\"$formfield(Nr)\"></a>
~~~            <span class=\"blogCommentNr\">$formfield(Nr)</span>
~~~            $percntIFDEFINEDTHEN{\"$expand(Url)\"}$percnt
~~~              [[$expand(Url)][$expand(Name)]] 
~~~            $percntELSEDEFINED$percnt
~~~              $percntCALC{
~~~                \"$dollarIF($dollarEXISTS(%MAINWEB%.$expand(Name)),
~~~                  [[%MAINWEB%.$expand(Name)][$expand(Name)]],
~~~                  $expand(Name))\"
~~~              }$percnt
~~~            $percntFIDEFINED$percnt, 
~~~            $percntTWISTY{id=\"twist$topic\" 
~~~               buttonmode=\"span\" mode=\"div\" remember=\"on\"
~~~               link=\"
~~~                 <span class=\\"blogDate\\">
~~~                   $percntTIMESINCE{
~~~                     from=\"$formatTime(@BlogRef.createdate)\"
~~~                     to=\"$formatTime(createdate)\"
~~~                     null=\"immediately\"
~~~                     format=\"$time later\"
~~~                   }$percnt
*~~                 </span>
*~~                 $expand(': ' and Headline)
~~~               \"
~~~              showimg=\"$percntICONURLPATH{\"toggleopenleft\"}$percnt\"
~~~              hideimg=\"$percntICONURLPATH{\"toggleclose\"}$percnt\"
~~~            }$percnt$n
~~~            <noautolink>
~~~            <div class=\"blogCommentText\">
~~~              $formfield(Text)
~~~              ...&nbsp;<a href=\"$percntSCRIPTURL{\"view\"}$percnt/$web/$topic#$topic\"
~~~                          title=\"comment on <nop>$topic\">
*~~              reply</a>
~~~            </div>$n
~~~            </noautolink>
~~~            $percntENDTWISTY$percnt
~~~            $percntDBCALL{\"RenderSubComments\" NAME=\"$topic\"}$percnt
*~~          </div>"
~~~ }%
*~~
%STOPINCLUDE%

Test

Calls to 'RenderSubComments'

TopicForm
TopicType: TopicFunction
TopicDescription: Render all BlogComments recursively
r1 - 2005-11-29 - 16:42:49 - TWikiContributor
Copyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Linux® is the registered trademark of Linus Torvalds in the U.S. and other countries.
Atmel®, AVR® and others are registered trademarks or trademarks of Atmel Corporation or its subsidiaries.
All other trademarks are the property of their respective owners.