<!--#include file="conn/conn.asp"-->
<!--#include file="conn/nosql.asp"--> 
<%
tjrname=nosql(request.QueryString("tjr"))
if tjrname<>"" then
guestip=nosql(request.ServerVariables("REMOTE_ADDR"))

'有没有这个用户
set tjr=Server.CreateObject("ADODB.Recordset") 
tjr.open"select * from snsn_user where username='"&tjrname&"'",conn,1,3
if not tjr.eof then
'访客ip检测，有没有来访过，并且时间是多少(来访过并且，时间大于X)
set guestip2=Server.CreateObject("ADODB.Recordset") 
guestip2.open"select * from snsn_guestip where username='"&tjrname&"' and guestip='"&guestip&"' and getdate()-guesttime>1",conn,1,3
if not guestip2.eof then
guestip2("guesttime")=now()
guestip2.update
tjr("tjr")=tjr("tjr")+1
tjr.update


'爱心(发贴，传相片，传音乐，推荐人)
Set huaq= Server.CreateObject("ADODB.Recordset") 
huaq.open "select id from snsn_user where username='"&tjrname&"'",conn,1,3
if not  huaq.eof then
Set hua= Server.CreateObject("ADODB.Recordset") 
hua.open "select * from snsn_hua where userid="&huaq("id"),conn,1,3
if not hua.eof then 
if hua("ax")<hua("max1")  then
if datediff("d",hua("axdate"),now)>=1 then
hua("dayax")=0
hua("axdate")=now()
hua.update
end if
if hua("dayax")<8 then
gwjga=8
if gwjga+hua("dayax")>8 then
gwjga=8-hua("dayax")
end if
hua("dayax")=hua("dayax")+gwjga
hua("ax")=hua("ax")+gwjga
hua.update

end if
end if
end if
end if
'end 爱心

session("snsn_tjr")=tjrname
end if

'访客ip检测，有没有来访过(没有来访过)

set guestip1=Server.CreateObject("ADODB.Recordset") 
guestip1.open"select * from snsn_guestip where username='"&tjrname&"'  and guestip='"&guestip&"'",conn,1,3
if guestip1.eof then
conn.execute"insert into snsn_guestip (username,guesttime,guestip)values('"&tjrname&"','"&now()&"','"&guestip&"')"
tjr("tjr")=tjr("tjr")+1
tjr.update



'爱心(发贴，传相片，传音乐，推荐人)
Set huaq= Server.CreateObject("ADODB.Recordset") 
huaq.open "select id from snsn_user where username='"&tjrname&"'",conn,3,3
if not  huaq.eof then
Set hua= Server.CreateObject("ADODB.Recordset") 
hua.open "select * from snsn_hua where userid="&huaq("id"),conn,3,3
if not hua.eof then 
if hua("ax")<hua("max1")  then
if datediff("d",hua("axdate"),now)>=1 then
hua("dayax")=0
hua("axdate")=now()
hua.update
end if
if hua("dayax")<8 then
gwjga=8
if gwjga+hua("dayax")>8 then
gwjga=8-hua("dayax")
end if
hua("dayax")=hua("dayax")+gwjga
hua("ax")=hua("ax")+gwjga
hua.update

end if
end if
end if
end if
'end 爱心

session("snsn_tjr")=tjrname
end if

end if
end if
response.Redirect("index.asp")
%>

