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


<%
if nosql(request("picurl"))<>"" then
set rs=server.CreateObject("adodb.recordset")
rs.open"select * from snsn_uppic where username='"&session("user")&"'",conn,3,3	
set rs1=server.CreateObject("adodb.recordset")
rs1.open"select * from snsn_uppic_class where username='"&session("user")&"'",conn,3,3
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,3,3
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 爱心


end if
response.write"<script>top.location.href='uppic.asp'</script>"%>
