Function: RenderRecentComments

Render the list of recent comments in the WebSideBar

The maximum age of a BlogComment to be displayed is configurable by the COMMENTSAGE variable in the WebPreferences. Current value is 2592000 epoch seconds. 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\">
~~~     <div class=\"blogSideBarHeader\">
~~~     <table 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=\"%SCRIPTURLPATH{"view"}%/%WEB%/WebRssComments\">RSS</a>
*~~       </td></tr>
*~~     </table>
~~~     </div>$n
~~~     <table width=\"100%\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\">"
~~~   format="<tr>
~~~     <td valign=\"top\"><ul style=\"margin-top:0px;margin-bottom:0px;padding-top:0px;\">
~~~       <li><a href=\"%SCRIPTURLPATH{"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=\"%SCRIPTURLPATH{"view"}%/$web.$topic#topComment\"
~~~          title=\"comments on <nop>$topic\">
*~~         $percntCOUNTCOMMENTS{\"$web.$topic\" hidenull=\"on\"}$percnt
*~~       </a>
~~~     </td></tr>"
~~~   limit="%LIMIT%" age="%COMMENTSAGE%"
~~~   footer="</table></div>$n</noautolink>"
~~~ }%
*~~
%STOPINCLUDE%

Test

Calls to 'RenderRecentComments'

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