⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 savevalue.asp

📁 基于ASP开发的聊天室源码
💻 ASP
字号:
<%
Response.Expires=0
Response.ExpiresAbsolute = Now() - 1
Response.AddHeader "Pragma","No-Cache"
Response.AddHeader "Cache-Control","Private"
Response.CacheControl = "No-Cache"
if not IsArray(Session("info")) then Response.Redirect "err1.asp?kind=01"
info=Session("info")
if InStr(Application("maninfo"),"," & info(0) & ",")<>0 then Response.Redirect "manyou.asp"
%>
<!--#INCLUDE FILE="config.asp" -->
<%
Response.Write ("<html><head><meta http-equiv='Content-Type' content='text/html; charset=gb2312'><title>保存积分--" & zzbird_chatroomname & "</title></head>" & _
 "<body oncontextmenu='self.event.returnValue=false' style='border: 3px double buttonface' bgcolor='buttonface' topmargin='3' leftmargin='3'>")
info=Session("info")
dadiff=DateDiff("s",info(2),now)
davalue=Int(dadiff/60)
If dadiff<zzbird_savevaluetime and dadiff>=0 then
 Response.Write ("<fieldset style='padding: 2'><legend><font color='#A20000' style='font-size: 10pt'><img border='0' src='images/save.gif'>保存积分</font></legend>" & _
  "<p style='font-size: 10pt' align='center'>为了服务器稳定运行,<br><br>"&zzbird_savevaluetime&"秒内不得重复保存积分!<br><br>距可保存时间还有<font id='ht' style='width:25'></font>秒</p>" & _
  "<p align='center'><input type='button' value='关闭窗口' onclick='javascript:window.close();' name='b'></p></fieldset>" & _
  "<script language='javascript'>" & _
  "var nturn="&zzbird_savevaluetime-DateDiff("s",info(2),now)&";" & _
  "function sett()" & _
  "{if(nturn>0){ht.innerHTML=nturn;" & _
  "nturn=nturn-1;" & _
  "setTimeout('sett()',1000);}else{window.close();}}" & _
  "sett();" & _
  "</script>" & _
  "</body></html>")
Response.end
end if
Set Conn=server.createobject("ADODB.CONNECTION")
Conn.Open Application("zzbird_conn")
Set Rs=Server.CreateObject("ADODB.RecordSet")
sql="select * from userinfo where user='" & info(0) & "'"
Rs.open sql,conn,1,3
if Rs.Eof and Rs.bof then
Rs.Close
Set Rs=Nothing
Conn.Close
Set Conn=Nothing
Response.Redirect "err.asp?kind=500"
else
Rs("value")=Rs("value")+davalue
nowvalue=Rs("value")
oldgrade=Rs("grade")
if info(1)<>oldgrade and info(0)<>zzbird_master then Response.Redirect "err1.asp?kind=19"
nowgrade=oldgrade
gradeinfo=Application("gradeinfo")
if Rs("lockgrade")<>true then
 nowgrade=1
 for i=1 to ubound(gradeinfo)
 if gradeinfo(i,0)=true and nowvalue>=gradeinfo(i,1) then nowgrade=i
 next
 Rs("grade")=nowgrade
end if
if info(0)<>zzbird_master then info(1)=nowgrade
if Rs("lastmonth")=month(date) then
Rs("monthv")=Rs("monthv")+davalue
else
Rs("lastmonth")=month(date)
Rs("monthv")=davalue
end if
Rs.Update
monthvalue=Rs("monthv")
rs.Close
Set Rs=Nothing
Conn.close
Set Conn=Nothing
end if
info(2)=now
info(11)=nowvalue
Session("Info")=Info

If nowgrade<>oldgrade and info(0)<>zzbird_master Then
myonline = info(0) & "|" & info(4) & "|" & info(5) & "|" & info(1) & "|" & info(9) & "|" & info(12)
 Application.Lock
  online=Application("online" & info(7))
  onno=ubound(online)
  for i=1 to onno
   if InStr(online(i),info(0) & "|")=1 then
    online(i) = myonline
    Application("online" & info(7))=online
    exit for
   end if
  next
  words=Application("zzbird_words")
  line=Application("zzbird_line")
  Application("zzbird_line")=line+1
  for i=1 to 234
   words(i)=words(i+6)
  next
  words(235)=line+1
  words(236)=info(0)
  words(237)=myonline
  words(238)="changeinfo"
  words(239)="[等级]<img src='images/ico/" & info(4) & "-2.gif' height='16' width='16'><a target='l3' href=javascript:parent.l3.selectuser('[" & info(0) & "]');><font color='#d90000'>" & info(0) & "</font></a>的级别由 <font color='red'>" & CStr(oldgrade) & "</font> 级变更为 <font color='red'>" & CStr(nowgrade) & "</font> 级。<font style='font-size: 8pt' color='#808080'>(" & CStr(time) & ")</font>"
  words(240)=info(6)
 Application("zzbird_words")=words
 Application.UnLock
End If

Response.Write ("<fieldset style='padding: 2'>" & _
"<legend>" & _
"<font color='#A20000' style='font-size: 10pt'><img border='0' src='images/save.gif'>保存积分</font></legend>" & _
"<p style='font-size: 10pt' align='center'>积分保存成功!<br>总共积分:" & nowvalue & "<br>本月积分:" & monthvalue & "<br>新增积分:" & davalue & "<br>目前等级:" & nowgrade )
if info(0)=zzbird_master then Response.Write "<br>(此等级为数据库中的等级)"
Response.Write "</p><p align='center'><input type='button' value='关闭窗口' onclick='javascript:window.close();' name='b'></p></fieldset></body></html>"
%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -