%
' Get the title
title = "Search"
strKeyword = blockSQLInjection (Request.QueryString ("keyword"))
%>
<%
' Display results
if Not ((strDateStart = "") And (strDateEnd = "")) Then
If Request.QueryString ("topic") <> "" Then
strQuery = "(topic = '" & blockSQLInjection (Request.QueryString ("topic")) & "')"
End If
If Request.QueryString ("category") <> "" Then
strQuery = "(category = '" & blockSQLInjection (Request.QueryString ("category")) & "')"
End If
If Request.QueryString ("region") <> "" Then
strQuery = "(region = '" & blockSQLInjection (Request.QueryString ("region")) & "')"
End If
%>
Results for "<%= strKeyword %>"
<%
theSQL="select news_id, title, post_date, author_source from news where (post_date BETWEEN '$beg_date' and '$end_date') and (status=1)"
theSQL=theSQL & " and ((author LIKE '%$keyword%') or (content LIKE '%$keyword%') or (author LIKE '%$keyword%') or (title LIKE '%$keyword%'))"
' This is in case additional category, topic, etc is specified
If strQuery <> "" Then
theSQL = theSQL & " and " & strQuery
End If
If strKeyword = "" Then
Response.End
End If
ascOrDesc = blockSQLInjection (Request.QueryString ("orderType"))
If (StrComp (ascOrDesc, "") = 0) Then
ascOrDesc = "DESC"
End If
theSQL = theSQL & " order by post_date " & ascOrDesc
theSQL = Replace (theSQL, "$keyword", strKeyword)
theSQL = Replace (theSQL, "$beg_date", FormatDateTime(CDate(strDateStart),vbGeneralDate))
theSQL = Replace (theSQL, "$end_date", FormatDateTime(CDate(strDateEnd)+1,vbGeneralDate))
' Finish up this SQL statement
coverRecs=getRecs(theSQL)
if Not isempty(coverRecs) then
for k=0 to ubound(coverRecs,2)
theDate = coverRecs (2,k)
v_id = coverRecs (0,k)
strTitle = coverRecs (1,k)
strSource = coverRecs (3, k)
link=ccVirtualFolderName& datePath(theDate) & ""&v_id&".html"
%>
<%= v_id %>. <%= strTitle %>
<% ' If InStr (strSource, "Epoch") > 0 Then %>
<% ' ElseIf InStr (strSource, "Mother Earth") > 0 Then %>
<% ' End If %>
<%= FormatDateTime (theDate, 1) & " " & FormatDateTime (theDate, 3) %>
<%
next
end if
end if
%>
<%
Function printSelect (strType)
Response.Write ""
End Function
%>