Ir para conteúdo

POWERED BY:

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

swinguinha

contador de hits

Recommended Posts

quero saber qual as paginas mais visidadas do siteja coloquei na tabelo um campo com o nome hitsagora alguem poderia me dizer como é esse codigo e onde eu insiro na paginapor favor preciso urgente....postem aqui o codigo

Compartilhar este post


Link para o post
Compartilhar em outros sites

eae cara !!! fmz totaalll !?

por favor preciso urgente....postem aqui o codigo

:blink: cara se você vai fazer por bd .... você coloca uma instrução q sempre ao carregar a pagina ele adiciona + 1 na tabela hits ...agora uma duvida tbm .... o q pesa mais no site .... inserir sempre mais 1 na tabela do bd ... ou inserir mais 1 em um arquivo texto !?

Compartilhar este post


Link para o post
Compartilhar em outros sites

sobre a pergunta que me fez acho q o adicionar mais um no banco de dados pesa mais. pois das as paginas usam sempre o mesmo banco de dados. e o aquivo de texo fica so pra contagem

Compartilhar este post


Link para o post
Compartilhar em outros sites

O codigo eh simples veio de atualização

 

ASP

[*]SQL4 "SELECT * FROM contador"

 

[*]Set Ctr Server.CreateObject("ADODB.RecordSet")

 

[*]Ctr.Open SQL4,Conexao,3,3

 

[*]

 

[*]Visitas Ctr("Visitas")+1

 

[*]

 

[*]Conexao.Execute("UPDATE contador SET Visitas='"&Visitas&"'")

 

Dah uma olhada ae

Compartilhar este post


Link para o post
Compartilhar em outros sites

eu sou iniciante ainda no assuntoo nome da tabela eh baixo e campo e hits como ficaai eh só inserir esse codigo na minha pagina é?me explique detalhadamente por favor...

Compartilhar este post


Link para o post
Compartilhar em outros sites

tentei com esse codigo ai mas da erropois a pagina ja possui uma conexao ai como façovou detalhar aqui meu banco de dadosNome do Banco de dados: conteudonome da tabela: baixonome do campo: hitscoloque o codigo apartir dessas informações...não esqueça que a pagina ja possui uma conexao

Compartilhar este post


Link para o post
Compartilhar em outros sites

