SaveNotes.asp
上传用户:jisenq
上传日期:2014-06-29
资源大小:7216k
文件大小:4k
源码类别:

数据库编程

开发平台:

ASP/ASPX

  1. <% Option Explicit %>
  2. <!--#include file="../FS_Inc/Const.asp"-->
  3. <!--#include file="../FS_InterFace/MF_Function.asp" -->
  4. <!--#include file="../FS_InterFace/ns_Function.asp"-->
  5. <!--#include file="../FS_Inc/Function.asp" -->
  6. <%
  7. response.buffer=true
  8. Response.CacheControl = "no-cache"
  9. Dim Conn,User_Conn
  10. MF_Default_Conn
  11. MF_User_Conn
  12. dim ClassID,NoteRs,Topic,Content,Face,IsUser,isTop,IsAdmin
  13. Dim Configobj,PageS,sql,MSTitle,ShowIP,s_IsUser,s_UserMember
  14. Set Configobj=server.CreateObject (G_FS_RS)
  15. sql="select ID,IsUser,UserMember From FS_WS_Config"
  16. configobj.open sql,Conn,1,1
  17. if not configobj.eof then
  18. s_IsUser = configobj("IsUser")
  19. s_UserMember = configobj("UserMember")
  20. if s_UserMember="" or not isnumeric(s_UserMember) then
  21. s_UserMember = 0
  22. else
  23. s_UserMember = s_UserMember
  24. end if
  25. end if
  26. set configobj=nothing
  27. if s_IsUser <> "0" then
  28. if session("FS_UserName")="" then
  29. response.Write"未开放匿名发布帖!"
  30. response.end
  31. end if
  32. end if
  33. Set NoteRs=Server.CreateObject(G_FS_RS)
  34. if NoSqlHack(Request("Act"))="Add" then
  35. ClassID= NoSQLHack(Request.form("ClassID"))
  36. Topic= NoSQLHack(trim(Replace(Request.form("Topic"),"'","")))
  37. IsTop= NoSQLHack(trim(Request.form("Style")))
  38. Content= NoHtmlHackInput(Trim(Request.form("Content")))
  39. IsAdmin= NoSQLHack(Trim(Request.form("IsAdmin")))
  40. Face= NoSQLHack(Trim(Request.Form("FaceNum")))
  41. if IsAdmin="" then
  42. IsAdmin="0"
  43. end if
  44. if ClassID="" then
  45. Response.write("<script>alert('参数出错!');</script>")
  46. response.end
  47. end if
  48. if Topic="" then
  49. Response.write("<script>alert('标题不能为空');</script>")
  50. Response.end
  51. end if
  52. if isTop="" then
  53. Response.write("<script>alert('错误参数');</script>")
  54. Response.end
  55. end if
  56. if Content="" then
  57. Response.write("<script>alert('内容不能为空');</script>")
  58. response.end
  59. end if
  60. NoteRs.open "Select * from FS_WS_BBS where id=0",Conn,1,3
  61. NoteRs.Addnew
  62. NoteRs("ClassID")=ClassID
  63. if session("FS_UserName")<>"" then
  64. NoteRs("User")=session("FS_UserName")
  65. else
  66. NoteRs("User")="游客"
  67. end if
  68. NoteRs("Topic")=Topic
  69. NoteRs("Body")=Content
  70. NoteRs("AddDate")=now()
  71. NoteRs("IsTop")=IsTop
  72. NoteRs("Style")="普通"
  73. NoteRs("IsAdmin")=IsAdmin
  74. if session("FS_UserName")<>"" then
  75. NoteRs("LastUpdateUser")=session("FS_UserName")
  76. else
  77. NoteRs("LastUpdateUser")="游客"
  78. end if
  79. NoteRs("Face")=Face
  80. NoteRs("IP")=Request.ServerVariables("REMOTE_ADDR")
  81. NoteRs.update
  82. Set NoteRs=nothing
  83. '更新会员积分
  84. if session("FS_UserName")<>"" then
  85. User_Conn.execute("Update FS_ME_Users set Integral=Integral+"& s_UserMember &" where UserName='"& session("FS_UserName")&"'")
  86. if s_UserMember<>0 then
  87. dim f_AddlogObj
  88. Set f_AddlogObj = server.CreateObject(G_FS_RS)
  89. f_AddlogObj.open "select  * From FS_ME_Log where 1=0",User_Conn,1,3
  90. f_AddlogObj.addnew
  91. f_AddlogObj("LogType")="其他"
  92. f_AddlogObj("UserNumber")=GetFriendNumber(session("FS_UserName"))
  93. f_AddlogObj("points")=s_UserMember
  94. f_AddlogObj("moneys")=0
  95. f_AddlogObj("LogTime")=Now
  96. f_AddlogObj("LogContent")="发表帖子增加积分"
  97. f_AddlogObj("Logstyle")=0
  98. f_AddlogObj.update
  99. f_AddlogObj.close
  100. set f_AddlogObj = nothing
  101. end if 
  102. end if
  103. Response.write "<script>history.go(-2);</script>"
  104. end if
  105. Function GetFriendNumber(f_strNumber)
  106. Dim RsGetFriendNumber
  107. Set RsGetFriendNumber = User_Conn.Execute("Select UserNumber From FS_ME_Users Where UserName = '"& f_strNumber &"'")
  108. If  Not RsGetFriendNumber.eof  Then 
  109. GetFriendNumber = RsGetFriendNumber("UserNumber")
  110. End If 
  111. set RsGetFriendNumber = nothing
  112. End Function 
  113. Set Conn=nothing
  114. %>