codice:
<%@ LANGUAGE = VBScript %>
<% Option Explicit %>
<%
'IPLog 2.3 @ 11/10/2004
'autore: mattia richetto
'sito web: www.mattiarichetto.it
'contatti: iplog@mattiarichetto.it
%>
<%
'****************************************************************************************************
function formatdate01(data,sep)
formatdate01=number01(day(data))&sep&number01(month(data))&sep&year(data)
end function
'****************************************************************************************************
function number01(numero)
if len(numero)<2 then
number01="0"&numero
else
number01=numero
end if
end function
'****************************************************************************************************
function limitaCaratteri(frase, lunghMax)
dim dimMax, estrattoBreve, ultimoCarattere, contatore
dimMax = LEN(frase)
if dimMax > lunghMax then
estrattoBreve = ""
ultimoCarattere = "a"
contatore = lunghMax
while ultimoCarattere <> " "
estrattoBreve = LEFT(frase,contatore)
ultimoCarattere = RIGHT(estrattoBreve,1)
contatore = contatore - 1
if contatore = 0 then
ultimoCarattere = " "
end if
wend
if contatore <> 0 then
estrattoBreve = LEFT(frase,contatore) & " ..."
else
estrattoBreve = LEFT(frase,lunghMax)
end if
else
estrattoBreve = frase
end if
limitaCaratteri = estrattoBreve
end Function
'****************************************************************************************************
dim user,pass
user=request.form("user")
pass=request.form("pass")
%>
<html>
<head>
<title>IPLog 2.3 @ 11/10/2004</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body>
<div align="center">
Statistiche Imperica Web
<table align="center" cellpadding="3" cellspacing="1">
<%
Dim objOpenFile, objFSO, objOpenFile2
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
Set objOpenFile = objFSO.OpenTextFile(strPath, 1)
Set objOpenFile2 = objFSO.OpenTextFile(strPath2, 1)
dim arr_iplog, str_iplog, i
i=0
dim j
j=0
'conteggio log
dim a,at,b,bt,c,ct,d,dt,str_tmp,str_tmp2
a=0
at=0
b=0
bt=0
c=0
ct=0
do while not objopenfile.atendofstream
str_tmp=objOpenFile.ReadLine
'log totali
a=a+1
if instr(str_tmp,formatdate01(date(),"/"))<>0 then
at=at+1
end if
'google
if instr(str_tmp,"64.68.82")<>0 or instr(str_tmp,"66.249.6")<>0 then
b=b+1
if instr(str_tmp,formatdate01(date(),"/"))<>0 then
bt=bt+1
end if
'###############################################################################################################
'###############################################################################################################
'conteggio di altri bot/spider
'IPLog 2.x - conteggio altri spider tramite file testo esterno con indirizzi ip
else
Set objOpenFile2 = objFSO.OpenTextFile(strPath2, 1)
do while not objopenfile2.atendofstream
str_tmp2=objOpenFile2.ReadLine
if instr(str_tmp,str_tmp2)<>0 then
c=c+1
if instr(str_tmp,formatdate01(date(),"/"))<>0 then
ct=ct+1
end if
end if
loop
objOpenFile2.Close
end if
'###############################################################################################################
'###############################################################################################################
loop
objOpenFile.Close
'fine conteggio log
%>
<tr>
<td colspan="8" class="normal_1"> Accessi Totali: <%=a%> - Oggi: <%=at%>
<span class="google">Accessi Totali derivanti da Google: <%=b%> - Oggi: <%=bt%></span>
<span class="other_bot">Accessi Totali derivanti da altri Motori: <%=c%> - Oggi: <%=ct%></span>
Accessi Totali dai Motori: <%=b+c%> - Oggi: <%=bt+ct%>
Utenti reali: <%=a-b-c%> - Oggi: <%=at-bt-ct-dt%>
n.b. di seguito riportati solo gli ultimi 150 log. </td>
</tr>
<tr class="normal_2">
<th>#</th>
<th>Data</th>
<th>Ora</th>
<th>Indirizzo IP</th>
<th>Caratteristiche</th>
<th>Lingua</th>
<th>Referente</th>
<th>Pagina Visitata</th>
</tr>
<%
Set objOpenFile = objFSO.OpenTextFile(strPath, 1)
dim cnt
for cnt=1 to 150
if not objopenfile.atendofstream then
i=i+1
str_iplog=objOpenFile.ReadLine
arr_iplog = split(str_iplog, "§")
dim log_type
'google
if instr(arr_iplog(2),"64.68.82")<>0 or instr(arr_iplog(2),"66.249.6")<>0 then
log_type="google"
'###############################################################################################################
'###############################################################################################################
'conteggio di altri bot/spider
'IPLog 2.x - conteggio altri spider tramite file testo esterno con indirizzi ip
else
if j=0 then
log_type="normal_1"
elseif j=1 then
log_type="normal_2"
end if
Set objOpenFile2 = objFSO.OpenTextFile(strPath2, 1)
do while not objopenfile2.atendofstream
str_tmp2=objOpenFile2.ReadLine
if instr(arr_iplog(2),str_tmp2)<>0 then
log_type="other_bot"
end if
loop
objOpenFile2.Close
end if
'###############################################################################################################
'###############################################################################################################
%>
<tr>
<td align="right" nowrap class="<%=log_type%>"><%=i%></td>
<td align="right" nowrap class="<%=log_type%>"><%=arr_iplog(0)%></td>
<td align="right" nowrap class="<%=log_type%>"><%=arr_iplog(1)%></td>
<td align="right" nowrap class="<%=log_type%>"><%=arr_iplog(2)%></td>
<td nowrap class="<%=log_type%>"><span class="nota" title="<%=arr_iplog(3)%>"><%=limitaCaratteri(arr_iplog(3),50)%></span></td>
<td align="center" nowrap class="<%=log_type%>"><%=limitaCaratteri(arr_iplog(4),2)%></td>
<td nowrap class="<%=log_type%>"><%=limitaCaratteri(lcase(arr_iplog(5)),50)%></td>
<td nowrap class="<%=log_type%>"><%=limitaCaratteri(lcase(arr_iplog(6)),50)%></td>
</tr>
<%
if j=0 then
j=1
elseif j=1 then
j=0
end if
end if
next
objOpenFile.Close
Set objOpenFile = Nothing
Set objOpenFile2 = Nothing
Set objFSO = Nothing
%>
</table>
</div>
</body>
</html>
Mi servirebbe avere solo il valore "Visite XXXXX" è possibile...? grazie tante.