<!--#include file="../../conn/conn.asp"-->
<!--#include file="../../conn/nosql.asp"-->
<!--#include file="../../conn/config.asp"-->
<!--#include file="../../conn/count.asp"-->
<!--#include file="../page.asp"-->
<!--#include file="../count.asp"-->

<%
if isChkInteger(request("web_id")) then
web_id=request("web_id")
else
Response.Redirect ("../../index.asp")
end if

if session("user")="" then
response.write "<script language='javascript'>"
response.write "alert('您没还有登录，请登录后再访问本页！');"
response.write"this.location.href='/index.asp';</SCRIPT>"
response.end
end if
if session("id")="" and session("id")<>cint(web_id) then 
response.write "<script language='javascript'>"
response.write "alert('您没还有登录，请登录后再访问本页！');"
response.write"this.location.href='/index.asp';</SCRIPT>"
response.end
end if

sql="select * from snsn_user where id="&web_id
Set rs= Server.CreateObject("ADODB.Recordset") 
rs.open sql,conn,1,1
if rs.eof or rs.bof then
response.write "<script language='javascript'>"
response.write "alert('没有此用户，请确认后或联系管理员再访问本页！');"
response.write"this.location.href='/index.asp';</SCRIPT>"
response.end
else
if nosql(request("ida"))<>"" then
  session("idaa")=nosql(request("ida"))
  end if
%><%

if nosql(request("picurl"))<>"" then
set rs=server.CreateObject("adodb.recordset")
rs.open"select * from snsn_uppic where username='"&session("user")&"'",conn,1,1
set rs1=server.CreateObject("adodb.recordset")
rs1.open"select * from snsn_uppic_class where username='"&session("user")&"'",conn,1,1
if rs1.eof then
conn.execute"insert into snsn_uppic_class (username,tclass)values('"&session("user")&"','"&nosql(request("tclass"))&"')"
end if

	
if not rs.eof then
set rs2=server.CreateObject("adodb.recordset")
rs2.open"select * from snsn_uppic where username='"&session("user")&"' and tclass='"&nosql(request("tclass"))&"' and mink2=1",conn,1,1
if not rs2.eof then
sql="insert into snsn_uppic(username,uppic,bt,nr,tclass,cdate)values('"&session("user")&"','"&nosql(request("picurl"))&"','"&nosql(request("bt"))&"','"&nosql(request("nr"))&"','"&nosql(request("tclass"))&"',getdate())"
else
sql="insert into snsn_uppic(username,uppic,bt,nr,tclass,cdate,mink2)values('"&session("user")&"','"&nosql(request("picurl"))&"','"&nosql(request("bt"))&"','"&nosql(request("nr"))&"','"&nosql(request("tclass"))&"',getdate(),1)"
end if
else
sql="insert into snsn_uppic(username,uppic,mink,bt,nr,tclass,cdate,mink2)values('"&session("user")&"','"&nosql(request("picurl"))&"',1,'"&nosql(request("bt"))&"','"&nosql(request("nr"))&"','"&nosql(request("tclass"))&"',getdate(),1)"
end if

conn.execute sql


'爱心(发贴，传相片，传音乐，推荐人)

Set hua= Server.CreateObject("ADODB.Recordset") 
hua.open "select * from snsn_hua where userid="&session("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 爱心

'今日更新
sql="select * from snsn_user where id="&web_id
Set rscount= Server.CreateObject("ADODB.Recordset") 
rscount.open sql,conn,1,1
if rscount.eof or rscount.bof then
response.write "<script language='javascript'>"
response.write "alert('没有此用户，请确认后或联系管理员再访问本页！');"
response.write"this.location.href='/index.asp';</SCRIPT>"
response.end
else

    if datediff("d",rscount("inewdate"),now())<1 then
	conn.execute("update snsn_user set inew=inew+1 where id="&web_id)
    else
	conn.execute("update snsn_user set inew=1,inewdate=getdate() where id="&web_id)
    end if
    
end if
rscount.close
set rscount=nothing
'结束

end if
Response.Redirect ("photo.asp?web_id="&web_id&"")
end if%>
