<% If Len(Request.Cookies("admin_loggedin" & strSUnique)) = 0 Then Response.Redirect "default.asp" showTempl = Request("id") searchCid = Request("cidx") strSQL = "SELECT * FROM tblHelp ORDER BY cid, sid;" Set rs = objConn.Execute(strSQL) x=0 If not rs.EOF then Do while Not rs.EOF template = CStr(rs("ID")) subject = rs("topic") cid = CLng(rs("cid")) sid = CLng(rs("sid")) isExpand = CBool(rs("isexpand")) If CStr(cid) = CStr(searchCid) then isExpand = True If showTempl = template then strSQL = "UPDATE tblHelp SET isexpand = 1 WHERE cid = " & cid & ";" objConn.Execute(strSQL) End If End If If sid > 0 then indent = "     " separator = " style='font-size: 8pt;' " block = "" endblock = "" imgExpand = "" Else If x > 0 then endblock = "" If isExpand then isHide = "" imgExpand = " " Else isHide = "display: none; " imgExpand = " " End If block = "
" indent = "" separator = " style='margin-top: 4px; margin-bottom: 4px; background-color: #E0E8EB;' " End If Select Case showTempl Case "" showCid = 1 showSid = 0 showTitle = subject showTempl = template body = rs("body") strTemplate = endblock & "
" & imgExpand & indent & "" & cid & "." & sid & " " & subject & "
" & block & vbcrLf Case else If showTempl = template then showCid = cid showSid = sid showTitle = subject body = rs("body") strTemplate = strTemplate & endblock & "
" & imgExpand & indent & "" & cid & "." & sid & " " & subject & "
" & block & vbcrLf Else: strTemplate = strTemplate & endblock & "
" & imgExpand & indent & "" & cid & "." & sid & " " & subject & "
" & block & vbcrLf End If End Select x = x + 1 rs.MoveNext Loop rs.close strTemplate = strTemplate & "
" End If If lcase(Request.ServerVariables("REQUEST_METHOD")) = "post" then isSearch = True commonWordsArray = Split("the for and where who that this then that from does will yes") as_keys = Trim(lCase(CStr(Request("T1")))) as_keysformat = CLng(Request("D1")) as_keys = Replace(as_keys, "'", "") as_keys = Replace(as_keys, "&", "") as_keys = Replace(as_keys, "<", "") as_keys = Replace(as_keys, ">", "") If Len(as_keys) < 3 then haltSearch = true Elseif Len(as_keys) > 2 Then as_queryKeys = formatKeywords(as_keys, as_keysformat) If Len(as_queryKeys) = 0 then haltSearch = true End If If not haltSearch then strSQL = "SELECT * FROM tblHelp WHERE " & as_queryKeys & " ORDER BY cid, sid;" Set rs = objConn.Execute(strSQL) If not rs.EOF then Set re = new RegExp re.global=true re.ignoreCase=true re.multiLine=true re.Pattern = "(<[^>]*>)|(\s{1,})" Set rek = new RegExp rek.global = False rek.ignoreCase = true searchResult = "
" searchResult = searchResult & "

Search result for [" & as_keys & "]:


" Do While not rs.EOF ID = CStr(rs("ID")) subject = rs("topic") cid = CLng(rs("cid")) sid = CLng(rs("sid")) sbody = rs("body") sbody = Replace(sbody, "
", " ") sbody = Replace(sbody, vbcrLf, " ") sbody = Replace(sbody, " ", " ") If re.test(sbody) then sbody = re.replace(sbody, " ") If as_keysformat = 3 then re_key = as_keys Else re_key = Split(as_keys, " ")(0) End If rek.Pattern = "\b.{0,80}(" & re_key & ").{0,80}\b" searchResult = searchResult & " " & cid & "." & sid & " " & subject & "
" If rek.test(sbody) Then Set kmatch = rek.execute(sbody) strKeyBody = kmatch(0) 'strKeyBody = Server.HTMLEncode(strKeyBody) strKeyBody = Replace(strKeyBody, re_key, "" & re_key & "",1,1,1) searchResult = searchResult & "
..." & strKeyBody & "...

" End If rs.moveNext Loop searchResult = searchResult & "
" Set re = Nothing Set rek = Nothing Else searchResult = "

No Match for keyword(s) [" & as_keys & "] was found...
" End If rs.close End If End If %> Admin Help - Rapid Classified v3.2c
Administrator Help - RC v3.15
Search for:  by:
<% If isSearch then If haltSearch Then %>

 

Search query is invalid. Please follow rules bellow:

  • Search is case insensitive. Please type keywords separated by a space.
  • Minimum length of keywords is 3 characters except for [Exact Phrase] in combination with other keywords.
  • Keywords should not contain common words except for [Exact Phrase] type search.
<% Else Response.Write searchResult End If Else key_form = Request("st") If key_form = 2 Or key_form = 3 then key_match = Request("keys") If Len(key_match) > 0 then Set re = new RegExp re.global=true re.ignoreCase=true re.multiLine=true If key_form = 3 then re.Pattern = "(" & key_match & ")" Else key_array = Split(key_match, " ") For each skey in key_array strPattern = strPattern & "|" & skey Next strPattern = Replace(strPattern, "|", "", 1,1,1) strPattern = "(" & strPattern & ")" re.Pattern = strPattern End If body = re.replace(body, "$1") Set re = Nothing End If End If Response.Write "
Chapter - " & showCid & "." & showSid & " " & showTitle & "
" Response.Write body End If %>
©2003-2009  Rapid Classified v3.15  GA Soft
<% objConn.close Set objConn = Nothing Function formatKeywords(keywords, kFormat) Select Case kFormat Case 3: formatKeywords = " AND (body LIKE '%" & keywords & "%' OR topic LIKE '%" & keywords & "%')" Case Else keywordsArray = Split(keywords) For I = 0 to UBound(keywordsArray) validkey = True If Len(keywordsArray(I)) > 2 then For each cword in commonWordsArray If keywordsArray(I) = cword then validkey = False Exit For End If Next Else: validkey = False End If If validkey then newkeywords = newkeywords & " " & keywordsArray(I) Next If Trim(newkeywords) = Empty then formatKeywords = Empty: Exit Function newkArray = Split(Trim(newkeywords)) For each r in newkArray If kFormat = 2 then formatKeywords = " AND (body LIKE '%" & r & "%' OR topic LIKE '%" & r & "%')" & formatKeywords Elseif kFormat = 1 then formatKeywords = " OR body LIKE '%" & r & "%' OR topic LIKE '%" & r & "%'" & formatKeywords End If Next If kFormat = 1 then formatKeywords = Replace(formatKeywords, "OR ", "", 1, 1) formatKeywords = " AND (" & formatKeywords & ") " End If End Select formatKeywords = Replace(Trim(formatKeywords), "AND", "",1,1,1) End Function %>