<!--#include file="conn/conn.asp"-->
<!--#include file="conn/config.asp"-->
<!--#include file="conn/nosql.asp"-->
<%if Not ChkPosturl then response.redirect ("login.asp")
url=Request.ServerVariables("HTTP_REFERER") 
if session("user")="" then
response.write "<SCRIPT LANGUAGE=""javascript"">alert(""对不起，用户不存在！"");parent.location.href='"&url&"';</SCRIPT>"
Response.End 
else
username=nosql(session("user"))
end if
Set rs= Server.CreateObject("ADODB.Recordset") 
sql="select * from [snsn_user] where [Username]='"&username&"'"
rs.open sql,conn,1,3
if rs.eof then
response.write "<SCRIPT LANGUAGE=""javascript"">alert(""对不起，用户不存在！"");parent.location.href='"&url&"';</SCRIPT>"
Response.End 
else
'if userjf=1 then'是否打开积分功能
logintime=rs("logindate")
'rs1=conn.execute("select getdate() as now_time")
'newHour=rs1(0)
stay_min=datediff("n",logintime,now())
'倍率加分
Set rs1= Server.CreateObject("ADODB.Recordset") 
sql="select * from snsn_zy where zy='"&rs("zy")&"' and dj="&rs("dj")
rs1.open sql,conn,1,3
newtime=stay_min*rs1("jiadian")
rs("jifen")=rs("jifen")+newtime
rs("logindate")=now()
rs.Update
rs.Close
end if
session.abandon
conn.execute("delete from [online] where name='"&username&"'")
if left(stay_min,1)="." then
stay_min="0"&stay_min
end if
if left(newtime,1)="." then
newtime="0"&newtime
end if
response.write "<SCRIPT LANGUAGE=""javascript"">alert(""您在站内停留了"&stay_min&"分钟，获得"&newtime&"点积分！"");parent.location.href='"&url&"';</SCRIPT>"
response.End()
%>