<%
'le parole da cercare sono messe in una variabile
strSearchWords = Trim(Request.QueryString("search"))
'se il sito è in inglese allora utilizzo l'html encoding
If blnEnglishLanguage = True Then
'rimpiazzo i tags html con i loro caratteri corrispondenti (in questo modo se qualcuno inserisce tags html da cercare viene stoppato)
strSearchWords = Server.HTMLEncode(strSearchWords)
'se il sito non è in inglese cambio i tags
Else
'cambio solo <> con la loro codifica HTML < >
strSearchWords = Replace(strSearchWords, "<", "<", 1, -1, 1)
strSearchWords = Replace(strSearchWords, ">", ">", 1, -1, 1)
End If
'metto le parole da crcare in un array pushandole
sarySearchWord = Split(Trim(strSearchWords), " ")
'leggo il numero del file da visualizzare
intFileNum = CInt(Request.QueryString("FileNumPosition"))
'imposto il numero di file visualizzati
intNumFilesShown = intFileNum
'Creo il file system object
Set fsoObject = Server.CreateObject("Scripting.FileSystemObject")
'se non sono state inserite parole da cercare allora
If NOT strSearchWords = "" Then
'mi metto sulla root
Set fldObject = fsoObject.GetFolder(Server.MapPath("./"))
'Leggo nel path del server questo script
strServerPath = fldObject.Path & "\"
'se la ricerca è in radice allorea metto la variabile a true
blnIsRoot = True
'metodo call per aviare la procedura di ricerca
Call SearchFile(fldObject)
'Reset variabili del serve
Set fsoObject = Nothing
Set fldObject = Nothing
'ALGORITMO DI ORDINAMENTO = BUBBLE SORT
Call SortResultsByNumMatches(sarySearchResults, intTotalFilesFound)
'Visualizzazione tabella html con i risultati
Response.Write vbCrLf & "
"
Response.Write vbCrLf & " "
'non ci sono records
If blnSearchResultsFound = False Then
Response.Write vbCrLf & " | Ho cercato nel sito " & strSearchWords & ". Nessun risultato. | "
'quanti records ho trovato?
Else
Response.Write vbCrLf & " Ho cercato nel sito " & strSearchWords & ". Risultati:" & intFileNum + 1 & " - " & intNumFilesShown & " di " & intTotalFilesFound & ". | "
End If
'chiudo la tabella html
Response.Write vbCrLf & "
"
Response.Write vbCrLf & "
"
'tabella dei risultati... se ce ne sono e di un messaggio con suggerimento se non ce ne sono
Response.Write vbCrLf & "
"
Response.Write vbCrLf & " "
Response.Write vbCrLf & " "
'messaggio che esce se non ho trovato niente
If blnSearchResultsFound = False Then
'mesaggio
Response.Write vbCrLf & " "
Response.Write vbCrLf & " La ricerca per- " & strSearchWords & " - no ha dato risultati."
Response.Write vbCrLf & "
"
Response.Write vbCrLf & " Suggerimenti:"
Response.Write vbCrLf & " "
Response.Write vbCrLf & " - Controlla di aver scritto le parole in modo corretto.
- Cambia parole.
- Inserisci parole di senso più generalizzato.
- Inserisci meno chiavi.
"
'altrimenti vedo i risultati
Else
'Scorro i risultati nel loro array
For intDisplayResultsLoopCounter = (intFileNum + 1) to intNumFilesShown
Response.Write vbCrLf & " "
Response.Write vbCrLf & " " & sarySearchResults(intDisplayResultsLoopCounter,1)
Response.Write vbCrLf & " "
Next
End If
'chiudo la tabella dei risultati
Response.Write vbCrLf & " | "
Response.Write vbCrLf & "
"
Response.Write vbCrLf & "
"
End If
'tabella dei links ad eventuai altri risultati
If intTotalFilesFound > intRecordsPerPage then
'tabella dei links ad altri risultati
Response.Write vbCrLf & "
"
Response.Write vbCrLf & "
"
Response.Write vbCrLf & " "
Response.Write vbCrLf & " "
Response.Write vbCrLf & " "
Response.Write vbCrLf & " "
Response.Write vbCrLf & " | "
Response.Write vbCrLf & " Pagina dei risultati: "
'se sono a pag > 1 visualizzo il torna indietro
If intNumFilesShown > intRecordsPerPage Then
Response.Write vbCrLf & " << Precedente "
End If
'se ci sono + pagine di risultati allora metto il link a tutte le pagine
If intTotalFilesFound > intRecordsPerPage Then
'ogni risultato viene linkato alla pagina corrispondente
For intPageLinkLoopCounter = 1 to CInt((intTotalFilesFound / intRecordsPerPage) + 0.5)
'se la pagina da linkare è quella corrente allora ovviamente non metto il link
If intFileNum = (intPageLinkLoopCounter * intRecordsPerPage) - intRecordsPerPage Then
Response.Write vbCrLf & " " & intPageLinkLoopCounter
Else
Response.Write vbCrLf & " " & intPageLinkLoopCounter & " "
End If
Next
End If
'se non mi trovo all'ultima pagina dei risultati allora metto il link alla pagina successiva
If intTotalFilesFound > intNumFilesShown then
Response.Write vbCrLf & " Successivo >>"
End If
'chiudo la tabella
Response.Write vbCrLf & " | "
Response.Write vbCrLf & " "
Response.Write vbCrLf & " "
Response.Write vbCrLf & " | "
Response.Write vbCrLf & "
"
Response.Write vbCrLf & "
"
End If
%>
| Cercati
<% = intTotalFilesSearched %>
documenti. |
<%
'***** START WARNING - REMOVAL OR MODIFICATION ******
'Response.Write(" I migliori hotels e centri benessere su hotelbeautyspa .it")
'***** END WARNING - REMOVAL OR MODIFICATION ******
%>
|