aqui estar o codigo da pagina...como ficaria?<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%><!--#include file="../../Connections/conexao.asp" --><%Dim Recordset1Dim Recordset1_numRowsSet Recordset1 = Server.CreateObject("ADODB.Recordset")Recordset1.ActiveConnection = MM_conexao_STRINGRecordset1.Source = "SELECT * FROM cifra_baixo"Recordset1.CursorType = 0Recordset1.CursorLocation = 2Recordset1.LockType = 1Recordset1.Open()Recordset1_numRows = 0%><%Dim Recordset2__MMColParamRecordset2__MMColParam = "1"If (Request.QueryString("idbaixo") <> "") Then Recordset2__MMColParam = Request.QueryString("idbaixo")End If%><%Dim Recordset2Dim Recordset2_numRowsSet Recordset2 = Server.CreateObject("ADODB.Recordset")Recordset2.ActiveConnection = MM_conexao_STRINGRecordset2.Source = "SELECT * FROM cifra_baixo WHERE idbaixo = " + Replace(Recordset2__MMColParam, "'", "''") + ""Recordset2.CursorType = 0Recordset2.CursorLocation = 2Recordset2.LockType = 3Recordset2.Open()Recordset2_numRows = 0%><%Dim Recordset3__MMColParamRecordset3__MMColParam = "1"If (Request.QueryString("idbaixo") <> "") Then Recordset3__MMColParam = Request.QueryString("idbaixo")End If%><%Dim Recordset3Dim Recordset3_numRowsSet Recordset3 = Server.CreateObject("ADODB.Recordset")Recordset3.ActiveConnection = MM_conexao_STRINGRecordset3.Source = "SELECT * FROM imprimir_baixo WHERE idbaixo = " + Replace(Recordset3__MMColParam, "'", "''") + ""Recordset3.CursorType = 0Recordset3.CursorLocation = 2Recordset3.LockType = 1Recordset3.Open()Recordset3_numRows = 0%><%Dim Repeat1__numRowsDim Repeat1__indexRepeat1__numRows = -1Repeat1__index = 0Recordset1_numRows = Recordset1_numRows + Repeat1__numRows%><%' *** Recordset Stats, Move To Record, and Go To Record: declare stats variablesDim Recordset1_totalDim Recordset1_firstDim Recordset1_last' set the record countRecordset1_total = Recordset1.RecordCount' set the number of rows displayed on this pageIf (Recordset1_numRows < 0) Then Recordset1_numRows = Recordset1_totalElseif (Recordset1_numRows = 0) Then Recordset1_numRows = 1End If' set the first and last displayed recordRecordset1_first = 1Recordset1_last = Recordset1_first + Recordset1_numRows - 1' if we have the correct record count, check the other statsIf (Recordset1_total <> -1) Then If (Recordset1_first > Recordset1_total) Then Recordset1_first = Recordset1_total End If If (Recordset1_last > Recordset1_total) Then Recordset1_last = Recordset1_total End If If (Recordset1_numRows > Recordset1_total) Then Recordset1_numRows = Recordset1_total End IfEnd If%><%' *** Recordset Stats: if we don't know the record count, manually count themIf (Recordset1_total = -1) Then ' count the total records by iterating through the recordset Recordset1_total=0 While (Not Recordset1.EOF) Recordset1_total = Recordset1_total + 1 Recordset1.MoveNext Wend ' reset the cursor to the beginning If (Recordset1.CursorType > 0) Then Recordset1.MoveFirst Else Recordset1.Requery End If ' set the number of rows displayed on this page If (Recordset1_numRows < 0 Or Recordset1_numRows > Recordset1_total) Then Recordset1_numRows = Recordset1_total End If ' set the first and last displayed record Recordset1_first = 1 Recordset1_last = Recordset1_first + Recordset1_numRows - 1 If (Recordset1_first > Recordset1_total) Then Recordset1_first = Recordset1_total End If If (Recordset1_last > Recordset1_total) Then Recordset1_last = Recordset1_total End IfEnd If%><%Dim MM_paramName %><%' *** Move To Record and Go To Record: declare variablesDim MM_rsDim MM_rsCountDim MM_sizeDim MM_uniqueColDim MM_offsetDim MM_atTotalDim MM_paramIsDefinedDim MM_paramDim MM_indexSet MM_rs = Recordset1MM_rsCount = Recordset1_totalMM_size = Recordset1_numRowsMM_uniqueCol = ""MM_paramName = ""MM_offset = 0MM_atTotal = falseMM_paramIsDefined = falseIf (MM_paramName <> "") Then MM_paramIsDefined = (Request.QueryString(MM_paramName) <> "")End If%><%' *** Move To Record: handle 'index' or 'offset' parameterif (Not MM_paramIsDefined And MM_rsCount <> 0) then ' use index parameter if defined, otherwise use offset parameter MM_param = Request.QueryString("index") If (MM_param = "") Then MM_param = Request.QueryString("offset") End If If (MM_param <> "") Then MM_offset = Int(MM_param) End If ' if we have a record count, check if we are past the end of the recordset If (MM_rsCount <> -1) Then If (MM_offset >= MM_rsCount Or MM_offset = -1) Then ' past end or move last If ((MM_rsCount Mod MM_size) > 0) Then ' last page not a full repeat region MM_offset = MM_rsCount - (MM_rsCount Mod MM_size) Else MM_offset = MM_rsCount - MM_size End If End If End If ' move the cursor to the selected record MM_index = 0 While ((Not MM_rs.EOF) And (MM_index < MM_offset Or MM_offset = -1)) MM_rs.MoveNext MM_index = MM_index + 1 Wend If (MM_rs.EOF) Then MM_offset = MM_index ' set MM_offset to the last possible record End IfEnd If%><%' *** Move To Record: if we dont know the record count, check the display rangeIf (MM_rsCount = -1) Then ' walk to the end of the display range for this page MM_index = MM_offset While (Not MM_rs.EOF And (MM_size < 0 Or MM_index < MM_offset + MM_size)) MM_rs.MoveNext MM_index = MM_index + 1 Wend ' if we walked off the end of the recordset, set MM_rsCount and MM_size If (MM_rs.EOF) Then MM_rsCount = MM_index If (MM_size < 0 Or MM_size > MM_rsCount) Then MM_size = MM_rsCount End If End If ' if we walked off the end, set the offset based on page size If (MM_rs.EOF And Not MM_paramIsDefined) Then If (MM_offset > MM_rsCount - MM_size Or MM_offset = -1) Then If ((MM_rsCount Mod MM_size) > 0) Then MM_offset = MM_rsCount - (MM_rsCount Mod MM_size) Else MM_offset = MM_rsCount - MM_size End If End If End If ' reset the cursor to the beginning If (MM_rs.CursorType > 0) Then MM_rs.MoveFirst Else MM_rs.Requery End If ' move the cursor to the selected record MM_index = 0 While (Not MM_rs.EOF And MM_index < MM_offset) MM_rs.MoveNext MM_index = MM_index + 1 WendEnd If%><%' *** Move To Record: update recordset stats' set the first and last displayed recordRecordset1_first = MM_offset + 1Recordset1_last = MM_offset + MM_sizeIf (MM_rsCount <> -1) Then If (Recordset1_first > MM_rsCount) Then Recordset1_first = MM_rsCount End If If (Recordset1_last > MM_rsCount) Then Recordset1_last = MM_rsCount End IfEnd If' set the boolean used by hide region to check if we are on the last recordMM_atTotal = (MM_rsCount <> -1 And MM_offset + MM_size >= MM_rsCount)%><%' *** Go To Record and Move To Record: create strings for maintaining URL and Form parametersDim MM_keepNoneDim MM_keepURLDim MM_keepFormDim MM_keepBothDim MM_removeListDim MM_itemDim MM_nextItem' create the list of parameters which should not be maintainedMM_removeList = "&index="If (MM_paramName <> "") Then MM_removeList = MM_removeList & "&" & MM_paramName & "="End IfMM_keepURL=""MM_keepForm=""MM_keepBoth=""MM_keepNone=""' add the URL parameters to the MM_keepURL stringFor Each MM_item In Request.QueryString MM_nextItem = "&" & MM_item & "=" If (InStr(1,MM_removeList,MM_nextItem,1) = 0) Then MM_keepURL = MM_keepURL & MM_nextItem & Server.URLencode(Request.QueryString(MM_item)) End IfNext' add the Form variables to the MM_keepForm stringFor Each MM_item In Request.Form MM_nextItem = "&" & MM_item & "=" If (InStr(1,MM_removeList,MM_nextItem,1) = 0) Then MM_keepForm = MM_keepForm & MM_nextItem & Server.URLencode(Request.Form(MM_item)) End IfNext' create the Form + URL string and remove the intial '&' from each of the stringsMM_keepBoth = MM_keepURL & MM_keepFormIf (MM_keepBoth <> "") Then MM_keepBoth = Right(MM_keepBoth, Len(MM_keepBoth) - 1)End IfIf (MM_keepURL <> "") Then MM_keepURL = Right(MM_keepURL, Len(MM_keepURL) - 1)End IfIf (MM_keepForm <> "") Then MM_keepForm = Right(MM_keepForm, Len(MM_keepForm) - 1)End If' a utility function used for adding additional parameters to these stringsFunction MM_joinChar(firstItem) If (firstItem <> "") Then MM_joinChar = "&" Else MM_joinChar = "" End IfEnd Function%><%' *** Move To Record: set the strings for the first, last, next, and previous linksDim MM_keepMoveDim MM_moveParamDim MM_moveFirstDim MM_moveLastDim MM_moveNextDim MM_movePrevDim MM_urlStrDim MM_paramListDim MM_paramIndexDim MM_nextParamMM_keepMove = MM_keepBothMM_moveParam = "index"' if the page has a repeated region, remove 'offset' from the maintained parametersIf (MM_size > 1) Then MM_moveParam = "offset" If (MM_keepMove <> "") Then MM_paramList = Split(MM_keepMove, "&") MM_keepMove = "" For MM_paramIndex = 0 To UBound(MM_paramList) MM_nextParam = Left(MM_paramList(MM_paramIndex), InStr(MM_paramList(MM_paramIndex),"=") - 1) If (StrComp(MM_nextParam,MM_moveParam,1) <> 0) Then MM_keepMove = MM_keepMove & "&" & MM_paramList(MM_paramIndex) End If Next If (MM_keepMove <> "") Then MM_keepMove = Right(MM_keepMove, Len(MM_keepMove) - 1) End If End IfEnd If' set the strings for the move to linksIf (MM_keepMove <> "") Then MM_keepMove = MM_keepMove & "&"End IfMM_urlStr = Request.ServerVariables("URL") & "?" & MM_keepMove & MM_moveParam & "="MM_moveFirst = MM_urlStr & "0"MM_moveLast = MM_urlStr & "-1"MM_moveNext = MM_urlStr & CStr(MM_offset + MM_size)If (MM_offset - MM_size < 0) Then MM_movePrev = MM_urlStr & "0"Else MM_movePrev = MM_urlStr & CStr(MM_offset - MM_size)End If%><html><head><title><%=(Recordset3.Fields.Item("nome_musica").Value)%></title><meta name="keywords" content="cifras, cifra, letras, traduzidas, traduções, partituras, violão, viola, partitura, tablatura, tablaturas, cifrasmusic, ciframusica, violão, guitar, guitarra, cordas, chords, programas, acordes, cavaco, cavaquinho, teclado, music, sexo, jogos"><meta name="description" content="O maior acervo de cifras, tablaturas e letras de músicas nacionais e internacionais com desenhos de acordes para violão, guitarra, teclado, bateria, baixo e outros instrumentos. Cursos, aulas, dicas, classificados..."><meta name="robots" content="index,follow"><meta http-equiv="content-language" content="pt-BR"><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><link href="../../css/estilo.css" rel="stylesheet" type="text/css"></head><body bgcolor="#E6E6E6" topmargin="6"><div align="center"> <table width="730" border="0" align="center" cellpadding="0" cellspacing="1"> <tr> <td height="92"> <div align="center"> <iframe frameborder=0 height=92 marginheight=0 marginwidth=0 scrolling=no src="../../includes/banner_cifras.asp" width=730></iframe> </div></td> </tr> </table> <br> <script language=JavaScript src="../../script/cifras.js"></script></div><table width="760" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="15"><img src="../../img/icons/t_bl.gif" width="15" height="20"></td> <td width="746" bgcolor="#FFFFFF"> </td> <td width="15"><img src="../../img/icons/t_brrr.gif" width="15" height="20"></td> </tr> <tr> <td bgcolor="#FFFFFF"> </td> <td bgcolor="#FFFFFF"><TABLE border=0 cellPadding=0 cellSpacing=0 height=2 width=730> <TBODY> <TR> <TD height=21 width=344><span class="texto2"><FONT color=#666666><strong><img src="../../imagem/x.gif" width="13" height="13"></strong></FONT></span><span class="texto"><FONT color=#666666><strong><font color="#FF3333"> Música:</font></strong></FONT></span><FONT color=#666666 face="Verdana, Arial, Helvetica, sans-serif" size=2><strong> </strong></FONT><FONT color=#666666 face="Verdana, Arial, Helvetica, sans-serif"><strong><span class="texto2"><font color="#333333" face="Verdana"><em><%=(Recordset3.Fields.Item("nome_musica").Value)%></em></font></span></strong></FONT></TD> <TD height=21 width=11></TD> <TD height=21 width=375> <P align=right class="textoforme"><B><font size="4"><%=(Recordset3.Fields.Item("artista").Value)%></font></B></P></TD> </TR> <TR> <TD bgColor=#cccccc height=1 width=344><IMG border=0 height=1 src="Acheicifras_com_br_arquivos/nada.gif" width=10></TD> </TR> <TR> <TD bgColor=#ffffff height=2 width=344><IMG border=0 height=11 src="../../img/icons/nada.gif" width=30></TD> <TD bgColor=#ffffff height=2 width=11><IMG height=11 src="../../img/icons/linha_diagonal.gif" width=11></TD> <TD bgColor=#ffffff height=2 width=375><IMG border=0 height=11 src="../../img/icons/nada.gif" width=30></TD> </TR> <TR> <TD bgColor=#ffffff height=1 width=344><IMG border=0 height=1 src="img/icons/nada.gif" width=10></TD> <TD bgColor=#ffffff height=1 width=11><IMG border=0 height=1 src="img/icons/nada.gif" width=10></TD> <TD bgColor=#cccccc height=1 width=375><IMG border=0 height=1 src="img/icons/nada.gif" width=10></TD> </TR> </TBODY> </TABLE></td> <td bgcolor="#FFFFFF"> </td> </tr> <tr> <td width="15" height="157" bgcolor="#FFFFFF"> </td> <td align="left" valign="top" bgcolor="#FFFFFF"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="51" align="center" valign="top" class="texto"> <div align="center"><span class="texto"><strong><a href="impbaixo.asp?<%= "impbaixo=" & Recordset3.Fields.Item("idbaixo").Value %>"><img src="../../img/icons/printer.gif" width="34" height="34" border="0"></a> </strong></span><br> Imprimir</div></td> <td width="58" align="center" valign="top" class="texto"><span class="texto"><strong><a href="../../contatos/contatos.asp"><img src="../../img/icons/contens.gif" width="34" height="34" border="0"></a> </strong></span><br> Contatos <TD width=59 height=46 align="center" valign="top" class=texto><A onmouseover="window.status='Auto-Rolagem';return true" onclick="atrl();return false;" onmouseout="window.status='';return true" href="#"><IMG src="../../img/icons/rolar.gif" alt="auto rolagem" width=34 height=34 border="0"></A> <br> Rolagem</td> <td width="72" align="center" valign="top" class="texto"><span class="texto"><strong> </strong></span><span class="texto"><strong> </strong></span></td> <td width="355" align="center" valign="bottom" class="texto2"><strong>Hits: </strong></td> </tr> </table> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td><div align="left"> <hr size="1" noshade> </div></td> </tr> <tr> <td height="113" align="left" valign="top"> <table width="100%" border="0" cellspacing="0" cellpadding="2"> <tr> <td class=""><div id=newtools style="FONT: 7pt verdana"> <pre><font size="2"><%=(Recordset3.Fields.Item("musica").Value)%></font> </pre> </div></td> </tr> </table></td> </tr> </table></td> <td width="15" bgcolor="#FFFFFF"> </td> </tr> <tr> <td><img src="../../img/icons/t_al.gif" width="15" height="20"></td> <td bgcolor="#FFFFFF"> </td> <td><img src="../../img/icons/t_cl.gif" width="15" height="20"></td> </tr></table><div align="center"><br> <iframe frameborder=0 height=16 marginheight=0 marginwidth=0 scrolling=no src="../../includes/rodape2.asp" width=500></iframe></div></body></html><%Recordset1.Close()Set Recordset1 = Nothing%><%Recordset2.Close()Set Recordset2 = Nothing%><%Recordset3.Close()Set Recordset3 = Nothing%>

