<%@ CODEPAGE = "936" %> <% '================================= ' ' 阿江酷站访问统计系统 ' Ajiang info@ajiang.net ' www.ajiang.net ' ' 版权所有·抄袭挪用必究 ' '================================= %> <% '权限检查 if session.Contents("master")=false and whatcan<2 then Response.Redirect "help.asp?id=004&error=您没有查看24小时访问统计的权限。" %> <%=countname%>-最近/所有24小时访问统计

Tips: 用鼠标点指图形柱或者图形柱下的数字可以看到对应的访问量。


   ∷∷∷ 最近24小时访问量 ∷∷∷
<% set conn=server.createobject("adodb.connection") DBPath = Server.MapPath(connpath) conn.Open "driver={Microsoft Access Driver (*.mdb)};dbq=" & DBPath dim vhour(24) maxhour=0 sumhour=0 for i=0 to 23 vhour(i)=vhourcon(i) if vhour(i)>maxhour then maxhour=vhour(i) sumhour=sumhour+vhour(i) next '防止除数为0出错 if maxhour=0 then maxhour=1 if sumhour=0 then sumhour=1 %> <% for i= 0 to 23 thehour=hour(now())+i+1 if thehour>23 then thehour=thehour-24 %> <% next %> <% for i= 0 to 23 thehour=hour(now())+i+1 if thehour>23 then thehour=thehour-24 %> <% next %>

<%=int(maxhour*10+0.5)/10%>

<%=int(3*maxhour*10/4+0.5)/10%>

<%=int(maxhour*10/2+0.5)/10%>

<%=int(maxhour*10/4+0.5)/10%>

<%=thehour%>时,访问<%=vhour(thehour)%>次,<%
	'计算访问量的百分数,精确到小数后1位,小于零的在前面加字母0
	lsbf=int(vhour(thehour)*1000/sumhour)/10
	if lsbf<1 then lsbf=%">

0

%"><%=thehour%>

   ∷∷∷ 所有24小时访问量 ∷∷∷
<% Set rs = Server.CreateObject("ADODB.Recordset") sql="select vhour,count(id) as allhour from view group by vhour" rs.Open sql,conn,1,1 dim vallhour(24) maxallhour=0 sumallhour=0 do while not rs.EOF vallhour(cint(rs("vhour")))=cint(rs("allhour")) if vallhour(cint(rs("vhour")))>maxallhour then maxallhour=vallhour(cint(rs("vhour"))) sumallhour=sumallhour+vallhour(cint(rs("vhour"))) rs.MoveNext loop '防止除数为0出错 if maxallhour=0 then maxallhour=1 if sumallhour=0 then sumallhour=1 %> <% for i= 0 to 23 %> <% next %> <% for i= 0 to 23 %> <% next %>

<%=int(maxallhour*10+0.5)/10%>

<%=int(3*maxallhour*10/4+0.5)/10%>

<%=int(maxallhour*10/2+0.5)/10%>

<%=int(maxallhour*10/4+0.5)/10%>

<%=i%>时,访问<%=vallhour(i)%>次,<%
	'计算访问量的百分数,精确到小数后1位,小于零的在前面加字母0
	lsbf=int(vallhour(i)*1000/sumallhour)/10
	if lsbf<1 then lsbf=%">

0

%"><%=i%>
<% rs.Close set rs=nothing conn.Close set conn=nothing %>
<% function vhourcon(thehour) if thehour=hour(now()) then tmprs=conn.execute("Select count(id) as vhourcon from view where vhour=" & _ hour(now()) & " and vday=" & day(now()) & " and vmonth=" & month(now()) & " and vyear=" & year(now())) vhourcon=tmprs("vhourcon") if isnull(vhourcon) then vhourcon=0 else tmprs=conn.execute("Select count(id) as vhourcon from view where vhour=" & _ thehour & " and vtime>now()-1") vhourcon=tmprs("vhourcon") if isnull(vhourcon) then vhourcon=0 end if end function %>