<%@ LANGUAGE = "VBScript" %> <% dim blogdate, theMonth, theYear, count if request.form("form_codeword") <> "" then if request.form("form_codeword") = sitepass then session("loggedin") = "yes" else session("loggedin") = "" end if end if if request.querystring("logout") = "yes" then session("loggedin") = "" end if if request.querystring("date") = "today" then blogdate = IsoDate(date()) session("theMonth") = Right(Cstr(month(now) + 100),2) session("theYear") = year(now) else if request.querystring("caldate") = "yes" then blogdate = IsoDate(dateserial(request.querystring("year"),request.querystring("month"),"01")) else blogdate = IsoDate(request.querystring("date")) end if session("theMonth") = mid(blogdate,6,2) session("theYear") = left(blogdate,4) end if action = request.form("Action") if action = "Update" then last_modified = FormatDateTime(Now) contents = ChkString(request.form("blogContents")) blogdate = request.form("blogDate") strSQL = "UPDATE blog_contents SET blog_contents = '" & contents & "', last_modified = '" & last_modified & "' " _ & "WHERE blog_date = '" & blogdate & "' AND blog_user = '" & session("username") & "'" conn.Execute(strSQL) end if if action = "New" then last_modified = FormatDateTime(Now) contents = ChkString(request.form("blogContents")) blogdate = request.form("blogDate") strSQL = "INSERT INTO blog_contents (blog_contents, blog_user, blog_date, last_modified) "_ & "values ('" & contents & "', '" & session("username") & "', '" & blogdate & "', '" & last_modified & "')" conn.Execute(strSQL) end if if request.querystring("Action") = "delete" then strSQL = "DELETE FROM blog_contents WHERE blog_date = '" & request.querystring("date") &"'" _ & " AND blog_user = '" & request.querystring("user") &"' " conn.Execute(strSQL) end if %> ClickBlog 2.0 <% strSQL = "SELECT COUNT(blog_date) FROM blog_contents "_ & "WHERE blog_date = '" & blogdate & "'" set dbRS = conn.Execute(strSQL) if dbRS(0) > 1 then strSQL = "SELECT blog_date, blog_contents, last_modified, blog_user FROM blog_contents "_ & "WHERE blog_date = '" & blogdate & "' ORDER BY last_modified DESC" set dbRS = conn.Execute(strSQL) do while not dbRS.EOF count = count +1 %> <% dbRS.movenext loop dbRS.close set dbRS = nothing end if %>
 Today's Blog  &year=<%= session("theYear") %>'" onMouseOver="highlight(this)" onMouseOut="unhighlight(this)"> Month View     <%= count %> 
<% if session("loggedin") = "yes" then %> <% strSQL = "SELECT blog_date, blog_contents, last_modified FROM blog_contents "_ & "WHERE blog_date = '" & blogdate & "' AND blog_user = '" & session("username") & "' ORDER BY last_modified DESC" set dbRS = conn.Execute(strSQL) %>
<% if not dbRS.EOF then strSQL = "SELECT blog_date, blog_contents, last_modified, blog_user FROM blog_contents "_ & "WHERE blog_date = '" & blogdate & "' AND blog_user <> '" & session("username") & "' ORDER BY last_modified DESC" set dbRS2 = conn.Execute(strSQL) if dbRS2.EOF then %> <% else %> <% end if %>
   &date=<%= blogdate %>'">
<% strSQL = "SELECT blog_date, blog_contents, last_modified, blog_user FROM blog_contents "_ & "WHERE blog_date = '" & blogdate & "' AND blog_user <> '" & session("username") & "' ORDER BY last_modified DESC" set dbRS = conn.Execute(strSQL) do while not dbRS.eof %>
 Last Modified on <%= dbRS(2) %> by <%= dbRS(3) %>
<%= dbRS(1) %>
<% dbRS.movenext loop else strSQL = "SELECT blog_date, blog_contents, last_modified FROM blog_contents "_ & "WHERE blog_date = '" & blogdate & "' AND blog_user <> '" & session("username") & "' ORDER BY last_modified DESC" set dbRS = conn.Execute(strSQL) if dbRS.EOF then %>
<% else %>
<% strSQL = "SELECT BC.blog_date, BC.blog_contents, BC.last_modified, BC.blog_user, BU.email " _ & "FROM blog_contents BC "_ & "INNER JOIN blog_users BU ON " _ & "BC.blog_user = BU.username " _ & "WHERE BC.blog_date = '" & blogdate & "' "_ & "AND blog_user <> '" & session("username") & "' ORDER BY BC.last_modified DESC" set dbRS = conn.Execute(strSQL) do while not dbRS.eof %>
 Last Modified on <%= dbRS(2) %> by <%= dbRS(3) %>
<%= dbRS(1) %>
<% dbRS.movenext loop end if end if %>
<% else strSQL = "SELECT BC.blog_date, BC.blog_contents, BC.last_modified, BC.blog_user, BU.email " _ & "FROM blog_contents BC "_ & "INNER JOIN blog_users BU ON " _ & "BC.blog_user = BU.username " _ & "WHERE BC.blog_date = '" & blogdate & "' ORDER BY BC.last_modified DESC" set dbRS = conn.Execute(strSQL) count = 0 if dbRS.EOF then %>

No Entry for <%= revDate(blogdate) %>

<% else do while not dbRS.eof count = count + 1 %>
 Last Modified on <%= dbRS(2) %> by <%= dbRS(3) %>
<%= dbRS(1) %>
<% dbRS.movenext loop end if end if %>
 <<   You are viewing the blog entry for: <%= revDate(blogdate) %>  >> 
<% dbRS.close set dbRS = nothing %>