Compartilhar este post


Link para o post
Compartilhar em outros sites

ja apaguei as mensagens repetidas...-------------------------------------------Bem cara não tem errobasta você colocar nas paginas um codigo pra atualizar o numero de visitase criar uma tabela que tenha as pages e os seus respectivos nuemros de visitas...não sei se foi seu topico mas vi um topicos semelhante ainda hoja...

Compartilhar este post


Link para o post
Compartilhar em outros sites

O rpz e justamente esse codigo q naum sei como ehvou lhe passar o cogigo da pagina ai você colocaNome do Banco de dados: conteudonome da tabela: baixonome do campo: hitsaqui segui o cogigo da pagina coloca ai<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%><!--#include file="../../Connections/conexao.asp" --><%Dim Recordset1Dim Recordset1_numRowsSet Recordset1 = Server.CreateObject("ADODB.Recordset")Recordset1.ActiveConnection = MM_conexao_STRINGRecordset1.Source = "SELECT * FROM cifra_baixo"Recordset1.CursorType = 0Recordset1.CursorLocation = 2Recordset1.LockType = 1Recordset1.Open()Recordset1_numRows = 0%><%Dim Recordset2__MMColParamRecordset2__MMColParam = "1"If (Request.QueryString("idbaixo") <> "") Then Recordset2__MMColParam = Request.QueryString("idbaixo")End If%><%Dim Recordset2Dim Recordset2_numRowsSet Recordset2 = Server.CreateObject("ADODB.Recordset")Recordset2.ActiveConnection = MM_conexao_STRINGRecordset2.Source = "SELECT * FROM cifra_baixo WHERE idbaixo = " + Replace(Recordset2__MMColParam, "'", "''") + ""Recordset2.CursorType = 0Recordset2.CursorLocation = 2Recordset2.LockType = 3Recordset2.Open()Recordset2_numRows = 0%><%Dim Recordset3__MMColParamRecordset3__MMColParam = "1"If (Request.QueryString("idbaixo") <> "") Then Recordset3__MMColParam = Request.QueryString("idbaixo")End If%><%Dim Recordset3Dim Recordset3_numRowsSet Recordset3 = Server.CreateObject("ADODB.Recordset")Recordset3.ActiveConnection = MM_conexao_STRINGRecordset3.Source = "SELECT * FROM imprimir_baixo WHERE idbaixo = " + Replace(Recordset3__MMColParam, "'", "''") + ""Recordset3.CursorType = 0Recordset3.CursorLocation = 2Recordset3.LockType = 1Recordset3.Open()Recordset3_numRows = 0%><%Dim Repeat1__numRowsDim Repeat1__indexRepeat1__numRows = -1Repeat1__index = 0Recordset1_numRows = Recordset1_numRows + Repeat1__numRows%><%' *** Recordset Stats, Move To Record, and Go To Record: declare stats variablesDim Recordset1_totalDim Recordset1_firstDim Recordset1_last' set the record countRecordset1_total = Recordset1.RecordCount' set the number of rows displayed on this pageIf (Recordset1_numRows < 0) Then Recordset1_numRows = Recordset1_totalElseif (Recordset1_numRows = 0) Then Recordset1_numRows = 1End If' set the first and last displayed recordRecordset1_first = 1Recordset1_last = Recordset1_first + Recordset1_numRows - 1' if we have the correct record count, check the other statsIf (Recordset1_total <> -1) Then If (Recordset1_first > Recordset1_total) Then Recordset1_first = Recordset1_total End If If (Recordset1_last > Recordset1_total) Then Recordset1_last = Recordset1_total End If If (Recordset1_numRows > Recordset1_total) Then Recordset1_numRows = Recordset1_total End IfEnd If%><%' *** Recordset Stats: if we don't know the record count, manually count themIf (Recordset1_total = -1) Then ' count the total records by iterating through the recordset Recordset1_total=0 While (Not Recordset1.EOF) Recordset1_total = Recordset1_total + 1 Recordset1.MoveNext Wend ' reset the cursor to the beginning If (Recordset1.CursorType > 0) Then Recordset1.MoveFirst Else Recordset1.Requery End If ' set the number of rows displayed on this page If (Recordset1_numRows < 0 Or Recordset1_numRows > Recordset1_total) Then Recordset1_numRows = Recordset1_total End If ' set the first and last displayed record Recordset1_first = 1 Recordset1_last = Recordset1_first + Recordset1_numRows - 1 If (Recordset1_first > Recordset1_total) Then Recordset1_first = Recordset1_total End If If (Recordset1_last > Recordset1_total) Then Recordset1_last = Recordset1_total End IfEnd If%><%Dim MM_paramName %><%' *** Move To Record and Go To Record: declare variablesDim MM_rsDim MM_rsCountDim MM_sizeDim MM_uniqueColDim MM_offsetDim MM_atTotalDim MM_paramIsDefinedDim MM_paramDim MM_indexSet MM_rs = Recordset1MM_rsCount = Recordset1_totalMM_size = Recordset1_numRowsMM_uniqueCol = ""MM_paramName = ""MM_offset = 0MM_atTotal = falseMM_paramIsDefined = falseIf (MM_paramName <> "") Then MM_paramIsDefined = (Request.QueryString(MM_paramName) <> "")End If%><%' *** Move To Record: handle 'index' or 'offset' parameterif (Not MM_paramIsDefined And MM_rsCount <> 0) then ' use index parameter if defined, otherwise use offset parameter MM_param = Request.QueryString("index") If (MM_param = "") Then MM_param = Request.QueryString("offset") End If If (MM_param <> "") Then MM_offset = Int(MM_param) End If ' if we have a record count, check if we are past the end of the recordset If (MM_rsCount <> -1) Then If (MM_offset >= MM_rsCount Or MM_offset = -1) Then ' past end or move last If ((MM_rsCount Mod MM_size) > 0) Then ' last page not a full repeat region MM_offset = MM_rsCount - (MM_rsCount Mod MM_size) Else MM_offset = MM_rsCount - MM_size End If End If End If ' move the cursor to the selected record MM_index = 0 While ((Not MM_rs.EOF) And (MM_index < MM_offset Or MM_offset = -1)) MM_rs.MoveNext MM_index = MM_index + 1 Wend If (MM_rs.EOF) Then MM_offset = MM_index ' set MM_offset to the last possible record End IfEnd If%><%' *** Move To Record: if we dont know the record count, check the display rangeIf (MM_rsCount = -1) Then ' walk to the end of the display range for this page MM_index = MM_offset While (Not MM_rs.EOF And (MM_size < 0 Or MM_index < MM_offset + MM_size)) MM_rs.MoveNext MM_index = MM_index + 1 Wend ' if we walked off the end of the recordset, set MM_rsCount and MM_size If (MM_rs.EOF) Then MM_rsCount = MM_index If (MM_size < 0 Or MM_size > MM_rsCount) Then MM_size = MM_rsCount End If End If ' if we walked off the end, set the offset based on page size If (MM_rs.EOF And Not MM_paramIsDefined) Then If (MM_offset > MM_rsCount - MM_size Or MM_offset = -1) Then If ((MM_rsCount Mod MM_size) > 0) Then MM_offset = MM_rsCount - (MM_rsCount Mod MM_size) Else MM_offset = MM_rsCount - MM_size End If End If End If ' reset the cursor to the beginning If (MM_rs.CursorType > 0) Then MM_rs.MoveFirst Else MM_rs.Requery End If ' move the cursor to the selected record MM_index = 0 While (Not MM_rs.EOF And MM_index < MM_offset) MM_rs.MoveNext MM_index = MM_index + 1 WendEnd If%><%' *** Move To Record: update recordset stats' set the first and last displayed recordRecordset1_first = MM_offset + 1Recordset1_last = MM_offset + MM_sizeIf (MM_rsCount <> -1) Then If (Recordset1_first > MM_rsCount) Then Recordset1_first = MM_rsCount End If If (Recordset1_last > MM_rsCount) Then Recordset1_last = MM_rsCount End IfEnd If' set the boolean used by hide region to check if we are on the last recordMM_atTotal = (MM_rsCount <> -1 And MM_offset + MM_size >= MM_rsCount)%><%' *** Go To Record and Move To Record: create strings for maintaining URL and Form parametersDim MM_keepNoneDim MM_keepURLDim MM_keepFormDim MM_keepBothDim MM_removeListDim MM_itemDim MM_nextItem' create the list of parameters which should not be maintainedMM_removeList = "&index="If (MM_paramName <> "") Then MM_removeList = MM_removeList & "&" & MM_paramName & "="End IfMM_keepURL=""MM_keepForm=""MM_keepBoth=""MM_keepNone=""' add the URL parameters to the MM_keepURL stringFor Each MM_item In Request.QueryString MM_nextItem = "&" & MM_item & "=" If (InStr(1,MM_removeList,MM_nextItem,1) = 0) Then MM_keepURL = MM_keepURL & MM_nextItem & Server.URLencode(Request.QueryString(MM_item)) End IfNext' add the Form variables to the MM_keepForm stringFor Each MM_item In Request.Form MM_nextItem = "&" & MM_item & "=" If (InStr(1,MM_removeList,MM_nextItem,1) = 0) Then MM_keepForm = MM_keepForm & MM_nextItem & Server.URLencode(Request.Form(MM_item)) End IfNext' create the Form + URL string and remove the intial '&' from each of the stringsMM_keepBoth = MM_keepURL & MM_keepFormIf (MM_keepBoth <> "") Then MM_keepBoth = Right(MM_keepBoth, Len(MM_keepBoth) - 1)End IfIf (MM_keepURL <> "") Then MM_keepURL = Right(MM_keepURL, Len(MM_keepURL) - 1)End IfIf (MM_keepForm <> "") Then MM_keepForm = Right(MM_keepForm, Len(MM_keepForm) - 1)End If' a utility function used for adding additional parameters to these stringsFunction MM_joinChar(firstItem) If (firstItem <> "") Then MM_joinChar = "&" Else MM_joinChar = "" End IfEnd Function%><%' *** Move To Record: set the strings for the first, last, next, and previous linksDim MM_keepMoveDim MM_moveParamDim MM_moveFirstDim MM_moveLastDim MM_moveNextDim MM_movePrevDim MM_urlStrDim MM_paramListDim MM_paramIndexDim MM_nextParamMM_keepMove = MM_keepBothMM_moveParam = "index"' if the page has a repeated region, remove 'offset' from the maintained parametersIf (MM_size > 1) Then MM_moveParam = "offset" If (MM_keepMove <> "") Then MM_paramList = Split(MM_keepMove, "&") MM_keepMove = "" For MM_paramIndex = 0 To UBound(MM_paramList) MM_nextParam = Left(MM_paramList(MM_paramIndex), InStr(MM_paramList(MM_paramIndex),"=") - 1) If (StrComp(MM_nextParam,MM_moveParam,1) <> 0) Then MM_keepMove = MM_keepMove & "&" & MM_paramList(MM_paramIndex) End If Next If (MM_keepMove <> "") Then MM_keepMove = Right(MM_keepMove, Len(MM_keepMove) - 1) End If End IfEnd If' set the strings for the move to linksIf (MM_keepMove <> "") Then MM_keepMove = MM_keepMove & "&"End IfMM_urlStr = Request.ServerVariables("URL") & "?" & MM_keepMove & MM_moveParam & "="MM_moveFirst = MM_urlStr & "0"MM_moveLast = MM_urlStr & "-1"MM_moveNext = MM_urlStr & CStr(MM_offset + MM_size)If (MM_offset - MM_size < 0) Then MM_movePrev = MM_urlStr & "0"Else MM_movePrev = MM_urlStr & CStr(MM_offset - MM_size)End If%><html><head><title><%=(Recordset3.Fields.Item("nome_musica").Value)%></title><meta name="keywords" content="cifras, cifra, letras, traduzidas, traduções, partituras, violão, viola, partitura, tablatura, tablaturas, cifrasmusic, ciframusica, violão, guitar, guitarra, cordas, chords, programas, acordes, cavaco, cavaquinho, teclado, music, sexo, jogos"><meta name="description" content="O maior acervo de cifras, tablaturas e letras de músicas nacionais e internacionais com desenhos de acordes para violão, guitarra, teclado, bateria, baixo e outros instrumentos. Cursos, aulas, dicas, classificados..."><meta name="robots" content="index,follow"><meta http-equiv="content-language" content="pt-BR"><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><link href="../../css/estilo.css" rel="stylesheet" type="text/css"></head><body bgcolor="#E6E6E6" topmargin="6"><div align="center"> <table width="730" border="0" align="center" cellpadding="0" cellspacing="1"> <tr> <td height="92"> <div align="center"> <iframe frameborder=0 height=92 marginheight=0 marginwidth=0 scrolling=no src="../../includes/banner_cifras.asp" width=730></iframe> </div></td> </tr> </table> <br> <script language=JavaScript src="../../script/cifras.js"></script></div><table width="760" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="15"><img src="../../img/icons/t_bl.gif" width="15" height="20"></td> <td width="746" bgcolor="#FFFFFF"> </td> <td width="15"><img src="../../img/icons/t_brrr.gif" width="15" height="20"></td> </tr> <tr> <td bgcolor="#FFFFFF"> </td> <td bgcolor="#FFFFFF"><TABLE border=0 cellPadding=0 cellSpacing=0 height=2 width=730> <TBODY> <TR> <TD height=21 width=344><span class="texto2"><FONT color=#666666><strong><img src="../../imagem/x.gif" width="13" height="13"></strong></FONT></span><span class="texto"><FONT color=#666666><strong><font color="#FF3333"> Música:</font></strong></FONT></span><FONT color=#666666 face="Verdana, Arial, Helvetica, sans-serif" size=2><strong> </strong></FONT><FONT color=#666666 face="Verdana, Arial, Helvetica, sans-serif"><strong><span class="texto2"><font color="#333333" face="Verdana"><em><%=(Recordset3.Fields.Item("nome_musica").Value)%></em></font></span></strong></FONT></TD> <TD height=21 width=11></TD> <TD height=21 width=375> <P align=right class="textoforme"><B><font size="4"><%=(Recordset3.Fields.Item("artista").Value)%></font></B></P></TD> </TR> <TR> <TD bgColor=#cccccc height=1 width=344><IMG border=0 height=1 src="Acheicifras_com_br_arquivos/nada.gif" width=10></TD> </TR> <TR> <TD bgColor=#ffffff height=2 width=344><IMG border=0 height=11 src="../../img/icons/nada.gif" width=30></TD> <TD bgColor=#ffffff height=2 width=11><IMG height=11 src="../../img/icons/linha_diagonal.gif" width=11></TD> <TD bgColor=#ffffff height=2 width=375><IMG border=0 height=11 src="../../img/icons/nada.gif" width=30></TD> </TR> <TR> <TD bgColor=#ffffff height=1 width=344><IMG border=0 height=1 src="img/icons/nada.gif" width=10></TD> <TD bgColor=#ffffff height=1 width=11><IMG border=0 height=1 src="img/icons/nada.gif" width=10></TD> <TD bgColor=#cccccc height=1 width=375><IMG border=0 height=1 src="img/icons/nada.gif" width=10></TD> </TR> </TBODY> </TABLE></td> <td bgcolor="#FFFFFF"> </td> </tr> <tr> <td width="15" height="157" bgcolor="#FFFFFF"> </td> <td align="left" valign="top" bgcolor="#FFFFFF"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="51" align="center" valign="top" class="texto"> <div align="center"><span class="texto"><strong><a href="impbaixo.asp?<%= "impbaixo=" & Recordset3.Fields.Item("idbaixo").Value %>"><img src="../../img/icons/printer.gif" width="34" height="34" border="0"></a> </strong></span><br> Imprimir</div></td> <td width="58" align="center" valign="top" class="texto"><span class="texto"><strong><a href="../../contatos/contatos.asp"><img src="../../img/icons/contens.gif" width="34" height="34" border="0"></a> </strong></span><br> Contatos <TD width=59 height=46 align="center" valign="top" class=texto><A onmouseover="window.status='Auto-Rolagem';return true" onclick="atrl();return false;" onmouseout="window.status='';return true" href="#"><IMG src="../../img/icons/rolar.gif" alt="auto rolagem" width=34 height=34 border="0"></A> <br> Rolagem</td> <td width="72" align="center" valign="top" class="texto"><span class="texto"><strong><a href="../../script/indica.asp">indica</a> </strong></span></td> <td width="355" align="center" valign="bottom" class="texto2"><strong>Hits: </strong></td> </tr> </table> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td><div align="left"> <hr size="1" noshade> </div></td> </tr> <tr> <td height="113" align="left" valign="top"> <table width="100%" border="0" cellspacing="0" cellpadding="2"> <tr> <td class=""><div id=newtools style="FONT: 7pt verdana"> <pre><font size="2"><%=(Recordset3.Fields.Item("musica").Value)%></font> </pre> </div></td> </tr> </table></td> </tr> </table></td> <td width="15" bgcolor="#FFFFFF"> </td> </tr> <tr> <td><img src="../../img/icons/t_al.gif" width="15" height="20"></td> <td bgcolor="#FFFFFF"> </td> <td><img src="../../img/icons/t_cl.gif" width="15" height="20"></td> </tr></table><div align="center"><br> <iframe frameborder=0 height=16 marginheight=0 marginwidth=0 scrolling=no src="../../includes/rodape2.asp" width=500></iframe></div></body></html><%Recordset1.Close()Set Recordset1 = Nothing%><%Recordset2.Close()Set Recordset2 = Nothing%><%Recordset3.Close()Set Recordset3 = Nothing%>

