<% 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_SearchCriteria & "

  • " msgReset = msgReset & "
  • " & strText_SearchKeywords & "

  • " msgReset = msgReset & "
  • " & strText_SearchSpeedUp & "

  • " msgReset = msgReset & "
  • " & strText_SearchCommomWords & "

  • " msgReset = msgReset & "
  • " & strText_SearchTitleBody & "



" msgNoGo = "

" & strText_SearchInvalid & "

" msgNoGo = msgNoGo & "

" & strText_SearchTryAdvanced & "

" msgNotFound = "

" & strText_SearchNoMatch & "[" msgNotFound1 = "]" & strText_SearchNoMatch1 & "

" msgResult = "
" & strText_SearchResultKeywords & "" sKey = sqbl(Request("SH1")) sType = Request("SH2") sTarget = CLng(Request("SH3")) sDate = Request("SH4") sCity = sqbl(Request("SH5")) sImage = Request("SH6") categoryName = Request("categoryName") If sKey = Empty And sCity = Empty AND sTarget = 0 AND CStr(sDate) = "0" AND CStr(sImage) = Empty then noSearch = True If not sTarget = 0 then link = "" & strText_SearchResult & " " & categoryName & "" catSearch = " catID = " & sTarget & " AND " Else: link = strText_SearchForAll End If %>
<%= 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 & "
" %>
<% setLocale resetLocale For J = 1 to displayRecords If rs.EOF Then Exit For Else adID = rs(0) active = CLng(rs(6)) iDate = FormatDateTime(rs(1), 2) subject = rs(4) subject = "" & subject & "" If rs(8) then subject = "   " & subject userID = rs(9) If CStr(session("user_logged_ID" & strSUnique)) = CStr(userID) then adOwner = True nick = rs(2) city = rs(3) webImage = rs(10) If len(webImage) > 0 then imgStr = "" & strText_Yes & "" Else: imgStr = "" & strText_NA & "" End If views = rs(7) If len(rs(5)) > 0 then imgTempArray = Split(rs(5), sf) img = Split(imgTempArray(0), "|")(0) size = Split(imgTempArray(0), "|")(1) w = CLng(Split(size, "x")(0)) + 50 h = CLng(Split(size, "x")(1)) + 70 imgStr = "" imgStr = imgStr & "" Else: imgStr = "N/A" End If If J mod 2 = 0 then cellColor = "class='evencell'": Else: cellColor = "class='oddcell'" %> <% rs.MoveNext End If Next %>
<%= strText_PostedOn %>: <%= strText_Subject %>: <%= strText_Location %>: <%= strText_Picture %>: <%= strText_Views %>: <%= strText_Action %>:
align="center"><%= iDate %> ><%= subject %> align="center"><%= city %> align="center"><%= imgStr %> align="center"><%= views %> align="center"> <% If adOwner Or moderator then If active = 2 then Response.Write "" & strText_Repost & "" ElseIf active = 1 then Response.Write "" & strText_Edit & "" End If If moderator then Response.Write " Delete" If active = 0 then Response.Write " Activate" End If End If Else: Response.Write "=" End If %>

<% Session("adlist_show_page" & strSUnique) = Empty End If rs.close End If Response.Write "

" & msg %>
<% Function checkCommon(keyword) cArray = Split("the for and where who that this that from does will yes") For each cwords in cArray If keyword = cwords then checkCommon = False: Exit Function End If Next checkCommon = True End Function %>