% dim blognum, blogpage, sparecount, lastdate %>
<%
sub showblogs(newblogfir,blogonpage,allblog)
%>
<%
if blogtable.RecordCount>0 then
blogonpage=iif(blogonpage="all", blogtable.RecordCount-1, blogonpage) ' Calculates how many blogs there should be on the page.
if VarType(newblogfir)=2 then ' If newblogfir is an integer.
blognum=newblogfir
blogonpage=1
allblog=false
else ' Else if newblogfir isn't an integer.
blognum=iif(newblogfir, CInt(blogtable.RecordCount)-1, 1) ' Calculates the initial blog number.
if allblog then
blogpage=iif(InStr(1, request.ServerVariables("QUERY_STRING"), "blogpage=", 1)>0, iif(VarType(CInt(request.queryString("blogpage")))=2, CInt(request.queryString("blogpage")), 1), 1)-1 ' Find the current page number.
blognum=blognum+(iif(blogpage*blogonpage>blogtable.RecordCount-1, blogtable.RecordCount-1, blogpage*blogonpage)*iif(newblogfir, (-1), 1)) ' Finds the actual blognumber to start at from the page number.
end if
end if ' End to "if newblogfir is an integer".
%>
<%
blogtable.movefirst ' Moves to first record in the database.
blogtable.move blognum ' Moves to the desired first blog number.
%>
<%
if not VarType(newblogfir)=2 then
response.write vbcrlf&"
"&vbcrlf ' If the blog is not on the comment page this opens a tag.
end if
for sparecount=1 to blogonpage
if (not blogtable.BOF) and (not blogtable.EOF) then
if blogtable("blogactive") then
if not VarType(newblogfir)=2 then
response.write vbcrlf&" - "&vbcrlf ' If the blog is not on the comment page this opens a new
- tag.
end if
if blogtable("blogcomments")>0 then
commenttable.move (blogtable("lastcommentnum")-1)
lastdate=fulldate(commenttable("commenttimedate"))
commenttable.movefirst
else
lastdate=fulldate(blogtable("blogtimedate"))
end if
%>
>
- 0, "", " id=""comments"""), "") &">"& blogtable("blogtitle") %>
- Blogged on <%= fulldate(blogtable("blogtimedate")) %> by <%= blogtable("adminname") %>
-
<%= replace(emoticons(blogtable("blog")),vbcrlf,vbcrlf&" ") %>
<%= iif(not VarType(newblogfir)=2, "- Comments ("&blogtable("blogcomments")&") Last updated on "&lastdate&"
", "")&vbcrlf %>
<%
if isadmin then
%>
<%= " - "&vbcrlf %>
<%= " "&vbcrlf %>
<%= "
" %>
<%
end if
%>
<%
if not VarType(newblogfir)=2 then
response.write vbcrlf&" "&vbcrlf ' If the blog is not on the comment page this closes an existing - tag.
end if
else
sparecount=sparecount-1
end if
if newblogfir then
blogtable.moveprevious
else
blogtable.movenext
end if
else
sparecount=blogonpage
end if
next
if not VarType(newblogfir)=2 then
response.write vbcrlf&"
" ' If the blog is not on the comment page this closes the tag.
end if
if allblog then ' If all blogs are displayed (via pages) then this will create the "Previous Page" and "Next Page" links.
%>
<% end if %>
<% end if %>
<% end sub %>
<% dim commentnum, commentlinks, commentpage, skipcomments, cycle, commentpages, cls, ads %>
<% sub showcomments(newcommentfir,commentonpage,allcomment) %>
<% ' Obtains the correct blog number.
blognum=iif(InStr(1, request.ServerVariables("QUERY_STRING"), "blog=", 1)>0, CInt(request.queryString("blog")), blogtable.RecordCount)-1
blognum=iif(VarType(blognum)=2, blognum, blogtable.RecordCount-1)
blognum=iif(blognum>blogtable.RecordCount-1, blogtable.RecordCount-1, blognum)
blognum=iif(blognum<0, 0, blognum)
blogtable.move blognum
%>
<%
if blogtable("blogactive") then ' If this blog is not disabled.
call top(" > "&blogtable("blogtitle"))
call showblogs(blognum,1,false) ' Shows the blog requested.
blogtable.movefirst ' Moves to the next record as the previous subroutine moves one back in the records.
blogtable.move blognum
if VarType(commentonpage)=2 then ' If commentonpage is an integer.
commentpage=iif(InStr(1, request.ServerVariables("QUERY_STRING"), "commentpage=", 1)>0, CInt(request.queryString("commentpage")), 1)
commentpage=iif(VarType(commentpage)=2, commentpage, blogtable("blogcomments"))
commentpage=iif(commentpage>CInt(blogtable("blogcomments")/commentonpage)+1, CInt(blogtable("blogcomments")/commentonpage)+1, commentpage)
commentpage=iif(commentpage<1, 1, commentpage)
skipcomments=(commentpage-1)*commentonpage ' Calculates the number of ACTIVE comments to skip from the page number.
else ' Else if commentonpage is not an integer.
commentonpage=blogtable("blogcomments")
commentpage=1
skipcomments=0
end if ' End to "if commentonpage is an integer".
commentonpage=iif(commentonpage>blogtable("blogcomments"), blogtable("blogcomments"), commentonpage)
commentonpage=iif(commentonpage<1, 1, commentonpage)
commentpages=iif(VarType(commentonpage)=2, commentpage*commentonpage, 1) ' Calculates the number of comment pages there are.
if blogtable("blogcomments")>0 then ' If there are any comments.
%>
<%
if commentpages>1 then ' If there is more than one page of comments.
%>
<%
end if ' End to "if there is more than one page of comments".
end if
else ' Else if this blog is disabled.
call top(" > Inactive Blog!") %>
This blog is not active.
<% end if ' End to "if this blog is not disabled".
end sub %>
"&vbcrlf %> <%= "- Delete this comment.
"&vbcrlf %>
<%= " - Edit this comment.
"&vbcrlf %>
<%= "
"&vbcrlf %> <%= "