<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%> <% dim count_page dim search_change dim total_speeches dim word_search, word_array, word_bound, word_len dim word_url dim search_condition, search_statement dim i total_speeches = 0 word_search = request.Form("word_search") title="Marcus Word" if word_search <> "" then search_change = Replace(word_search, "'", "~^") search_change = Replace(search_change, "'", "~^^") word_array = split(search_change, " ") word_bound = Ubound(word_array) word_len = word_bound + 1 end if %> JAH - <%=title%> >


Search Garvey Word
<%if word_search = "" then%>
More Speeches will be added to this list

<%end if%> Speeches and Poems of Marcus Garvey

<% if word_search = "" then '***************** word display no search ******************** call display_speeches(search_condition, "", "") else if word_len = 1 then '***************** word search one word with space ******************** search_condition = "word_title LIKE '% "&search_change&" %' OR word LIKE '% "&search_change&" %'" search_statement = "Word Search " & """_"&search_change&"_""" call display_speeches(search_condition, search_statement, "one-space") '***************** word search one word NO space ******************** search_condition = "word NOT LIKE '% "&search_change&" %' AND " &"word_title LIKE '%"&search_change&"%' OR word LIKE '%"&search_change&"%'" search_statement = "Word Search " & """"&search_change&"""" call display_speeches(search_condition, search_statement, "one-no space") '*************************************************************************** else '***************** word search phrase NO space ******************** search_condition = "word_title LIKE '%"&search_change&"%' OR word LIKE '%"&search_change&"%'" search_statement = "Word Search " & """"&search_change&"""" call display_speeches(search_condition, search_statement, "one-no space") '*************************************************************************** '***************** word search multiple with space ******************** search_condition = "(word_title NOT LIKE '%"&search_change&"%' AND word NOT LIKE '%"&search_change&"%') AND " for i=0 to word_bound if i <> 0 then search_condition = search_condition & " AND " end if search_condition = search_condition & "(word_title LIKE '% "&word_array(i)&" %' OR word LIKE '% "&word_array(i)&" %')" Next search_statement = "Word Search " for i=0 to word_bound if i <> 0 then search_statement = search_statement & " AND " end if search_statement = search_statement & """_"&word_array(i)&"_""" Next call display_speeches(search_condition, search_statement, "multiple-space") '***************** word search multiple NO space ******************** search_condition = "(word_title NOT LIKE '%"&search_change&"%' AND word NOT LIKE '%"&search_change&"%') AND " for i=0 to word_bound if i <> 0 then search_condition = search_condition & " AND " end if search_condition = search_condition & "(word_title LIKE '%"&word_array(i)&"%' OR word LIKE '%"&word_array(i)&"%')" Next search_statement = "Word Search " for i=0 to word_bound if i <> 0 then search_statement = search_statement & " AND " end if search_statement = search_statement & """"&word_array(i)&"""" Next call display_speeches(search_condition, search_statement, "multiple-no space") '*************************************************************************** end if end if %>


<% '************************************************************************************** '************************** FUNCTIONS ***************************** '************************************************************************************** sub display_speeches(s_condition, s_statement, s_type) dim WordData Set WordData = New Ark_Data dim word_title, prev_word_title prev_word_title = "zzz" Set WordData = Ark_DBAccess.DBSelect("marcus_words", "word_title", s_condition, "word_title") if WordData.DataExists then if word_search <> "" then response.Write("
") if s_type = "one-space" OR s_type = "multiple-space" then response.Write("_ represents a space

") end if response.Write("") response.Write(s_statement) response.Write("

") end if response.Write("") WordTitleIndex = WordData.GetItemIndex("word_title") For WrPos= 0 to WordData.UpperBound word_title = WordData.GetItemByIndex(WordTitleIndex, WrPos) if word_title <> prev_word_title then if word_search <> "" then word_url = "&word_search="&server.URLEncode(word_search)&"&search_type="&server.URLEncode(s_type) end if %> <%total_speeches = total_speeches + 1 end if prev_word_title = word_title Next%>
<%=replace(word_title, "~", "'")%>


<% if word_search = "" then response.Write("Currently "&total_speeches&" Speeches") end if end if end sub %>