%@ 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
%>