<%@ LANGUAGE=VBScript codepage ="936" %>
<!--#include file="sjfunc.asp"-->
<%'申领金币
Response.Expires=0
Response.ExpiresAbsolute = Now() - 1
Response.AddHeader "Pragma","No-Cache"
Response.AddHeader "Cache-Control","Private"
Response.CacheControl ="No-Cache"
zhbg_jhdj=Session("zhbg_jhdj")
zhbg_name=Session("zhbg_name")
if Instr(LCase(Application("zhbg_useronlinename"&nowinroom)),LCase(" "&zhbg_name&" "))=0 then 
	Session("zhbg_inthechat")="0" 
	Response.Redirect "chaterr.asp?id=001" 
end if 
towho=Trim(Request.Form("towho"))
towhoway=Request.Form("towhoway")
saycolor=Request.Form("saycolor")
addwordcolor=Request.Form("addwordcolor")
addsays=Request.Form("addsays")
says=Trim(Request.Form("sy"))
'对暂离开、点哑穴判断
call dianzan(towho)
if len(says)>150 then says=Left(says,150)
says=lcase(says)
says=Replace(says,"&amp;","&")
if zhbg_grade<9 then
says=bdsays(says)
end if
act=1
towhoway=0
i=instr(says,"$")
fnn1=mid(says,i+1)
says="<font color=red>【申领金币】<font color=" & saycolor & ">"+sljb()+"</font>"
call chatsay(act,towhoway,towho,saycolor,addwordcolor,addsays,says)
function sljb()
Set conn=Server.CreateObject("ADODB.CONNECTION")
Set rs=Server.CreateObject("ADODB.RecordSet")
conn.open Application("zhbg_usermdb")
rs.open "select * FROM 用户 WHERE 姓名='" & zhbg_name &"'",conn,2,2
if Session("sljb_time")="" then Session("sljb_time")=rs("lasttime")
mycd=DateDiff("n",Session("sljb_time"),now())
if mycd<60 then
    if DateDiff("n",rs("lasttime"),now())>=60 then
       sljb="你在一个小时前已经领过金币了！"
    else
       sljb="你还没有泡够一个小时呢！"
    end if
    Response.Write "<script language=JavaScript>{alert('"&sljb&"');}</script>"
    Response.End
else
    conn.execute "update 用户 set 金币=金币+5 where 姓名='" & zhbg_name & "'"
    Session("sljb_time")=now()
end if
sljb="国度站长看到[##]泡点的辛苦，已经连续在线"&mycd&"分钟了，因此送他5个金币！"
rs.close
set rs=nothing	
conn.close
set conn=nothing
end function
%>