const.asp
上传用户:comthink
上传日期:2021-05-06
资源大小:1280k
文件大小:6k
源码类别:

WEB源码(ASP,PHP,...)

开发平台:

HTML/CSS

  1. <!--#include file=char.asp-->
  2. <%
  3. 'cookies
  4. if Request.Cookies("iscookies")="" then
  5. Response.Cookies("iscookies")="0"
  6. Response.Cookies("iscookies").Expires=date+3650
  7. response.write "<META http-equiv=Content-Type content=text/html; charset=gb2312><meta HTTP-EQUIV=REFRESH CONTENT=2>正在登陆霸州一中主页……<br><br>本系统要求使用COOKIES,假如您的浏览器禁用COOKIES,您将不能登录本系统……"
  8. response.end
  9. end if
  10. 'error.htm
  11. Dim UserAgent,Stats,ScriptName
  12. UserAgent=Trim(lcase(Request.Servervariables("HTTP_USER_AGENT")))
  13. ScriptName=lcase(request.ServerVariables("PATH_INFO"))
  14. If Instr(UserAgent,"teleport")>0 or Instr(UserAgent,"webzip")>0 or Instr(UserAgent,"flashget")>0 or Instr(UserAgent,"offline")>0 Then
  15. response.redirect "error.htm"
  16. response.end
  17. end if
  18. dim rs,sql, rs1,sql1,sqlstr
  19. dim i,skinid,sucmsg
  20. dim founderr,founduser,errmsg
  21. dim membername,memberword,userid
  22. dim titlepic,usergroup,lockuser,GroupSetting,usergroupid
  23. dim txl_info,txl_set,txl_ads,txl_body,txl_set25,badwords,copyright,version,stopwhy,cookiepath
  24. dim txl_userfaceNum,txl_userface,txl_skinpic,txl_user,txl_copyright,txl_postface,txl_postfaceNum,txl_ubb,txl_emot,txl_emotNUM
  25. dim username,realname,sex,pass1,pass2,password,question,answer,useremail,userface,userclub,birthday
  26. dim lastip,ip,logins,usermoney,bbscount,photocount,bookcount
  27. dim supermaster,master,vipuser,member,guest,group
  28. Founduser=false
  29. Founderr=false
  30. membername=checkStr(request.cookies("mathren")("realname"))
  31. memberword=checkStr(request.cookies("mathren")("password"))
  32. userid=request.cookies("mathren")("userid")
  33. 'skin
  34. skinid=request.cookies("mathren")("skinid")
  35. if isnumeric(skinid) and not isnull(skinid) and skinid<>"" and not skinid="0" then
  36. sqlstr=" id="&skinid&" "
  37. else
  38. if not isnumeric(request("skinid")) or request("skinid")="" or request("skinid")="0" then
  39. sqlstr=" active=1"
  40. else
  41. sqlstr=" id="&request("skinid")&" "
  42. end if
  43. end if
  44. sql = "select * from config where "&sqlstr&""
  45. set rs=conn.execute(sql)
  46. if rs.eof and rs.bof then
  47. response.write "错误的系统参数,请从有效连接进入。"
  48. response.end
  49. else
  50. txl_info=split(rs("txl_info"),",")
  51. txl_set=split(rs("txl_set"),",")
  52. txl_user=split(rs("txl_user"),",")
  53. txl_ads=split(rs("txl_ads"),"$")
  54. txl_body=split(rs("txl_body"),"|||")
  55. txl_userface=split(rs("txl_userface"),"|")
  56. txl_userfaceNum=ubound(txl_userface)
  57. txl_postface=split(rs("txl_postface"),",")
  58. txl_postfaceNum=ubound(txl_postface)
  59. txl_emot=split(rs("txl_emot"),"|")
  60. txl_emotNum=ubound(txl_emot)
  61. txl_skinpic=split(rs("txl_skinpic"),",")
  62. txl_ubb=split(rs("txl_ubb"),",")
  63. badwords=rs("badwords")
  64. Copyright=rs("txl_copyright")
  65. Version="   Powered by:<a href=http://www.renrenju.com>BZYZtxl Version 5.0.0</a>"
  66. Stopwhy=rs("Stopwhy")
  67. cookiepath=rs("cookiepath")
  68. end if
  69. skinid=rs("id")
  70. rs.close
  71. set rs=nothing
  72. if (instr(scriptname,"admin")=0 and instr(scriptname,"login")=0 and instr(scriptname,"chklogin")=0) or supermaster then
  73. if cint(txl_set(1))=1 then
  74. Response.write Stopwhy
  75. response.end
  76. end if
  77. end if
  78. Server.ScriptTimeOut=txl_Set(6)
  79. Rem 用户信息
  80. supermaster=false
  81. master=false
  82. vipuser=false
  83. member=false
  84. guest=false
  85. if userid<>"" and isInteger(userid) then
  86. sql="select u.userid,u.sex,u.lastip,u.logins,u.usermoney,u.bbscount,u.photocount,u.bookcount,u.lasttime,u.usergroupid,c.GroupSetting,u.realname,u.password from [user] u inner join UserGroups c on u.UserGroupID=c.UserGroupID where u.userid="&userid
  87. set rs=conn.execute(sql)
  88. if rs.eof and rs.bof then
  89. founduser=false
  90. else
  91. if trim(rs(12))=trim(memberword) and lcase(trim(membername))=lcase(trim(rs(11))) then
  92. founduser=true
  93. select case rs(9)
  94. case 1
  95. supermaster=true
  96. group="超级管理员"
  97. case 2
  98. master=true
  99. group="版主"
  100. case 5
  101. vipuser=true
  102. group="班级贵宾"
  103. case 3
  104. member=true
  105. group="班级成员"
  106. case else
  107. guest=true
  108. group="班级客人"
  109. end select
  110. userid=rs(0)
  111. sex=rs(1)
  112. lastip=rs(2)
  113.                         logins=rs(3)
  114. usermoney=rs(4)
  115. bbscount=rs(5)
  116. photocount=rs(6)
  117. bookcount=rs(7)
  118. usergroupid=rs(9)
  119. GroupSetting=split(rs(10),",")
  120. if DateDiff("s",rs(8),Now())>Clng(txl_Set(7))*60 then
  121. conn.execute("update [user] set lastip='"&Request.ServerVariables("REMOTE_ADDR")&"',lasttime=Now() where userid="&userid)
  122. end if
  123. else
  124. founduser=false
  125. end if
  126. end if
  127. rs.close
  128. set rs=nothing
  129. end if
  130. if not founduser then
  131. founduser=false
  132. userid=0
  133. set rs=conn.execute("select GroupSetting from usergroups where UserGroupID=6")
  134. GroupSetting=split(rs(0),",")
  135. UsergroupID=7
  136. rs.close
  137. set rs=nothing
  138. end if
  139. rem 用户在线
  140. dim ComeFrom,actCome,statuserid
  141. statuserid=replace(Request.ServerVariables("REMOTE_HOST"),".","")
  142. if not founduser then
  143. session("onlineid")=statuserid
  144. sql="select id from online where id="&cstr(session("onlineid"))
  145. set rs=conn.execute(sql)
  146. if rs.eof and rs.bof then
  147. ComeFrom=""
  148. actCome=""
  149. sql="insert into online(id,realname,usergroup,ip,startime,lastimebk,browser,stats,actforip,actCome) values ("&statuserid&",'访客','访客','"&Request.ServerVariables("REMOTE_HOST")&"',Now(),Now(),'"&Request.ServerVariables("HTTP_USER_AGENT")&"','"&replace(stats,"'","")&"','"&Request.ServerVariables("HTTP_X_FORWARDED_FOR")&"','"&actCome&"')"
  150. else
  151. sql="update online set lastimebk=Now(),stats='"&replace(stats,"'","")&"' where id="&cstr(statuserid)
  152. end if
  153. conn.execute(sql)
  154. else
  155. if founderr then
  156. stats="错误信息"
  157. end if
  158. sql="select id from online where userid="&userid
  159. set rs=conn.execute(sql)
  160. if rs.eof and rs.bof then
  161. ComeFrom=""
  162. actCome=""
  163. sql="insert into online(id,realname,usergroup,ip,startime,lastimebk,browser,stats,actforip,actCome,userid) values ("&statuserid&",'"&membername&"','"&group&"','"&Request.ServerVariables("REMOTE_HOST")&"',Now(),Now(),'"&Request.ServerVariables("HTTP_USER_AGENT")&"','"&replace(stats,"'","")&"','"&Request.ServerVariables("HTTP_X_FORWARDED_FOR")&"','"&actCome&"',"&userid&")"
  164. else
  165. sql="update online set lastimebk=Now(),stats='"&replace(stats,"'","")&"' where userid="&userid
  166. end if
  167. conn.execute(sql)
  168. rs.close
  169. if session("onlineid")<>"" then
  170. Conn.Execute("delete from online where id="&session("onlineid"))
  171. session("onlineid")=""
  172. end if
  173. end if
  174. set rs=nothing
  175. Rem 删除超时用户
  176. sql="Delete FROM online WHERE DATEDIFF('s', lastimebk, now()) > "&txl_Set(7)&"*60"
  177. Conn.Execute sql
  178. %>