<!--#include file="ip.asp"-->
<!--#include file="conn.asp"-->
<%
Response.Cookies("locked") =0
Response.Cookies("locked").Expires=Date+360



'过期时间
guoqi=DateDiff("n",now(),DateAdd("d",1,date()))-1

'音乐播放
If Request.Cookies("music_id") = "" Then
Response.Cookies("music_id")=0
Response.Cookies("music_play")="stop"
Response.Cookies("music_loop")=0
Response.Cookies("mutime") =0
Response.Cookies("mutime").Expires=Date+360
Response.Cookies("music_id").Expires=Date+360
Response.Cookies("music_play").Expires=Date+360
Response.Cookies("music_loop").Expires=Date+360
end if

'访问统计
w=0
set rs=server.CreateObject("adodb.recordset")
sql="select * from stat"
rs.open sql,conn,1,3
rs.MoveLast		
While Not rs.BOF
If rs(1)=ip Then
w=1
end if
rs.MovePrevious	
Wend
If Request.Cookies("stat") = "" or w=0 Then
Response.Cookies("stat")=1
Response.Cookies("stat").Expires=DateAdd("n", guoqi, Now()) 
rs.addnew
rs(1)=ip
if cou="" Then
rs(2)="中国"
else
rs(2)=cou
end if
rs(3)=pro
rs(4)=city
rs(5)=jieru
rs(6)=Request.Cookies("url")
rs(7)=now()
rs(8)=0
rs.update
end if   '写入访问数据



total=0
totaltime=0
todaytotal=0
rs.MoveLast		
While Not rs.BOF
fenzhong=rs(8)
total=total+1
totaltime=int(fenzhong*10/60)/10+totaltime
tianshu=dateDiff("d",rs(7),now())
if tianshu=0 Then
todaytotal=todaytotal+1
end if
rs.MovePrevious	
Wend
rs.close
set rs=nothing    '获取访问数据

'欢迎词
Response.Cookies("tishi") =bianma("有朋自"&sitea&"来，不亦乐乎！")


'当前在线
if Application("total")="" Then
Application("total")=0
Application("online")=0
end if
if DateDiff("s",Request.Cookies("last"),Now)>8  Then
i=Application("total")+1
n_1="00000000000"&i
n_2=right(n_1,5)
Response.Cookies("user")="name_"&i
Application("name_"&i)="G_"&n_2
Application("ip_"&i)=ip
if cou="" Then
cou="中国"
end if
Application("site_"&i)=bianma(site)
Application("now_"&i)=now()
Application("total")=Application("total")+1
Response.Cookies("total")=Application("total")
end if

%>
&address=<%=jiema(cou&pro&city)%>&ip=<%=Request.Cookies("ip")%>&music_play=<%=Request.Cookies("music_play")%>&music_id=<%=Request.Cookies("music_id")%>&music_loop=<%=Request.Cookies("music_loop")%>&total=<%=total%>&totaltime=<%=totaltime%>&todaytotal=<%=todaytotal%>&mutime=<%=Request.Cookies("mutime")%>&

