<% Response.Buffer=True ' ' OneFile Search Engine (ofSearch v1.0) ' Copyright ©2000 Sixto Luis Santos ' All Rights Reserved ' ' Note: ' This program is freeware. This program is NOT in the Public Domain. ' You can freely use this program in your own site. ' ' You cannot re-distribute the code, by any means, ' without the express written authorization by the author. ' ' Use this program at your own risk. ' ' Globals -------------------------------------- ' ---------------------------------------------- Const ValidFiles = "htmltxt" Const RootFld = "./" Dim Matched Dim Regex Dim GetTitle Dim fs Dim rfLen dim RootFolder Dim DocCount Dim DocMatchCount Dim MatchedCount ' ---------------------------------------------- ' Procedure: SearchFiles() ' ---------------------------------------------- Public Sub SearchFiles(FolderPath) Dim fsFolder Dim fsFolder2 Dim fsFile Dim fsText Dim FileText Dim FileTitle Dim FileTitleMatch Dim MatchCount Dim OutputLine ' Consigue la carpeta de arranque Set fsFolder = fs.GetFolder(FolderPath) ' Interactua por cada archivo en la carpeta For Each fsFile In fsFolder.Files ' Compara la extensión del archivo actual con la lista de archivos del blanco válidos If InStr(1, ValidFiles, Right(fsFile.Name, 3), vbTextCompare) > 0 Then DocCount = DocCount + 1 ' Abre el archivo para leer su volumen Set fsText = fsFile.OpenAsTextStream FileText = fsText.ReadAll ' Aplica los regex para investigar y consegir los resultados encontrados MatchCount = Regex.Execute(FileText).Count MatchedCount = MatchedCount + MatchCount If MatchCount > 0 Then DocMatchCount = DocMatchCount + 1 ' Aplica otro regex para conseguir el título del documento del html Set FileTitleMatch = GetTitle.Execute(FileText) If FileTitleMatch.Count > 0 Then ' Las etiquetas del título FileTitle = Trim(replace(Mid(FileTitleMatch.Item(0),8),"","",1,1,1)) ' En caso de que el título está vacío If FileTitle = "" Then FileTitle = "Sin Título (" & fsFile.Name & ")" End If Else ' Crea un nombre de la entrada alternado (si ningún título encontrara) FileTitle = "Dominicos de Venezuela .:::Provincia Bética (" & fsFile.Name & ")" End If ' Crea la línea de la entrada con el formato apropiado ' Agrega el número de la entrada OutputLine = "  " & DocMatchCount & ". " ' Agrega el nombre del documento y link OutputLine = OutputLine & "" OutputLine = OutputLine & FileTitle & "" ' Agrega la información del documento OutputLine = OutputLine & "
  Criterio de búsqueda " & MatchCount & " ítems - Tamaño: " OutputLine = OutputLine & FormatNumber(fsFile.Size / 1024,2 ,-1,0,-1) & "K bytes" OutputLine = OutputLine & " - Última modificación: " & formatdatetime(fsFile.DateLastModified,vbShortDate) & "


" ' La entrada del despliegue Response.Write OutputLine Response.Flush End If fsText.Close End If Next ' Interactua por cada subCarpeta y recursividad llaman a este procedimiento For Each fsFolder2 In fsFolder.SubFolders SearchFiles fsFolder2.Path Next Set FileTitleMatch = Nothing Set fsText = Nothing Set fsFile = Nothing Set fsFolder2 = Nothing Set fsFolder = Nothing End Sub ' ---------------------------------------------- ' Procedure: Search() ' ---------------------------------------------- Sub Search(SearchString) Dim i Dim fKeys Dim fItems Set fs = CreateObject("Scripting.FileSystemObject") Set GetTitle = New RegExp Set Regex = New RegExp With Regex .Global = True .IgnoreCase = True .Pattern = Trim(SearchString) End With With GetTitle .Global = False .IgnoreCase = True .Pattern = "(.|\n)*" End With RootFolder = Server.MapPath(RootFld) If Right(RootFld,1) <> "/" Then RootFld = RootFld & "/" End If If Right(RootFolder, 1) <> "\" Then RootFolder = RootFolder & "\" End If rfLen = Len(RootFolder) + 1 SearchFiles RootFolder If MatchedCount = 0 Then Response.Write "  No se encontraron resultados.
" End If Set Regex = Nothing Set GetTitle = Nothing Set fs = Nothing End Sub %> Dominicos de Venezuela .:::Buscador:::.

Buscador

Escriba la palabra o frase: " name="query">
<% If Trim(Request.QueryString("query")) <> "" Then %>

<% Response.Flush Search Request.QueryString("query") If DocCount > 0 Then %>
<% End If End If %>
Imprimir Artículo



:: Principal :: Inicio :: Chat :: Directorio :: Foro ::
:: Convento San Jacinto :: Historia | Parroquia | Videope | Centro de Historia | Infancia Misionera ::
:: Convento Nuestra Señora del Carmen :: Capilla | Colegio Santo Tomás ::
:: Parroquia Santo Domingo de Guzmán :: Cátedra :: Buscador ::
:: Copyright © 2002 Dominicos de Venezuela .:::Provincia Bética:::. Todos los derechos reservados ::
<% Response.End %>