#** * Comment page links and comment forms. *# #** * Display the pop-up comments link for a weblog entry. * Use the URL for the href attribute for those who have disabled * javascript or who desire to open the comments window in another (Mozilla) tab. * @param entry WeblogEntryData object for which link is to be displayed. *# #macro( showCommentsLink $entry ) #set( $commentCount = $pageModel.getCommentCount($entry.Id) ) #if (($commentsEnabled && $entry.commentsStillAllowed && $website.allowComments) || $commentCount > 0) #set( $link = "$ctxPath$entry.permaLink&popup=true#comments" ) $text.get( "macro.weblog.comments" ) [$commentCount] #end #end #** * Display the in-page comments link for a weblog entry. * @param entry WeblogEntryData object for which link is to be displayed. *# #macro( showCommentsPageLink $entry ) #set( $commentCount = $pageModel.getCommentCount($entry.Id) ) #if (($commentsEnabled && $entry.commentsStillAllowed && $website.allowComments) || $commentCount > 0) #set( $link = "$ctxPath$entry.permaLink#comments" ) $text.get( "macro.weblog.comments" ) [$commentCount] #end #end #** * Display link for comments that renders a dynamically (DHTML) generated * comments form - Matt Raible's "twisty comments" style. * @param entry WeblogEntryData object for which link is to be displayed. *# #macro( showCommentsDiv $entry ) #set( $commentCount = $pageModel.getCommentCount($entry.Id) ) #if (($commentsEnabled && $entry.commentsStillAllowed && $website.allowComments) || $commentCount > 0)
#if($commentCount == 0) $text.get( "macro.weblog.addcomment" ) #elseif($commentCount == 1) $commentCount $text.get( "macro.weblog.comment" ) #else $commentCount $text.get( "macro.weblog.comments" ) #end
#end #end #** * PRIVATE. Macro for displaying Comment details (not content). **# #macro( showCommentDetails $comment $showPermalink ) $dateFormatter.applyPattern($text.get( "macro.weblog.datepattern" )) #set($email = $utilities.hexEncode($comment.email))

$text.get("macro.weblog.postedby") #if (!$stringUtils.isEmpty($comment.name) && !$stringUtils.isEmpty($email) && !$stringUtils.isEmpty($comment.remoteHost)) $comment.name #elseif (!$stringUtils.isEmpty($comment.name) && !$stringUtils.isEmpty($email)) $comment.name #elseif (!$stringUtils.isEmpty($email) && !$stringUtils.isEmpty($comment.remoteHost)) $comment.remoteHost #elseif (!$stringUtils.isEmpty($comment.name) && !$stringUtils.isEmpty($comment.remoteHost)) $comment.name ($comment.remoteHost) #elseif (!$stringUtils.isEmpty($comment.name)) $comment.name #elseif (!$stringUtils.isEmpty($comment.remoteHost)) $comment.remoteHost #end $text.get("macro.weblog.on") $dateFormatter.format($comment.postTime) #if( $stringUtils.isNotEmpty($comment.url) ) $text.get( "macro.weblog.postedbywebsite", [$comment.url, $comment.url] ) #end #if( $showPermalink ) # #end

#end #** * Display all comments comments for an entry. * @param entry WeblogEntryData object for which comments are to be displayed. *# #macro( showComments $entry )
#if( $previewComments ) #set( $comments = $previewComments )
$text.get( "macro.weblog.preview" ):
#else
$text.get( "macro.weblog.comments" ):
#set( $comments = $entry.comments ) #end
#foreach( $comment in $comments ) #set($content = $utilities.encodeEmail($comment.content)) #if($escapeHtml) #set($content = $utilities.escapeHTML($content)) #end #if($autoformat) #set($content = $utilities.autoformat($content)) #end #set($content = $utilities.addNofollow($content))
${content} #showCommentDetails($comment true)
#end
#end #** * Display recent comments for whole blog (not just one entry). * @param numComments Maximum number of comments to be displayed **# #macro( showRecentComments $numComments ) #if( !$numComments ) #set( $numComments = 20 ) #end #if( $numComments > 100 ) #set( $numComments = 50 ) #end #set( $comments = $pageModel.getRecentComments($numComments) )
#foreach( $comment in $comments ) #set($content = $utilities.encodeEmail($comment.content)) #if($escapeHtml) #set($content = $utilities.escapeHTML($content)) #end #if($autoformat) #set($content = $stringUtils.replace($content,"\n","
")) #end #set($content = $utilities.addNofollow($content))

Commenting on ${comment.weblogEntry.title}:

${content} #showCommentDetails($comment false)
#end
#end #** * Display list of most recent comments for a blog. * @param numComments Max number of comments to show. * @param maxWidth Limit width of comment text to this number of characters **# #macro( showRecentCommentsListWidth $numComments $maxWidth ) #if( !$numComments ) #set( $numComments = 20 ) #end #if( $numComments > 100 ) #set( $numComments = 100 ) #end #set( $minWidth = $maxWidth - 5 ) #set( $comments = $pageModel.getRecentComments($numComments) ) #end #** * Display list of most recent comments for a blog (with maxWidth = 25) * @param numComments Max number of comments to show. **# #macro( showRecentCommentsList $numComments ) #showRecentCommentsListWidth( $numComments 25 ) #end #** * Display comment form for a weblog entry. * @param entry WeblogEntry object for which form is to be shown. *# #macro( showCommentForm $entry )
$text.get("macro.weblog.postcommentHeader")

#if($requestParameters.popup) #end #if ($pageModel.emailComments) #end
$text.get( "macro.weblog.name" )
$text.get( "macro.weblog.email" )
$text.get( "macro.weblog.url" )

$text.get( "macro.weblog.yourcomment" )

$text.get( "macro.weblog.htmlsyntax" ) #if( $escapeHtml ) $text.get( "macro.weblog.htmldisabled" ) #else $text.get( "macro.weblog.htmlenabled" ) #end
#showStatusMessage()

$pageHelper.commentAuthenticatorHtml

#end #** * Display hidden comment form for a weblog entry. * @param entry WeblogEntry object for which form is to be shown, *# #macro( showHiddenCommentForm ) #end