Compartilhar este post


Link para o post
Compartilhar em outros sites

Eu quero saber é quantas vezes uma pagina foi vizualizadacomo aparece aqui no forum quantas vizualizações tiveram certos topicos...e naum quantos cliques tiveram um link.quero qundo ele pedir pra atualizar o navegador conte um hits ou views...eu postei o codigo da pagina olha ai e ver como fica?

Compartilhar este post


Link para o post
Compartilhar em outros sites

e ai [rush_jeff_rulez], me ajude por favor

passei o dia todo aki e nada

no post de 04:29 PM postado pelo Aalves ele poe um inicio para você

 

não eh complicado...

 

todos querem ajudar mais ninguem quer fazer entende???

 

assim você aprende e todos ficam satisfeitos...

 

começe va tentando errando e vamos tentando corrigir...

Compartilhar este post


Link para o post
Compartilhar em outros sites

semelhantevocê manda atualizar a cada visitapoe direto no codigo aquilo só precisa um pouco de adaptação

Compartilhar este post


Link para o post
Compartilhar em outros sites

e ai [rush_jeff_rulez], me ajude por favor

passei o dia todo aki e nada

<{POST_SNAPBACK}>

no post de 04:29 PM postado pelo Aalves ele poe um inicio para você

 

não eh complicado...

 

