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

数据库编程

开发平台:

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