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

数据库编程

开发平台:

ASP/ASPX

  1. <% Option Explicit %>
  2. <!--#include file="../FS_Inc/Const.asp" -->
  3. <!--#include file="../FS_InterFace/MF_Function.asp" -->
  4. <!--#include file="../FS_Inc/Function.asp" -->
  5. <!--#include file="lib/strlib.asp" -->
  6. <!--#include file="lib/UserCheck.asp" -->
  7. <%
  8. Dim P_ToUserNumber,P_strToUserNumber,GetUsermessObj
  9. dim FS_Book,str_m_type
  10. str_m_type = NoSqlHack(Request.QueryString("M_type"))
  11. if isnull(str_m_type) or not isnumeric(str_m_type) or trim(str_m_type)="" then
  12. strShowErr = "<li>错误参数</li>"
  13. Response.Redirect("lib/error.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=")
  14. Response.end
  15. end if
  16. Set FS_Book = new Cls_message
  17. P_ToUserNumber = NoSqlHack(Request.QueryString("ToUserNumber"))
  18. '获得用户名和编号
  19. Set GetUsermessObj = server.CreateObject(G_FS_RS)
  20. GetUsermessObj.open "select  UserID,isLock,UserName,GroupID,UserNumber From FS_ME_Users where UserNumber = '"& P_ToUserNumber &"'",User_Conn,1,3
  21. if GetUsermessObj.eof then
  22. P_strToUserNumber = ""
  23. Else
  24. P_strToUserNumber = GetUsermessObj("UserName")
  25. End if
  26. If Request.Form("Action") = "Save" then
  27. Dim p_M_ReadUserName,p_M_title,p_M_Content,p_M_Type
  28. p_M_ReadUserName = NoSqlHack(Request.Form("M_ReadUserNumber"))
  29. p_M_title = NoSqlHack(Request.Form("Title"))
  30. p_M_Content = NoHtmlHackInput(Request.Form("Content"))
  31. p_M_Type= NoSqlHack(Request.Form("M_Type"))
  32. If p_M_ReadUserName="" Or p_M_title="" Or p_M_Content="" Then
  33. strShowErr = "<li>请填写完整</li><li>留言标题、收件人、信息内容不能为空</li>"
  34. Call ReturnError(strShowErr,"")
  35. End If
  36. If len(p_M_Content)>1000 Then
  37. strShowErr = "<li>留言内容不能超过1000个字符</li>"
  38. Call ReturnError(strShowErr,"")
  39. End If
  40. If Trim(p_M_ReadUserName)=Fs_User.UserName Then
  41. strShowErr = "<li>不能自己给自己发送留言</li>"
  42. Call ReturnError(strShowErr,"")
  43. End if
  44. Dim Returvaluestr
  45. Returvaluestr = Fs_User.GetFriendNumber(p_M_ReadUserName)
  46. Dim t_RsCheckFriend
  47. if Returvaluestr ="0" then
  48. strShowErr = "<li>找不到会员信息,可能您发送的会员已经删除</li>"
  49. Call ReturnError(strShowErr,"")
  50. Else
  51. Set t_RsCheckFriend = User_Conn.Execute("select FriendType from FS_ME_Friends where UserNumber='"&Returvaluestr&"' and F_UserNumber='"&Fs_User.UserNumber&"' and FriendType=2")
  52. If Not t_RsCheckFriend.EOF Then 
  53. strShowErr = "<li>对方已将你列入黑名单,不能再给他发送信息</li>"
  54. Call ReturnError(strShowErr,"")
  55. End If
  56. End if
  57. If Fs_User.UserExist(Returvaluestr)=False then
  58. strShowErr = "<li>没有此用户或者此用户已经被锁定</li>"
  59. Call ReturnError(strShowErr,"")
  60. End If
  61. Set t_RsCheckFriend = Nothing 
  62. If FS_Book.LenbContent(Returvaluestr)+Len(Request.Form("Content")) > 100*1024 then
  63. strShowErr = "<li>对方留言空间容量已满!请通知对方删除多余留言</li>"
  64. Call ReturnError(strShowErr,"")
  65. End If
  66. dim save_rs
  67. set save_rs= Server.CreateObject(G_FS_RS)
  68. save_rs.open "select * From FS_ME_Book where 1=0",User_Conn,1,3
  69. save_rs.addnew
  70. save_rs("M_Title")=p_M_title
  71. save_rs("M_ReadUserNumber")=Returvaluestr
  72. save_rs("M_Content")=p_M_Content
  73. save_rs("M_FromUserNumber")=Fs_User.UserNumber
  74. save_rs("M_FromDate")=now
  75. save_rs("M_ReadTF")=0
  76. save_rs("LenContent")=len(p_M_Content)
  77. save_rs("M_Type")=p_M_Type
  78. save_rs.update
  79. save_rs.close:set save_rs = nothing
  80. Set FS_Book = Nothing 
  81. strShowErr = "<li>恭喜!</li><li>发送成功</li>"
  82. Response.Redirect("lib/Success.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=")
  83. Response.end
  84. Else
  85. Dim p_BookID,RsRBookObj,str_m_title,str_M_FromUserNumber,str_M_ReadUserNumber,str_M_Content,str_M_FromDate
  86. p_BookID = NoSqlHack(Request.QueryString("BookID"))
  87. if isNumeric(p_BookID) = false then
  88. strShowErr = "<li>参数错误</li>"
  89. Response.Redirect("lib/Error.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=")
  90. Response.end
  91. End if
  92. '更新留言
  93. Set RsRBookObj = server.CreateObject(G_FS_RS)
  94. RsRBookObj.open "select  BookID,M_Title,M_FromUserNumber,M_ReadUserNumber,M_Content,M_FromDate,M_ReadTF,LenContent From FS_ME_Book where BookID = "& p_BookID ,User_Conn,1,3
  95. if RsRBookObj.eof then
  96. strShowErr = "<li>找不到记录</li>"
  97. Response.Redirect("lib/Error.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=")
  98. Response.end
  99. Else
  100. RsRBookObj("M_ReadTF")=1
  101. RsRBookObj.Update
  102. str_m_title = "RE:"&RsRBookObj("M_title")
  103. str_M_FromUserNumber = Fs_User.GetFriendName(RsRBookObj("M_FromUserNumber"))
  104. str_M_ReadUserNumber = RsRBookObj("M_ReadUserNumber")
  105. str_M_Content = vbCrLf&"---------"&str_M_FromUserNumber &"在"& RsRBookObj("M_FromDate") &"说:--------"&vbCrLf&""&RsRBookObj("M_Content")
  106. str_M_FromDate = RsRBookObj("M_FromDate")
  107. %>
  108. <html xmlns="http://www.w3.org/1999/xhtml">
  109. <title>留言-网站内容管理系统</title>
  110. <meta name="keywords" content="风讯cms,cms,FoosunCMS,FoosunOA,FoosunVif,vif,风讯网站内容管理系统">
  111. <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
  112. <meta content="MSHTML 6.00.3790.2491" name="GENERATOR" />
  113. <meta name="Keywords" content="Foosun,FoosunCMS,Foosun Inc.,风讯,风讯网站内容管理系统,风讯系统,风讯新闻系统,风讯商城,风讯b2c,新闻系统,CMS,域名空间,asp,jsp,asp.net,SQL,SQL SERVER" />
  114. <link href="images/skin/Css_<%=Request.Cookies("FoosunUserCookies")("UserLogin_Style_Num")%>/<%=Request.Cookies("FoosunUserCookies")("UserLogin_Style_Num")%>.css" rel="stylesheet" type="text/css">
  115. <head>
  116. <body>
  117. <table width="98%" border="0" align="center" cellpadding="1" cellspacing="1" class="table">
  118.   <tr>
  119.     <td>
  120.       <!--#include file="top.asp" -->
  121.     </td>
  122.   </tr>
  123. </table>
  124. <table width="98%" height="135" border="0" align="center" cellpadding="1" cellspacing="1" class="table">
  125.   
  126.     <tr class="back"> 
  127.       <td   colspan="2" class="xingmu" height="26"> <!--#include file="Top_navi.asp" --> </td>
  128.     </tr>
  129.     <tr class="back"> 
  130.       <td width="18%" valign="top" class="hback"> <div align="left"> 
  131.           <!--#include file="menu.asp" -->
  132.         </div></td>
  133.       <td width="82%" valign="top" class="hback"><table width="98%" border="0" align="center" cellpadding="5" cellspacing="1" class="table">
  134.         <tr class="hback"> 
  135.           <td class="hback"><strong>位置:</strong><a href="../">网站首页</a> &gt;&gt; 
  136.             <a href="main.asp">会员首页</a> &gt;&gt; <a href="book.asp?M_Type=<%=str_m_type%>">留言管理</a>&gt;&gt; 回复留言&lt;&lt; 
  137.             <%
  138. select case Request.QueryString("M_type")
  139. case "0"
  140. Response.Write("会员留言")
  141. case "1"
  142. Response.Write("新闻留言")
  143. case "2"
  144. Response.Write("供求留言")
  145. case "3"
  146. Response.Write("求职招聘留言")
  147. case "4"
  148. Response.Write("房产留言")
  149. case "5"
  150. Response.Write("其他留言")
  151. end select
  152. %>
  153.           &gt;&gt; </td>
  154.         </tr>
  155.       </table> 
  156.         
  157.       <table width="98%" border="0" align="center" cellpadding="5" cellspacing="1" class="table">
  158.         <form name="UserForm" method="post" action=""  onsubmit="return CheckForm();">
  159.           <tr class="hback"> 
  160.             <td width="16%" class="hback_1"><div align="center"><strong>收件人</strong></div></td>
  161.             <td class="hback"> <div align="left"> 
  162.                 <input name="M_ReadUserNumber" type="text" id="M_ReadUserNumber" size="20" value="<% = str_M_FromUserNumber%>">
  163.                 <font color="#999999"> 
  164.                 <select name="SelectFriend" id="SelectFriend" onChange="DoTitle(this.options[this.selectedIndex].value)">
  165.                   <option selected value="">>>选择好友<<</option>
  166.                   <%=Fs_User.FriendList%> 
  167.                 </select>
  168.                 </font>请添写用户名<strong>|<a href="Friend_add.asp">添加好友</a></strong></div></td>
  169.           </tr>
  170.           <tr class="hback"> 
  171.             <td class="hback_1"><div align="center"><strong>留言标题</strong></div></td>
  172.             <td class="hback"> <div align="left"> 
  173.                 <input name="Title" type="text" id="Title" value="<% = str_m_title %>" size="40" maxlength="50">
  174.               </div></td>
  175.           </tr>
  176.           <tr class="hback"> 
  177.             <td class="hback_1"><div align="center"><strong>留言内容</strong></div></td>
  178.             <td class="hback"> <div align="left"> 
  179.                 <textarea name="Content"  style="width:80%" rows="15" id="Content"><% = str_M_Content %></textarea>最多1000个字符
  180.               </div></td>
  181.           </tr>
  182.           <tr class="hback"> 
  183.             <td colspan="2" class="hback"> <div align="left">         
  184.                 <input name="M_Type" type="hidden" id="M_Type" value="<%=str_m_type%>">
  185.                 <input name="Action" type="hidden" id="Action" value="Save">
  186.                 <input type="submit" name="Submit" value=" 确定留言 ">
  187.                   
  188.                 <input type="reset" name="Submit3" value="重新填写">
  189.               </div></td>
  190.           </tr>
  191.           <tr class="hback"> 
  192.             <td colspan="2" class="hback"> <div align="center"> </div></td>
  193.           </tr>
  194.         </form>
  195.       </table>
  196.       </td>
  197.     </tr>
  198.     <tr class="back"> 
  199.       <td height="20"  colspan="2" class="xingmu"> <div align="left"> 
  200.           <!--#include file="Copyright.asp" -->
  201.         </div></td>
  202.     </tr>
  203.  
  204. </table>
  205. </body>
  206. </html>
  207. <script language="JavaScript" type="text/javascript">
  208. function CheckForm()
  209. {
  210. if(document.UserForm.M_ReadUserNumber.value=="")
  211. {
  212. alert("请填写收件人!");
  213. document.UserForm.M_ReadUserNumber.focus();
  214. return false;
  215. }
  216. if(document.UserForm.Title.value=="")
  217. {
  218. alert("请填写留言标题!");
  219. document.UserForm.Title.focus();
  220. return false;
  221. }
  222. if(document.UserForm.Content.value=="")
  223. {
  224. alert("请填写留言内容!");
  225. document.UserForm.Content.focus();
  226. return false;
  227. }
  228. }
  229. </script>
  230. <script language="JavaScript" type="text/JavaScript">
  231. function DoTitle(addTitle) {  
  232. document.UserForm.M_ReadUserNumber.value=document.UserForm.SelectFriend.value;  
  233. document.UserForm.M_ReadUserNumber.focus(); 
  234.  return; 
  235. </script>
  236. <%
  237. End if
  238. End if
  239. RsRBookObj.close:set RsRBookObj = nothing
  240. set FS_Book = nothing
  241. Set Fs_User = Nothing
  242. %>
  243. <!--Powsered by Foosun Inc.,Product:FoosunCMS V4.0系列-->