<%@ 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=您没有查看访问者地区统计的权限。" %> <%=countname%>-访问者地区统计

Tips: 用鼠标点指图形柱或者文字可以看到对应的访问量。要得到某一时段的统计信息,请使用自定义统计。

<% set conn=server.createobject("adodb.connection") DBPath = Server.MapPath(connpath) conn.Open "driver={Microsoft Access Driver (*.mdb)};dbq=" & DBPath Set rs = Server.CreateObject("ADODB.Recordset") %>
   ∷∷∷ 访问者地区及访问量 ∷∷∷
<% sql="select vwhere,count(id) as allwhere from view group by vwhere order by count(id) DESC" rs.Open sql,conn,1,1 maxallwhere=0 sumallwhere=0 do while not rs.EOF if cint(rs("allwhere"))>maxallwhere then maxallwhere=cint(rs("allwhere")) sumallwhere=sumallwhere+cint(rs("allwhere")) rs.MoveNext loop '防止除数为0而出错 if maxallwhere=0 then maxallwhere=1 if sumallwhere=0 then sumallwhere=1 rs.MoveFirst j=0 do while not rs.EOF thewhere=rs("vwhere") vallwhere=rs("allwhere") thelen=len(thewhere) if thelen =0 then thewhere="main.asp" svwhere="通过收藏或直接输入网址访问" end if if thelen <= 33 and thelen > 0 then svwhere=thewhere end if if thelen >= 34 then svwhere=left(thewhere,31) & "..." end if %> <% rs.MoveNext j=j+1 '如果记录超过40条,就退出 if j=40 then exit do loop %>
%"><%=svwhere%>  <%=thewhere%>,访问<%=vallwhere%>次,<%
	'计算访问量的百分数,精确到小数后1位,小于零的在前面加字母0
	lsbf=int(vallwhere*1000/sumallwhere)/10
	if lsbf<1 then lsbf=%"> <%=vallwhere%>
<% rs.Close set rs=nothing conn.Close set conn=nothing %>
<% '计算指定日期的访问量 function vdaycon(theday) theday=cdate(theday) thetday=cdate(theday+1) tmprs=conn.execute("Select count(id) as vdaycon from view where" & _ " vtime>=datevalue('" & theday & "') and vtime<=datevalue('" & thetday & "')") vdaycon=tmprs("vdaycon") if isnull(vdaycon) then vdaycon=0 end function %>