Feature story

<%= H(post.Title) %>

<% Dim publishedText publishedText = "" If IsDate(post.PublishedDate) Then If CDate(post.PublishedDate) > #1/1/1970# Then publishedText = FormatDateTime(post.PublishedDate, vbLongDate) End If End If If Len(publishedText) > 0 Then %> <% End If Dim postBody postBody = RenderPostBody(post.Body) %>
<%= postBody %>
<% Dim commentsCount, commentsLoadFailed commentsCount = 0 commentsLoadFailed = False On Error Resume Next If IsObject(comments) Then commentsCount = comments.Count If Err.Number <> 0 Then commentsLoadFailed = True commentsCount = 0 Err.Clear End If On Error GoTo 0 %>

Comments (<%= commentsCount %>)

<% If commentsLoadFailed Then %>
Comments are temporarily unavailable.
<% ElseIf commentsCount = 0 Then %>

No comments yet. Be the first to leave one below.

<% Else %> <% Dim commentIter, commentItem Dim commentsIterFailed commentsIterFailed = False On Error Resume Next Set commentIter = comments.Iterator() If Err.Number <> 0 Then commentsIterFailed = True Err.Clear End If Do While Not commentsIterFailed And commentIter.HasNext Set commentItem = commentIter.GetNext() If Err.Number <> 0 Then commentsIterFailed = True Err.Clear Exit Do End If Dim commentDateText commentDateText = "" If IsDate(commentItem.CreatedDate) Then commentDateText = FormatDateTime(commentItem.CreatedDate, vbLongDate) End If %>
<%= H(commentItem.AuthorName) %> <%= H(commentDateText) %>
<% Dim commentBody commentBody = H(commentItem.Body) commentBody = Replace(commentBody, vbCrLf, "
") commentBody = Replace(commentBody, vbCr, "
") commentBody = Replace(commentBody, vbLf, "
") %>

<%= commentBody %>

<% Loop If Err.Number <> 0 Then commentsIterFailed = True Err.Clear End If On Error GoTo 0 If commentsIterFailed Then %>
Some comments could not be displayed.
<% End If %> <% End If %>

Leave a Comment

Comments are reviewed before appearing.