% Dim totalPage, totalRecords, displayRecords setLocale server_locale If session("user_logged_moderator" & strSUnique) = True Or session("admin_loggedin" & strSUnique) = Session.SessionID then moderator = True msgReset = "
" & strText_Basic & " " & strText_SearchRules & ": " msgReset = msgReset & "
|
" & strText_SearchInvalid & "
" msgNoGo = msgNoGo & "" & strText_SearchTryAdvanced & "
" msgNotFound = "" & strText_SearchNoMatch & "[" msgNotFound1 = "]" & strText_SearchNoMatch1 & "
" msgResult = "| <%= strText_Home %>::<%= link %> | ||||||||||||||||||||||||
|
<%
sdd = dd(objConn)
If not sDate = 0 then
baseDate = DateAdd("d", -sDate, Date)
dateSearch = " pdate > " & sdd & ConvDateShort(baseDate) & sdd & " AND "
End If
keysArray = " (body LIKE '%" & sKey & "%' OR subject LIKE '%" & sKey & "%')"
Select Case sType
Case 3: Exact = True
Case 2: operator = "AND"
Case 1: operator = "OR"
End Select
If Not Exact AND Not sKey = Empty then
keysArray = Empty
tempArray = Split(sKey)
For I = 0 To UBound(tempArray)
If Len(tempArray(I)) > 2 Then
If checkCommon(tempArray(I)) then
keysArray = operator & " (body LIKE '%" & tempArray(I) & "%' OR subject LIKE '%" & tempArray(I) & "%') " & keysArray
End If
End If
Next
If Len(keysArray) < 3 then
noSearch = True
Else: keysArray = Right(keysArray, Len(keysArray) - InStr(keysArray, "(") + 1)
End If
End If
sCity = Trim(sCity)
If Len(sCity) > 0 then citySearch = " AND (city LIKE '%" & sCity & "%')"
If sImage = "1" then imageSearch = " images <> '' AND "
If noSearch then
msg = msgReset & msgNoGo
Else
srtSQLSearch = "SELECT adID,pdate,nick,city,subject,images,status,adcounter,hotlist,userID,webimage "
srtSQLSearch = srtSQLSearch & "FROM " & tablPfx & "Ads "
srtSQLSearch = srtSQLSearch & "WHERE (status = 1 AND " & imageSearch & dateSearch & catSearch & keysArray & citySearch & ") ORDER BY hotlist DESC, pdate DESC;"
rs.PageSize = pp
rs.CacheSize = 60
rs.CursorLocation = 3
rs.Open srtSQLSearch, strConn, 0, 1
If rs.EOF then
msg = msgNotFound & sKey & msgNotFound1 & msgReset
Else
If isNumeric(Request("page")) and Len(Request("page")) > 0 then
nPage = Request("page")
Else: nPage = 1
End If
URLlink = "search.asp?" & Server.URLEncode(Request.Querystring)
pageType = 11
strPaging = buildPages(nPage, URLlink, pageType) '## paging built in libraries.asp
Response.Write msgResult & sKey & " " Response.Write strPaging Response.Write " " & strText_TotalPages & ": " & totalPage & " "
%>
" Response.Write strText_SearchMatchAd & ": " & totalRecords & "
<% Session("adlist_show_page" & strSUnique) = Empty End If rs.close End If Response.Write " " & msg %> | ||||||||||||||||||||||||