Ir para conteúdo
Fórum Script Brasil

Rodrigo_Linhas

Membros
  • Total de itens

    64
  • Registro em

  • Última visita

Tudo que Rodrigo_Linhas postou

  1. já tentei com este código abaixo e também não esta dando certo ele da o resultado de 1:36:0: sendo que que eu preciso que ele apareça 391:36:00 que é a soma certa, agora se eu tiro a formatação FormatDateTime ele fica 7,33333333333333 <% totalTempo = "0" 'Aqui entra as vareáveis Entrada = ""&FormatDateTime(rs("total"),3)&"" Entrada2 = ""&FormatDateTime(rs2("total"),3)&"" 'pega a diferença em minutos Manha = DateDiff("s",Entrada,Saida) Tarde = DateDiff("s",Entrada2,Saida2) 'Faz a somatória dos minutos totalTempo = Manha + Tarde 'separa horas:minutos do total segundos = (totalTempo) Mod 60 minutos = ((totalTempo - segundos) / 60) mod 60 horas = int((totalTempo) / 3600) TempoCompleto = (horas & ":" & minutos & ":" & segundos & ":") %> De que forma tenho que fazer isso, já pesquisei o forum de ponta a ponta e não achei nada conforme minha necessidade???
  2. Olá estou em uma dificuldade, não estou conseguindo calcular os horarios acima de 24h, preciso que ele me calcule o total de horas, por exemplo, 210:00:00! A Coluna do banco esta como hora e data Segue o Código abaixo: rs.open "select SUM (manhaentrada) as total from horario WHERE id='"&Request("id")&"'" <%=FormatDateTime(rs("total"),3)%> Já tentei usar mascaras mas também não deram certo! Espero que possam me ajudar!
  3. Nossa Mais uma vez você conseguiu me ajudar Bareta agradeço de verdade, espero em poder ajudar também, abraços fica com Deus!
  4. Será se ninguém tem algum código que possa me ajudar???
  5. Posta os códigos das duas páginas ai, principal.aspx e pagina2.aspx para que possamos dar uma ajuda!
  6. O Banco de dados esta vazio, e preciso que ele avise que não tem nenhum registro encontrado ao invez de aparecer esse erro abaixo! ADODB.Field erro '80020009' BOF ou EOF são verdadeiros, ou o registro atual foi excluído. A operação solicitada pelo aplicativo requer um registro atual. cadastrado.asp.asp, line 0 o id "EV0G8FHT3B" é de um usuario, e preciso dessa id para identificar ele e nas paginas cadastrado.asp?id=EV0G8FHT3B, porque assim, quando tem cadastro no banco a pagina lê normalmente só que quando o usuario é novo aparece esse erro ai!
  7. A sim, segue um dos valores da consulta... tipo o link segue cadastrado.asp?id=EV0G8FHT3B Banco esta assim: Tabela: Ponto codigo: autonumeração / chave primaria id: EV0G8FHT3B etc. Tabela: Funcionarios id:EV0G8FHT3B /sem chave primaria etc: e o codigo completo: <% cnpath="DBQ=" & Server.MapPath("meu.mdb") DataSource = "Driver={Microsoft Access Driver (*.mdb)}; " & cnpath Set Conn = Server.CreateObject("ADODB.Connection") Conn.Open DataSource Set rs = Server.CreateObject( "ADODB.Recordset" ) rs.ActiveConnection = conn rs.open "SELECT * FROM funcionarios where id = '"&Request("id")&"' order by id desc" Set rs1 = Server.CreateObject( "ADODB.Recordset" ) rs1.ActiveConnection = conn rs1.open "SELECT * FROM ponto where id = '"&Request.querystring("id")&"' order by id desc" %> <table border="1" width="100%" id="table" cellspacing="0" cellpadding="3" bordercolor="#000000"> <% If Not Rs1.Eof Then %> <tr> <td align="center""><%=rs1("data")%></td> <td align="center"><%=rs1("manhaentrada")%></td> <td align="center"><%=rs1("manhasaida")%></td> <td align="center"><%=rs1("tardeentrada")%></td> <td align="center"><%=rs1("tardesaida")%></td> </tr> <% else response.write("registro não encontrado") end if rs1.close set rs1=nothing %>
  8. Se eu tirar as aspas simples ele da erro de parametro!!!! :mellow:
  9. Olá galera estou com um problema e não consigo resolver, já pesquisei varios topicos aqui no Forum mas nenhum me ajudou, espero que vocês possam me ajudar! O problema é que quando o banco de dados esta vazio ele fica me dando aquele erro (ADODB.Field erro '80020009') e já coloquei aqueles codigos de BOF e EOF mas mesmo assim o erro continua! Segue o codigo abaixo! <% cnpath="DBQ=" & Server.MapPath("meu.mdb") DataSource = "Driver={Microsoft Access Driver (*.mdb)}; " & cnpath Set Conn = Server.CreateObject("ADODB.Connection") Conn.Open DataSource Set rs1 = Server.CreateObject( "ADODB.Recordset" ) rs1.ActiveConnection = conn rs1.open "SELECT * FROM ponto where id = '"&Request.querystring("id")&"' order by id desc" %> <table border="1" width="100%" id="table" cellspacing="0" cellpadding="3" bordercolor="#000000"> <% If Not Rs1.Eof Then %> <tr> <td align="center""><%=rs1("data")%></td> <td align="center"><%=rs1("manhaentrada")%></td> <td align="center"><%=rs1("manhasaida")%></td> <td align="center"><%=rs1("tardeentrada")%></td> <td align="center"><%=rs1("tardesaida")%></td> </tr> <% else response.write("registro não encontrado") end if rs1.close set rs1=nothing %>
  10. Nossa cara deu certinho, você nem tem noção de como me ajudou, agradeço de verdade, abraços! :lol:
  11. Olá galera, já fiz varias pesquisas aqui no Forum mas não consegui encontrar, tenho este código abaixo que lista os arquivos que estão dentro de uma pasta do servidor e quero salvar os resultados dentro de um bando de dados access só que estou com um problema pois o código abaixo está correto só que na pagina seguinte não consigo importar os resultados e outra preciso que cada input abaixo salve em registros diferentes! Exemplo: O input com o id numero1 salvar no banco com a id numero 1 e o input com a id numero2 salvar na proxima id, no banco de dados esta assim: Tabela: arquivos colunas: id, data, numero a id é a chave primaria! Segue abaixo o arquivo que faz a listagem da pasta do servidor. Listar.asp <form name="frmIncluir" method="POST" action="enviar.asp" onimage="return Incluir(this);"> <% Set fs = server.CreateObject("Scripting.FileSystemObject") Set pasta = fs.GetFolder("D:\web\localuser\rhsete\www\folhas\holerites\13-05-2011") %> <% FOR EACH file IN pasta.Files %> <input type="text" size="16" name="codigo" id="numero<%=n%>" value="<%=file.name%>" style="font-size: 14pt; font-family: Verdana; border-style:solid; border-width:1px; text-align: left; vertical-align: middle"><br> <%n = n + 1 NEXT %> <input type=image src="img/Salvar.png" name="salvar" width="80" height="80" title="Salvar"> Agora segue a pagina que seria para receber os dados desses formularios para salvar no bando de dados. enviar.asp "Aqui vir um codigo Request.Form automatico da pagina anterior" cnpath="DBQ=" & Server.MapPath("sistema.mdb") DataSource = "Driver={Microsoft Access Driver (*.mdb)}; " & cnpath Set Conn = Server.CreateObject("ADODB.Connection") Conn.Open DataSource sqlString = "INSERT INTO arquivos"&_ "(data, numero) VALUES ( '" & data & "', '" & numero & "' )" Conn.Execute sqlString %>
  12. Eu coloquei esse javascript que você colocou ai mas não adiantou em nada como eu disse a pagina não carrega nada fica toda cinza o que eu devo fazer???
  13. Ixiiii agora a pagina não carrega nada fica toda cinza rsrsrssss
  14. Olá galera estou com um problema no onsubmit="return Incluir(this)" quando clico em no botão submit ele grava os dados no banco 2 vezes oque será??? &lt;script LANGUAGE="Javascript"> <!-- function Incluir(varForm){ if (varForm.cargo.value == ""){ window.alert ("O campo Cargo é de preenchimento obrigatório"); varForm.cargo.focus(); return false; } if (varForm.nome.value == ""){ window.alert ("O campo Nome é de preenchimento obrigatório"); varForm.nome.focus(); return false; } varForm.submit(); } --> </SCRIPT> <form name="frmIncluir" method="POST" action="adicionar.asp" onsubmit="return Incluir(this);"> Cargo: <input type=text name="cargo"> Nome: <input type=text name="nome"> <input type="submit" value="Cadastrar" name="B1">
  15. Não tenho o conhecimento em Ajax não, e ASP não conheço muito não, conheço bem pouco, se tiver o código pronto eu agradeço cara, abraços
  16. Olá galera, já pesquisei em todos os topicos aqui e num achei nenhuma resposta que me ajude, procurei no google e só achei em PHP e necessito em (ASP). Preciso de um auto completar em um input type=text mas que pegue as informações de uma tabela do bando de dados (MDB)! Tenho um código aqui que faz essa função mas ele pega as funções dentro do javascript Meu Banco de Dados: Nome: rh7.mdb Tabela: cargos Colunas: id - cargo <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>Auto Completar</title> <style type="text/css"> .suggestion_list { background: white; border: 1px solid; padding: 4px; } .suggestion_list ul { padding: 0; margin: 0; list-style-type: none; } .suggestion_list a { text-decoration: none; color: navy; } .suggestion_list .selected { background: navy; color: white; } .suggestion_list .selected a { color: white; } #autosuggest { display: none; } </style> &lt;script language="Javascript" src="autosuggest.js"></script> </head> <body> <div id="autosuggest"><ul> </ul></div> <form> <fieldset> <input type="text" name="state" id="state" /> &lt;script language="Javascript"> var states = new Array("Alabama","Alaska","American Samoa","Arizona","Arkansas","California"); new AutoSuggest(document.getElementById('state'),states); </script> </fieldset> </form> </body> </html> Eu vi varios em AJAX mas ai já me confundi todo porque só achei em PHP rsrsrs..... espero que alguém possa me ajudar!
  17. Rodrigo_Linhas

    Adaptar Slide

    Foiiii malsss :lol: SEGUE ABAIXO O ARQUIVO STYLE style.css: DOWNLOAD
  18. Rodrigo_Linhas

    Adaptar Slide

    Olha eu olhei o script que faz o efeito de FADE e vi que tinha uma configuração com opção de deixar ou retirar, ai eu retirei o efeito! o nome do arquivo é jquery.galleryview-1.1.js você baixa e coloca dentro da pasta JS Download Abraços
  19. Rodrigo_Linhas

    Adaptar Slide

    Então amigo esse script que eu adaptei ele da o efeito de fade nas noticias, e o efeito esta dentro dos arquivos (JS). Ai pra tirar esse efeito teria que estudar esse escript todo, mas acho que esse que eu te mandei da pra quebrar um galho em, se por acaso você quiser ai posta num tópico de (JS) que alguém que manja altera pra você. Abraços.
  20. Segue abaixo um código que faz uma busca completa em seu site: Esse código faz a busca por meio de <title> e <meta name="Description"> É só salvar esse código abaixo como busca.asp e colocar no servidor <% Option Explicit %> <% 'Set the response buffer to true Response.Buffer = False 'Dimension global variables Dim fsoObject 'File system object Dim fldObject 'Folder object Dim sarySearchWord 'Array to hold the words to be searched for Dim strSearchWords 'Holds the search words Dim blnIsRoot 'Set to true if we are searching in the root directory Dim strFileURL 'Holds the path to the file on the site Dim strServerPath 'Holds the server path to this script Dim intNumFilesShown 'Holds the number of files shown so far Dim intTotalFilesSearched 'Holds the number of files searched Dim intTotalFilesFound 'Holds the total matching files found Dim intFileNum 'Holds the file number Dim intPageLinkLoopCounter 'Loop counter to display links to the other result pages Dim sarySearchResults(1000,2) 'Two Dimensional Array holding the search results Dim intDisplayResultsLoopCounter 'loop counter to diplay the results of the search Dim intResultsArrayPosition 'Stores the array position of the array storing the results Dim blnSearchResultsFound 'Set to true if search results are found Dim strFilesTypesToSearch 'Holds the types of files to be searched Dim strBarredFolders 'Holds the folders that you don't want searched Dim strBarredFiles 'Holds the names of the files not to be searched Dim blnEnglishLanguage 'Set to True if the user is using English ' -------------------------- Change the following line to the number of results you wish to have on each page ------------------------------------ Const intRecordsPerPage = 10 'change this to the number of results to show on each page ' --------------------- Place the names of the files types you want searching in the following line sepeararted by commas -------------------------- strFilesTypesToSearch = "htm,html,asp,shtml" ' --------------------- Place the names of the folders you don't want searched in the following line spearated by commas -------------------------- strBarredFolders = "cgi_bin,_bin" 'cgi_bin and _bin have been put in here as examples, but you can put any folders in here ' ---------- Place the names of the files you don't want searched in the following line spearated by commas include the file extension ------------- strBarredFiles = "adminstation.htm,no_allowed.asp" 'adminstration.htm and not_allowed.asp have been put in as an examples ' -------------------- Set this boolean to False if you are not using an English language web site -------------------------------------------------- blnEnglishLanguage = True 'True = HTML Encode best for English sites \ False = no Emcoding best for non English sites '----------------------------------------------------------------------------------------------------------------------------------------------------- 'Initalise variables intTotalFilesSearched = 0 %> <html> <head> <title>Busca</title> <meta name="Description" content="Sessão de Busca"> <meta name="KeyWords" content="SITE DE BUSCA"> &lt;script language="JavaScript"> var search_icon_off = new Image(); search_icon_off.src = "site_search_icon_off.gif"; function CheckForm () { //Check for a word to search if (document.frmSiteSearch.search.value==""){ alert("Please enter at least one keyword to search"); document.frmSiteSearch.search.focus(); return false; } return true } // --> </script> </head> <body bgcolor="#FFFFFF" text="#000000" link="#0000CC" vlink="#0000CC" alink="#FF0000"> <h1 align="center">Busca</h1> <form method="get" name="frmSiteSearch" action="site_search.asp" onSubmit="return CheckForm();"> <table cellpadding="0" cellspacing="0" width="90%" align="center"> <tr> <td height="66" width="165" align="right" rowspan="3" valign="middle"> <img border="0" src="http://2.bp.blogspot.com/_qtrNsoytyj8/TCaj2gs_OZI/AAAAAAAAD-w/EGSGIfYrp2E/s1600/busca2.jpg" width="100" height="97"> </td> <td height="66" width="15" align="right" rowspan="3" valign="middle"> </td> <td class="arial" height="4" width="571"> Pesquisar: </td> </tr> <tr> <td class="normal" height="2" width="571"> <input type="TEXT" name="search" maxlength="50" size="36" value="<% =Request.QueryString("search") %>"> <input type="submit" value="Buscar >>" name="submit"> </td> </tr> <tr> <td class="normal" height="34" width="571" valign="top"> Pesquisar em : <input type="radio" name="mode" value="allwords" CHECKED> Todas as Palavras <input type="radio" name="mode" value="anywords"> Qualquer Palavra <input type="radio" name="mode" value="phrase"> Frase</td> </tr> </table> </form> <% 'Read in all the search words into one variable strSearchWords = Trim(Request.QueryString("search")) 'If the site is in English then use the server HTML encode method If blnEnglishLanguage = True Then 'Replace any HTML tags with the HTML codes for the same characters (stops people entering HTML tags) strSearchWords = Server.HTMLEncode(strSearchWords) 'If the site is not english just change the script tags Else 'Just replace the script tag <> with HTML encoded < and > strSearchWords = Replace(strSearchWords, "<", "<", 1, -1, 1) strSearchWords = Replace(strSearchWords, ">", ">", 1, -1, 1) End If 'Slit each word to be searched up and place in an array sarySearchWord = Split(Trim(strSearchWords), " ") 'Read the file number to show from intFileNum = CInt(Request.QueryString("FileNumPosition")) 'Set the number of files shown so far to the file number read in above intNumFilesShown = intFileNum 'Create the file system object Set fsoObject = Server.CreateObject("Scripting.FileSystemObject") 'If there is no words entered by the user to search for then dont carryout the file search routine If NOT strSearchWords = "" Then 'Get the path and the root folder to be searched Set fldObject = fsoObject.GetFolder(Server.MapPath("./")) 'Read in the server path to this ASP script strServerPath = fldObject.Path & "\" 'Set to true as this is searching the root directory blnIsRoot = True 'Call the search sub prcedure Call SearchFile(fldObject) 'Reset server variables Set fsoObject = Nothing Set fldObject = Nothing 'Call the Bubble Sort procedure to sort the results into highest matches first Call SortResultsByNumMatches(sarySearchResults, intTotalFilesFound) 'Display the HTML table with the results status of the search or what type of search it is Response.Write vbCrLf & " <table width=""98%"" border=""0"" cellspacing=""1"" cellpadding=""1"" align=""center"" bgcolor=""#CCCCCC"">" Response.Write vbCrLf & " <tr>" 'Display that there where no matching records found If blnSearchResultsFound = False Then Response.Write vbCrLf & " <td> Procurou no site <b>" & strSearchWords & "</b>. Desculpe, não houve resultados encontrados.</td>" 'Else Search went OK so display how many records found Else Response.Write vbCrLf & " <td> Pesquisado o site para <b>" & strSearchWords & "</b>. Exibindo Resultados " & intFileNum + 1 & " - " & intNumFilesShown & " á " & intTotalFilesFound & ".</td>" End If 'Close the HTML table with the search status Response.Write vbCrLf & " </tr>" Response.Write vbCrLf & " </table>" 'HTML table to display the search results or an error if there are no results Response.Write vbCrLf & " <table width=""95%"" border=""0"" cellspacing=""1"" cellpadding=""1"" align=""center"">" Response.Write vbCrLf & " <tr>" Response.Write vbCrLf & " <td>" 'If no results are found then display an error message If blnSearchResultsFound = False Then 'Write HTML displaying the error Response.Write vbCrLf & " <br>" Response.Write vbCrLf & " Sua Busca - <b>" & strSearchWords & "</b> - não encontrou nenhum arquivos neste site." Response.Write vbCrLf & " <br><br>" Response.Write vbCrLf & " Sugestões:" Response.Write vbCrLf & " <br>" Response.Write vbCrLf & " <ul><li>Certifique-se que todas as palavras estão escritas corretamente.<li>Tente palavras-chave diferentes.<li>Tente palavras mais genéricas.<li>Tente menos palavras-chave.</ul>" 'Else display the results Else 'Loop round to display each result within the search results array For intDisplayResultsLoopCounter = (intFileNum + 1) to intNumFilesShown Response.Write vbCrLf & " <br>" Response.Write vbCrLf & " " & sarySearchResults(intDisplayResultsLoopCounter,1) Response.Write vbCrLf & " <br>" Next End If 'Close the HTML table displaying the results Response.Write vbCrLf & " </td>" Response.Write vbCrLf & " </tr>" Response.Write vbCrLf & " </table>" End If 'Display an HTML table with links to the other search results If intTotalFilesFound > intRecordsPerPage then 'Display an HTML table with links to the other search results Response.Write vbCrLf & " <br>" Response.Write vbCrLf & " <table width=""100%"" border=""0"" cellspacing=""0"" cellpadding=""0"" align=""center"">" Response.Write vbCrLf & " <tr>" Response.Write vbCrLf & " <td>" Response.Write vbCrLf & " <table width=""100%"" border=""0"" cellpadding=""0"" cellspacing=""0"">" Response.Write vbCrLf & " <tr>" Response.Write vbCrLf & " <td width=""50%"" align=""center"">" Response.Write vbCrLf & " Results Page: " 'If the page number is higher than page 1 then display a back link If intNumFilesShown > intRecordsPerPage Then Response.Write vbCrLf & " <a href=""site_search.asp?FileNumPosition=" & intFileNum - intRecordsPerPage & "&search=" & Replace(strSearchWords, " ", "+") & "&mode=" & Request.QueryString("mode") & """ target=""_self""><< Prev</a> " End If 'If there are more pages to display then display links to all the search results pages If intTotalFilesFound > intRecordsPerPage Then 'Loop to diplay a hyper-link to each page in the search results For intPageLinkLoopCounter = 1 to CInt((intTotalFilesFound / intRecordsPerPage) + 0.5) 'If the page to be linked to is the page displayed then don't make it a hyper-link If intFileNum = (intPageLinkLoopCounter * intRecordsPerPage) - intRecordsPerPage Then Response.Write vbCrLf & " " & intPageLinkLoopCounter Else Response.Write vbCrLf & " <a href=""site_search.asp?FileNumPosition=" & (intPageLinkLoopCounter * intRecordsPerPage) - intRecordsPerPage & "&search=" & Replace(strSearchWords, " ", "+") & "&mode=" & Request.QueryString("mode") & """ target=""_self"">" & intPageLinkLoopCounter & "</a> " End If Next End If 'If it is Not the last of the search results than display a next link If intTotalFilesFound > intNumFilesShown then Response.Write vbCrLf & " <a href=""site_search.asp?FileNumPosition=" & intNumFilesShown & "&search=" & Replace(strSearchWords, " ", "+") & "&mode=" & Request.QueryString("mode") & """ target=""_self"">Next >></a>" End If 'Finsh HTML the table Response.Write vbCrLf & " </td>" Response.Write vbCrLf & " </tr>" Response.Write vbCrLf & " </table>" Response.Write vbCrLf & " </td>" Response.Write vbCrLf & " </tr>" Response.Write vbCrLf & " </table>" End If %> <br> <div align="center"> <table width="98%" border="0" cellspacing="1" cellpadding="1" bgcolor="#CCCCCC" align="center"> <tr> <td width="47%" height="18"> Procurado <% = intTotalFilesSearched %> documentos no total. </td> <td width="53%" align="right" height="18"><% '***** START WARNING - REMOVAL OR MODIFICATION OF THIS CODE WILL VIOLATE THE LICENSE AGREEMENT ****** Response.Write(" Seu site - <a href=""http://www.seusite.com.br"" target=""_blank"">www.seusite.com.br</a>") '***** END WARNING - REMOVAL OR MODIFICATION OF THIS CODE WILL VIOLATE THE LICENSE AGREEMENT ****** %> </td> </tr> </table> <!-- Swap animated search icon for still icon --> &lt;script langauge="JavaScript">document.searchIcon.src = search_icon_off.src</script> </div> <br> </body> </html> <% 'Sub procedure to do the search Public Sub SearchFile(fldObject) 'Dimension local variabales Dim objRegExp 'Regular Expersions object Dim objMatches 'Holds the matches collection of the regular expresions object Dim filObject 'File object Dim tsObject 'Text stream object Dim subFldObject 'Sub folder object Dim strFileContents 'Holds the contents of the file being searched Dim strPageTitle 'Holds the title of the page Dim strPageDescription 'Holds the description of the page Dim strPageKeywords 'Holds the keywords of the page Dim intSearchLoopCounter 'Loop counter to search all the words in the array Dim intNumMatches 'Holds the number of matches Dim blnSearchFound 'Set to true if the search words are found 'Error handler On Error Resume Next 'Set the error object to 0 Err.Number = 0 'Create the regular expresions object Set objRegExp = New RegExp 'If an error has occured then the server does not support Regular Expresions If Err.Number <> 0 Then Response.Write("<br>Error The Server does not support the Regular Expessions object<br>Please download the alternative version of this application from http://www.webwizguide.info/asp/sample_scripts/site_search_script.asp") 'Reset error object Err.Number = 0 End If 'Loop to search each file in the folder For Each filObject in fldObject.Files 'Check the file extension to make sure the file is of the extension type to be searched If InStr(1, strFilesTypesToSearch, fsoObject.GetExtensionName(filObject.Name), vbTextCompare) > 0 Then 'Check to make sure the file about to be searched is not a barred file if it is don't search the file If NOT InStr(1, strBarredFiles, filObject.Name, vbTextCompare) > 0 Then 'Initalise the search found variable to flase blnSearchFound = False 'Initalise the number of matches variable intNumMatches = 0 'Set the regular exprsion object to read all cases of the occurance not just the first objRegExp.Global = True 'Set the regular expression object to ignore case objRegExp.IgnoreCase = True 'Open the file for searching Set tsObject = filObject.OpenAsTextStream 'Read in the contents of the file strFileContents = tsObject.ReadAll 'Read in the title of the file strPageTitle = GetFileMetaTag("<title>", "</title>", strFileContents) 'Read in the description meta tag of the file strPageDescription = GetFileMetaTag("<meta name=""description"" content=""", """>", strFileContents) 'Read in the keywords of the file strPageKeywords = GetFileMetaTag("<meta name=""keywords"" content=""", """>", strFileContents) 'Set the pattern using regular expressions to srip any HTML tags objRegExp.Pattern = "<[^>]*>" 'Strip HTML tags from the contects of the file to be searched strFileContents = objRegExp.Replace(strFileContents,"") 'Put the tittle, description and the keywords back into the file to be searched strFileContents = strFileContents & " " & strPageTitle & " " & strPageDescription & " " & strPageKeywords 'If the user has choosen to search by phrase If Request.QueryString("mode") = "phrase" Then 'Set the pattern to search for objRegExp.Pattern = "\b" & strSearchWords & "\b" 'Search the file for the phrase Set objMatches = objRegExp.Execute(strFileContents) 'Check to see if the phrase has been found If objMatches.Count > 0 Then 'Get the number of times the phrase is matched intNumMatches = objMatches.Count 'If the search is found then set the search found variable to true blnSearchFound = True End If 'Else the search is either by all or any words Else 'If the search is by all words then initialise the search found variable to true If Request.QueryString("mode") = "allwords" then blnSearchFound = True 'Loop round to search for each word to be searched For intSearchLoopCounter = 0 to UBound(sarySearchWord) 'Set the pattern to search for objRegExp.Pattern = "\b" & sarySearchWord(intSearchLoopCounter) & "\b" 'Search the file for the search words Set objMatches = objRegExp.Execute(strFileContents) 'Check to see if any of the words have been found If objMatches.Count > 0 Then 'Get the number of times the search word is matched intNumMatches = intNumMatches + objMatches.Count 'If the search word is found and the search is for any words then set the search found variable to true If Request.QueryString("mode") = "anywords" then blnSearchFound = True Else 'If the search word is not found and the search is for all words then set the search found variable back to false as one of the words has not been found If Request.QueryString("mode") = "allwords" then blnSearchFound = False End If Next End If 'Calculate the total files searched intTotalFilesSearched = intTotalFilesSearched + 1 'If the page contains no title then Page Title variable the appropriate message to display If strPageTitle = "" Then strPageTitle = "No Title" 'If the page contains no title then Page Description variable the appropriate message to display If strPageDescription = "" Then strPageDescription = "Não há descrição disponível para essa página" 'If the search found variable is true then display the results If blnSearchFound = True Then 'Calculate the total files found intTotalFilesFound = intTotalFilesFound + 1 'Check that the file shown is between the the files shown so far and the maximum files to show per page If intNumFilesShown < (intRecordsPerPage + intFileNum) and intTotalFilesFound > intNumFilesShown Then 'Calculate the number of results shown intNumFilesShown = intNumFilesShown + 1 End If 'Place the search results into the saerch results array 'Calculate the array position of the results array intResultsArrayPosition = intResultsArrayPosition + 1 'Set the search results found boolean to true blnSearchResultsFound = True 'If the file is in the root directory then If blnIsRoot = True Then 'Place the search results into the search results array sarySearchResults(intResultsArrayPosition,1) = "<a href=""./" & filObject.Name & """ target=""_self"">" & strPageTitle & "</a>" 'Else it is not in the root directiory Else 'Place the search results into the search results array sarySearchResults(intResultsArrayPosition,1) = "<a href=""./" & strFileURL & fldObject.Name & "/" & filObject.Name & """ target=""_self"">" & strPageTitle & "</a>" End If 'Place the rest of the search results in the search results array sarySearchResults(intResultsArrayPosition,1) = sarySearchResults(intResultsArrayPosition,1) & vbCrLf & " <br>" & strPageDescription sarySearchResults(intResultsArrayPosition,1) = sarySearchResults(intResultsArrayPosition,1) & vbCrLf & " <font size=""2"" color=""#0000FF""><br><i>Pesquisado " & intNumMatches & " - Atualizado em " & FormatDateTime(filObject.DateLastModified, VbLongDate) & " - Tamanho " & CInt(filObject.Size / 1024) & "kb</i></font>" 'Read in the number of search word matches into the second part of the two dimensional array sarySearchResults(intResultsArrayPosition,2) = intNumMatches End If 'Close the text stream object tsObject.Close End If End If Next 'Reset the Regular Expression object Set objRegExp = Nothing 'Loop to search through the sub folders within the site For Each subFldObject In FldObject.SubFolders 'Check to make sure the folder about to be searched is not a barred folder if it is then don't search If NOT InStr(1, strBarredFolders, subFldObject.Name, vbTextCompare) > 0 Then 'Set to false as we are searching sub directories blnIsRoot = False 'Get the server path to the file strFileURL = fldObject.Path & "\" 'Turn the server path to the file into a URL path to the file strFileURL = Replace(strFileURL, strServerPath, "") 'Replace the NT backslash with the internet forward slash in the URL to the file strFileURL = Replace(strFileURL, "\", "/") 'Encode the file name and path into the URL code method strFileURL = Server.URLEncode(strFileURL) 'Just incase it's encoded any backslashes strFileURL = Replace(strFileURL, "%2F", "/") 'Call the search sub prcedure to search the web site Call SearchFile(subFldObject) End If Next 'Reset server variables Set filObject = Nothing Set tsObject = Nothing Set subFldObject = Nothing End Sub 'Sub procedure to sort the array using a Bubble Sort to place highest matches first Private Sub SortResultsByNumMatches(ByRef sarySearchResults, ByRef intTotalFilesFound) 'Dimension variables Dim intArrayGap 'Holds the part of the array being sorted Dim intIndexPosition 'Holds the Array index position being sorted Dim intTempResultsHold 'Temperary hold for the results if they need swapping array positions Dim intTempNumMatchesHold 'Temperary hold for the number of matches for the result if they need swapping array positions Dim intPassNumber 'Holds the pass number for the sort 'Loop round to sort each result found For intPassNumber = 1 To intTotalFilesFound 'Shortens the number of passes For intIndexPosition = 1 To (intTotalFilesFound - intPassNumber) 'If the Result being sorted hass less matches than the next result in the array then swap them If sarySearchResults(intIndexPosition,2) < sarySearchResults((intIndexPosition+1),2) Then 'Place the Result being sorted in a temporary variable intTempResultsHold = sarySearchResults(intIndexPosition,1) 'Place the Number of Matches for the result being sorted in a temporary variable intTempNumMatchesHold = sarySearchResults(intIndexPosition,2) 'Do the array position swap 'Move the next Result with a higher match rate into the present array location sarySearchResults(intIndexPosition,1) = sarySearchResults((intIndexPosition+1),1) 'Move the next Number of Matches for the result with a higher match rate into the present array location sarySearchResults(intIndexPosition,2) = sarySearchResults((intIndexPosition+1),2) 'Move the Result from the teporary holding variable into the next array position sarySearchResults((intIndexPosition+1),1) = intTempResultsHold 'Move the Number of Matches for the result from the teporary holding variable into the next array position sarySearchResults((intIndexPosition+1),2) = intTempNumMatchesHold End If Next Next End Sub 'Function to read in the files meta tags Private Function GetFileMetaTag(ByRef strStartValue, ByRef strEndValue, ByVal strFileContents) 'Dimension Variables Dim intStartPositionInFile 'Holds the start position in the file Dim intEndPositionInFile 'Holds the end position in the file 'Get the start position in the file of the meta tag intStartPositionInFile = InStr(1, LCase(strFileContents), strStartValue, 1) 'If no description or keywords are found then you may be using http-equiv= instead of name= in your meta tags If intStartPositionInFile = 0 And InStr(strStartValue, "name=") Then 'Swap name= for http-equiv= strStartValue = Replace(strStartValue, "name=", "http-equiv=") 'Check again for keywords or description intStartPositionInFile = InStr(1, LCase(strFileContents), strStartValue, 1) End If 'If there is a description then the position in file will be over 0 If NOT intStartPositionInFile = 0 Then 'Get the end position of the HTML meta tag intStartPositionInFile = intStartPositionInFile + Len(strStartValue) 'Get the position in file of the closing tag for the meta tag intEndPositionInFile = InStr(intStartPositionInFile, LCase(strFileContents), strEndValue, 1) 'Read in the meta tag from the file for the function to return GetFileMetaTag = Trim(Mid(strFileContents, intStartPositionInFile, (intEndPositionInFile - intStartPositionInFile))) 'If the is no meta tag then the GetFileMetaTag function returns a null value Else GetFileMetaTag = "" End If End Function %>
  21. Rodrigo_Linhas

    Adaptar Slide

    Ok amigo esta aqui o que você precisava! Tem opção de administração ok, e coloquei também o titulo e subtitulo pra puxar do banco de dados! Bom da pra quebrar o galho! rsrsrsrs DOWNLOAD Vou mostrar o que eu fiz nos detalhes: Bando de dados: imagens.mbd TABELA: Imagens id titulo subtitulo imagem link Agora a página que puxa os dados do banco de dados - Index.asp <% 'cnpath="DBQ=" & Server.MapPath("Imagens.mdb") DataSource = "Driver={Microsoft Access Driver (*.mdb)}; " & cnpath Set Conn = Server.CreateObject("ADODB.Connection") Conn.Open DataSource 'Abre o Recordset Set rs = Server.CreateObject( "ADODB.Recordset" ) rs.ActiveConnection = conn rs.open "SELECT * FROM Imagens order by id ASC" %> <link type="text/css" rel="stylesheet" href="style.css" /> &lt;script type="text/javascript" src="js/jquery-1.3.2.min.js"></script> &lt;script type="text/javascript" src="js/jquery.easing.1.3.js"></script> &lt;script type="text/javascript" src="js/jquery.galleryview-1.1.js"></script> &lt;script type="text/javascript" src="js/jquery.timers-1.1.2.js"></script> &lt;script type="text/javascript"> $(document).ready(function(){ $('#photos').galleryView({ panel_width: 500, panel_height: 230, frame_width: 40, frame_height: 40 }); }); </script> <!-- InstanceEndEditable --> </head> <body> <div id="photos" class="galleryview"> <% if not rs.eof then while not rs.eof %> <div class="panel"> <img src="<%=rs("imagem")%>" /> <div class="panel-overlay"> <h2 align="left"><%=rs("titulo")%></h2> <p align="left"><%=rs("subtitulo")%></p> </div> </div> <% rs.Movenext wend end if %> <ul class="filmstrip"> <li><img src="imagens/1.jpg" width="40" height="40" /></li> <li><img src="imagens/2.jpg" width="40" height="40" /></li> <li><img src="imagens/3.jpg" width="40" height="40" /></li> <li><img src="imagens/4.jpg" width="40" height="40" /></li> <li><img src="imagens/5.jpg" width="40" height="40" /></li> <li><img src="imagens/6.jpg" width="40" height="40" /></li> <li><img src="imagens/7.jpg" width="40" height="40" /></li> </ul> </div> </body> <!-- InstanceEnd --></html> Espero que tenham gostado!!! Abraços
  22. Rodrigo_Linhas

    Adaptar Slide

    Olha eu adaptei esse script pra vc, ta tudo mastigado rsrsrs é só baixar e enviar pro server meu amigo! Download Segue o código abaixo: <% 'cnpath="DBQ=" & Server.MapPath("Imagens.mdb") cnpath="DBQ=" & Server.MapPath("\slide\Imagens.mdb") DataSource = "Driver={Microsoft Access Driver (*.mdb)}; " & cnpath Set Conn = Server.CreateObject("ADODB.Connection") Conn.Open DataSource 'Abre o Recordset Set rs = Server.CreateObject( "ADODB.Recordset" ) rs.ActiveConnection = conn rs.open "SELECT * FROM Imagens order by id desc" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head> <title>jquery sliders</title> <link rel="stylesheet" href="style.css" type="text/css" media="screen" /> <script type="text/javascript">var _siteRoot='index.html',_root='index.html';</script> <script type="text/javascript" src="js/jquery.js"></script> <script type="text/javascript" src="js/scripts.js"></script> </head> <body> <!--/top--> <div id="header"><div class="wrap"> <div id="slide-holder"> <div id="slide-runner"> <% if not rs.eof then while not rs.eof %> <a href="<%=rs("link")%>"><img id="slide-img-<%=rs("id")%>" src="<%=rs("imagem")%>" class="slide" alt="" /></a> <% rs.Movenext wend end if %> <div id="slide-controls"> <p id="slide-client" class="text"><strong>post: </strong><span></span></p> <p id="slide-desc" class="text"></p> <p id="slide-nav"></p> </div> </div> <!--content featured gallery here --> </div> <script type="text/javascript"> if(!window.slider) var slider={};slider.data=[{"id":"slide-img-1","client":"Coloque o titulo da 1º imagem aqui","desc":"e o subtitulo da 1º imagem aqui"},{"id":"slide-img-2","client":"Coloque o titulo da 2º imagem aqui","desc":"e o subtitulo da 2º imagem aqui"},{"id":"slide-img-3","client":"Coloque o titulo da 3º imagem aqui","desc":"e o subtitulo da 3º imagem aqui"},{"id":"slide-img-4","client":"Coloque o titulo da 4º imagem aqui","desc":"e o subtitulo da 4º imagem aqui"},{"id":"slide-img-5","client":"Coloque o titulo da 5º imagem aqui","desc":"e o subtitulo da 5º imagem aqui"},{"id":"slide-img-6","client":"Coloque o titulo da 6º imagem aqui","desc":"e o subtitulo da 6º imagem aqui"},{"id":"slide-img-7","client":"Coloque o titulo da 7º imagem aqui","desc":"e o subtitulo da 7º imagem aqui"}]; </script> </div></div><!--/header--> </body> </html>
  23. Rodrigo_Linhas

    Chat em asp

    Olá galera, sei que muitos procuram chat em asp diferente, mas sempre acham os chat simples sem opções nenhuma, então estou passando aqui para postar um modelo que eu peguei na internet e modifiquei, bom ele é um chat simples porem acresentei 2 opções a mais, 1 com opção de avatares e a outra com opção de cores! Coloquei opções de você escolher um dos bonequinhos e a outra com opção de mudar a cor do seu nick e frase! Veja a imagem abaixo: Instalação: Extrair, copiar pasta e colar no servidor! Tamanho: 516kb Formato: Zip DOWNLOAD Espero que vocês gostem, por favor postem comentarios!!!
×
×
  • Criar Novo...