<%@ LANGUAGE = "VBScript" %> <% dim keywords,searchtype keywords = Replace(request.querystring("KeyWords"), "'", "''") searchtype = request.querystring("searchtype") 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 strSQL = "SELECT monthview_cols FROM blog_settings" set dbRS = conn.execute(strSQL) dim monthview_cols monthview_cols = dbRS(0) set dbRS = nothing if searchtype = "keyword" then strSQL = "SELECT blog_date, blog_contents, last_modified, blog_user FROM blog_contents " _ & " WHERE blog_contents LIKE '%" & keywords & "%' ORDER BY blog_date ASC" else startmonth = request.querystring("startmonth") startday = request.querystring("startday") startyear= request.querystring("startyear") endmonth = request.querystring("endmonth") endday = request.querystring("endday") endyear = request.querystring("endyear") Select Case startmonth Case 4, 6, 9, 11 if startday = "31" then startday = "30" Case 2 If IsDate("February 29, " & startyear) Then if ((startday = "31") or (startday = "30")) then startday = "29" Else if ((startday = "31") or (startday = "30") or (startday = "29")) then startday = "28" End If End Select Select Case endmonth Case 4, 6, 9, 11 if endday = "31" then endday = "30" Case 2 If IsDate("February 29, " & endyear) Then if ((endday = "31") or (endday = "30")) then endday = "29" Else if ((endday = "31") or (endday = "30") or (endday = "29")) then endday = "28" End If End Select strSQL = "SELECT blog_date, blog_user, blog_contents, last_modified FROM blog_contents WHERE blog_date BETWEEN '" & startyear & "-"& startmonth & "-" & startday & "' AND '"& endyear &"-"& endmonth & "-" & endday &"' ORDER BY blog_date ASC" end if set dbRS = conn.execute(strSQL) Function stripHTML(strHTML) Dim objRegExp, strOutput Set objRegExp = New Regexp objRegExp.IgnoreCase = True objRegExp.Global = True objRegExp.Pattern = "<(.|\n)+?>" strOutput = objRegExp.Replace(strHTML, "") strOutput = Replace(strOutput, "<", "<") strOutput = Replace(strOutput, ">", ">") stripHTML = strOutput Set objRegExp = Nothing End Function %> ClickBlog 2.0 <% if searchtype = "keyword" then %> <% else %> <% end if %>
 Today's Blog  &year=<%= session("theYear") %>'" onMouseOver="highlight(this)" onMouseOut="unhighlight(this)"> Month View  Keyword Search Results: <%= keywords %> Date Range Search Results: <%= dateserial(startyear,startmonth,startday) %> TO <%= dateserial(endyear,endmonth,endday) %>

<% if dbRS.EOF then %> <% else %>

No Blogs Found

<% dim rows rows = 0 Do Until dbRS.EOF %> <% dim r r = rows Mod monthview_cols if r = (monthview_cols - 1) then response.write("") end if q = q +1 rows = rows +1 dbRS.MoveNext loop end if %>
<% if searchtype = "keyword" then %>
'" style="FILTER: progid:DXImageTransform.Microsoft.Gradient(gradientType=0,startColorStr=#8BACDB,endColorStr=#DEE6EE);cursor:hand;"> <% else %> <% end if %>  <%= RevDate(dbRS("blog_date")) %> 
<% If ((session("admin") = "yes" ) or (session("username") = dbRS("blog_user"))) then %> <% end if %>
<%= left(stripHTML(dbRS("blog_contents")),30) %>
Modified: <%= dbRS("last_modified") %>
Created by: <%= dbRS("blog_user") %>
','<%= dbRS("blog_user") %>')"> Delete Blog Entry
<% dbRS.Close conn.Close Set dbRS = Nothing set conn = Nothing %>