'cause everyone should have a blog

Function: RenderRecentComments

Render the list of recent comments in the WebSideBar

The maximum age of a BlogComment to be displayed is hardcoded below in epoch seconds. See the age="2592000" parameter below. Customize it to

  1. month: 2592000
  2. months: 5184000
  3. months: …

as you like. The reason for that is to fade out old comments and even don't display the comments section in the sidebar at all if your blog grows lonely. It is no good advertisement to display very old comments in this prominent position with obiously no newer comments than that.

Parameters

  • LIMIT: maximal number of comments to list
  • CAT: restrict scope to the given category (optional)
  • AUTHOR: restrict scope to the given author (optional)

Implementation

%STARTINCLUDE%
*~~
%~~ RECENTCOMMENTS{
~~~   %IFDEFINED{"%CAT%" then="category=\"%CAT%\"" glue="off"}%
~~~   %IFDEFINED{"%AUTHOR%" then="author=\"%AUTHOR%\"" glue="off"}%
~~~   header="$n<noautolink>$n
*~~     <div class=\"blogSideBarSection blogSideBarComments\">
~~~     <table class=\"blogSideBarHeader\" 
~~~            border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\">
~~~       <tr><td>
*~~         <h1>
*~~           Comments$percntREDDOT{\"%WEB%.%TOPIC%\"}$percnt
*~~         </h1>
*~~       </td><td align=\"right\">
*~~        <a class=\"natFeedIcon\"
~~~           title=\"RSS Feed for the Comments on this Site\"
~~~           href=\"%SCRIPTURL{"view"}%/%WEB%/WebRssComments\">RSS</a>
*~~       </td></tr>
*~~     </table>
~~~     <table width=\"100%\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\">"
~~~   format="<tr>
~~~     <td><ul style=\"margin-top:0px;margin-bottom:0px;\"><li>
~~~       <a href=\"%SCRIPTURL{"view"}%/$web/$topic\"
~~~          title=\"link to <nop>$topic\">$headline</a> <br/>
~~~       <span class=\"blogSideBarCommenter\">
~~~         $percntTIMESINCE{\"$date\" format=\"$time ago\"}$percnt
~~~         $commenter replied
~~~       </span></li></ul>
~~~     </td>
~~~     <td valign=\"top\" class=\"blogCommentCount\">
~~~       <a href=\"%SCRIPTURL{"view"}%/$web.$topic#topComment\"
~~~          title=\"comments on <nop>$topic\">
*~~         $percntCOUNTCOMMENTS{\"$web.$topic\" hidenull=\"on\"}$percnt
*~~       </a>
~~~     </td></tr>"
~~~   limit="%LIMIT%" age="2592000"
~~~   footer="</table></div>$n</noautolink>"
~~~ }%
*~~
%STOPINCLUDE%

Test

Calls to 'RenderRecentComments'

TopicForm
TopicType: TopicFunction
TopicDescription: Render the list of recent comments in the WebSideBar

r2 - 21 Mar 2006 - 02:36 - TWikiAdminGroup
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding QBFreak.net? Send feedback
Powered by TWiki/Dakar Wed, 08 Feb 2006 build 8740