<%@ 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"
cwjh_jhdj=Session("cwjh_jhdj")
cwjh_name=Session("cwjh_name")
if Instr(LCase(Application("cwjh_useronlinename"&nowinroom)),LCase(" "&cwjh_name&" "))=0 then 
Session("cwjh_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 cwjh_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("cwjh_usermdb")
rs.open "select * FROM 用户 WHERE 姓名='" & cwjh_name &"'",conn,2,2
if Session("sljb_time")="" then Session("sljb_time")=rs("lasttime")
mycd=DateDiff("n",Session("sljb_time"),now())
jbmoney=2
hyjb=2
if mycd<60 then
    if DateDiff("n",rs("lasttime"),now())>=60 then
       sljb="你在一个小时前已经领过了"
    else
       sljb="你现在泡江湖时间还不到一小时（还差:"& (60-mycd) &"分到1小时），如果\n您连续泡点1小时以上(退出,掉线,打死后时间将清0)可以领取\n"& jbmoney &"个金币,3级以上会员是普通玩家的"& hyjb &"倍^_^"
    end if
    Response.Write "<script language=JavaScript>{alert('"&sljb&"');}</script>"
    Response.End
end if
hy=rs("会员等级")
mycd=int(mycd/60)
if hy>2 then
 hyjb=hyjb
 hymess="<font color=blue>"& hy &"</font>级会员"
else
 hyjb=1
 hymess=""
end if
myjbsl=jbmoney*hyjb*mycd
conn.execute "update 用户 set 金币=金币+"& myjbsl &" where 姓名='" & cwjh_name & "'"
Session("sljb_time")=now()
sljb=hymess&"[##]在江湖努力泡点<font color=red><b>"& mycd &"</b></font>小时,得到金币:<font color=red>"& myjbsl &"</font>个,##会继续努力,支持本江湖的发展!"
rs.close
set rs=nothing 
conn.close
set conn=nothing
end function
%>