todos querem ajudar mais ninguem quer fazer entende???

 

assim você aprende e todos ficam satisfeitos...

 

começe va tentando errando e vamos tentando corrigir...

<{POST_SNAPBACK}>

é verdade ........

e mesmo assim os codigos esta praticamentes prontos, é só mudar uma coisinha ou outra, mas qualquer coisa tamuae

Compartilhar este post


Link para o post
Compartilhar em outros sites

Logo abaixo segue um codigo de contador de acesso.esse codigo é uma pagina com o nome contador.aspai eu coloco uma include na pagina que quero contarmas ele so conta a pagina mestre cifras.asp...as paginas detalhes como :cifras.asp?idcifra=1cifras.asp?idcifra=2cifras.asp?idcifra=3 e assim por diante ele não contao que devo mudar?<%'Declara as variáveisDim Conn, RsQuery, Pagina, Counter'Atribui o endereço da página atual a uma variável (Pagina)Pagina = Request.ServerVariables("SCRIPT_NAME")'Atribui a variável Conn uma instancia do objeto Connection'ou seja, a variável passa a propriedade de conexãoSet Conn = Server.Createobject("ADODB.Connection")'Abre a conexão com o banco de dados usando o Server.MapPath, que localiza o banco com esse nome 'apenas dentro do mesmo diretórioConn.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("contador.mdb")'Verifica se a Session Pagina ja contem algum valor, no caso o valor (visitada)If Len(Session(Pagina)) = 0 Then'Atribui a variável RsQuery a consulta executada no banco de dadosSet RsQuery = Conn.Execute("SELECT * FROM acesso")'Atribui a variável Counter o valor atual de visitasCounter = RsQuery("acesso")+1'Atribui a variável RsQuery a atualização feita no banco de dados'Repare que desta maneira você pode usar esse Banco de Dados para várias páginas'porque apenas será atualizada linha que corresponde a (url = '" & Pagina & "')'url é o endereço atualSet RsQuery = Conn.Execute("UPDATE acesso SET acesso = " & Counter & " WHERE url = '" & Pagina & "'")'Atribui a Session(Pagina) o valor "visitada", onde só será contado como uma nova visita quando a sessão for encerrada (a sessão se encerra após 20 minutos de página estática, ou ao fechar o browser)Session(Pagina) = "visitada"'Caso a Session Pagina não contenha o valor (visitada), será contado como mais uma visitaElse'Atribui a variável RsQuery a consulta atualização feita no banco de dadosSet RsQuery = Conn.Execute("SELECT * FROM acesso WHERE url = '" & Pagina & "'") 'Atribui a variável Counter recebe o número de visitasCounter = RsQuery("acesso")'Fecha o conexão com o banco de dadosEnd If'Fecha o conexão com o banco de dadosConn.Close'Caso a Session Pagina não contenha o valor (visitada), será contado como mais uma visitaSet Conn = Nothing'É impresso o total de visitasResponse.Write Counter%>

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.