<% RecipientUserName=HTMLEncode(Request("RecipientUserName")) UserName=HTMLEncode(Request("UserName")) Subject=HTMLEncode(Request("Subject")) Body=HTMLEncode(Request("Body")) box=HTMLEncode(Request("box")) MessageID=RequestInt("MessageID") ForumID=RequestInt("ForumID") MaxPrivateMessageSize=SiteConfig("MaxPrivateMessageSize") if Request("menu")="Post" then if CookieUserName=empty then Alert("您还未登录论坛") if MessageID > 0 then Rs.open "select * from [BBSXP_PrivateMessages] where MessageID="&MessageID&"",conn,1 if not rs.eof then Subject=Rs("Subject") Body=replace(Rs("Body"),"
",vbcrlf) end if if RecipientUserName<>empty then '回复 Subject="RE: "&Subject Body="" else '转发 Body=vbcrlf&vbcrlf&vbcrlf&vbcrlf&"------------------------------------"&vbcrlf&"日期: "&Rs("CreateTime")&vbcrlf&"发件人: "&Rs("SenderUserName")&vbcrlf&"收件人: "&Rs("RecipientUserName")&vbcrlf&"主题: "&Subject&vbcrlf&vbcrlf&Body&"" Subject="FW: "&Subject end if Rs.close end if Response.clear %> 发送讯息
发件人:
收件人: <% if ForumID > 0 then %> ") end if %>
主 题:

 
<% elseif Request("menu")="addPost" then if CookieUserName=empty then Alert("您还未登录论坛") IsSaveOutbox=RequestInt("IsSaveOutbox") IsSenderDelete=0 if IsSaveOutbox=0 then IsSenderDelete=1 if Len(Subject)<2 then Alert("标题不能小于 2 字符") if Len(Body)<2 then Alert("内容不能小于 2 字符") if RecipientUserName="" or Lcase(RecipientUserName)=Lcase(CookieUserName) then Alert("请输入接收的对象且不能是自己") if Conn.Execute("Select UserID From [BBSXP_Users] where UserName='"&RecipientUserName&"'").eof Then Alert("系统不存在"&RecipientUserName&"的资料") if IsSaveOutbox=1 and Conn.Execute("Select count(MessageID) From [BBSXP_PrivateMessages] where RecipientUserName='"&CookieUserName&"' and IsRecipientDelete=0 or SenderUserName='"&CookieUserName&"' and IsSenderDelete=0")(0)>MaxPrivateMessageSize Then Alert("您的短信箱已满不能保存短讯!本次发送失败!") if Conn.Execute("Select count(MessageID) From [BBSXP_PrivateMessages] where RecipientUserName='"&RecipientUserName&"' and IsRecipientDelete=0 or SenderUserName='"&RecipientUserName&"' and IsSenderDelete=0")(0)>MaxPrivateMessageSize Then Alert("用户"&RecipientUserName&"的短信箱已满!本次发送失败!") sql="insert into [BBSXP_PrivateMessages](SenderUserName,RecipientUserName,Subject,Body,IsSenderDelete) values ('"&CookieUserName&"','"&RecipientUserName&"','"&Subject&"','"&Body&"',"&IsSenderDelete&")" Conn.Execute(sql) Conn.execute("update [BBSXP_Users] set NewMessage=NewMessage+1 where UserName='"&RecipientUserName&"'") %> <% else if CookieUserName=empty then error("您还未登录论坛") HtmlTop RecipientCount=conn.execute("select count(messageID) from [BBSXP_PrivateMessages] where RecipientUserName='"&CookieUserName&"' and IsRecipientDelete=0 or SenderUserName='"&CookieUserName&"' and IsSenderDelete=0")(0) UsedMessageSize=RecipientCount/MaxPrivateMessageSize*100 %>
<%ClubTree%> → 短信服务
资料修改 密码修改 上传管理 收 藏 夹 短信服务

文件夹
收件箱[<%=conn.execute("select count(messageID) from [BBSXP_PrivateMessages] where RecipientUserName='"&CookieUserName&"' and IsRecipientDelete=0")(0)%>]
已发送[<%=conn.execute("select count(messageID) from [BBSXP_PrivateMessages] where SenderUserName='"&CookieUserName&"' and IsSenderDelete=0")(0)%>]

<%=UsedMessageSize%>% (<%=RecipientCount%>/<%=MaxPrivateMessageSize%>)
<% select case Request("menu") case "Read" ReadMessage case "Delete" for each ho in Request("MessageID") ho=int(ho) rs.open "select * from [BBSXP_PrivateMessages] where ( RecipientUserName='"&CookieUserName&"' or SenderUserName='"&CookieUserName&"' ) and MessageID="&ho&"",Conn,1,3 if LCASE(rs("RecipientUserName"))=LCASE(CookieUserName) then rs("IsRecipientDelete")=1 if LCASE(rs("SenderUserName"))=LCASE(CookieUserName) then rs("IsSenderDelete")=1 rs.update rs.close next Conn.execute("Delete from [BBSXP_PrivateMessages] where IsRecipientDelete=1 and IsSenderDelete=1") response.redirect("?") case else InOutbox end select %>

<% Sub InOutbox MessageMenu=Request("Menu") if MessageMenu=empty then MessageMenu="Inbox" if MessageMenu="Inbox" then tdstr="发件人" sql="select * from [BBSXP_PrivateMessages] where RecipientUserName='"&CookieUserName&"' and IsRecipientDelete=0 order by MessageID Desc" else tdstr="收件人" sql="select * from [BBSXP_PrivateMessages] where SenderUserName='"&CookieUserName&"' and IsSenderDelete=0 order by MessageID Desc" end if %>
<%=tdstr%> <% Rs.Open sql,Conn,1 PageSetup=20 '设定每页的显示数量 Rs.Pagesize=PageSetup TotalPage=Rs.Pagecount '总页数 PageCount = RequestInt("PageIndex") if PageCount <1 then PageCount = 1 if PageCount > TotalPage then PageCount = TotalPage if TotalPage>0 then Rs.absolutePage=PageCount '跳转到指定页数 i=0 Do While Not Rs.EOF and i > <%if MessageMenu="Inbox" then%> <%else%> <%end if%> <% Rs.MoveNext loop Rs.Close if NewMessage>0 then Conn.execute("update [BBSXP_Users] set NewMessage=0 where UserID="&CookieUserID&"") %>
新建 删除
主题 日期 大小
" name="MessageID"> " target="_blank"> <%=Rs("SenderUserName")%> " target="_blank"> <%=Rs("RecipientUserName")%> &box=<%=MessageMenu%>"> <%=Rs("Subject")%> <%=Rs("CreateTime")%> <%=CheckSize(Len(""&Rs("Body")&""))%>
<%ShowPage()%>
<% End Sub Sub ReadMessage if box="Inbox" then FieldName="RecipientUserName" DeleteFieldName="IsRecipientDelete" else FieldName="SenderUserName" DeleteFieldName="IsSenderDelete" end if if Request("pageIndex")="previous" then SQL="select top 1 * from [BBSXP_PrivateMessages] where "&FieldName&"='"&CookieUserName&"' and "&DeleteFieldName&"=0 and MessageID>"&MessageID&" order by messageID" elseif Request("pageIndex")="next" then SQL="select top 1 * from [BBSXP_PrivateMessages] where "&FieldName&"='"&CookieUserName&"' and "&DeleteFieldName&"=0 and MessageID<"&MessageID&" order by messageID desc" else SQL="select * from [BBSXP_PrivateMessages] where (RecipientUserName='"&CookieUserName&"' or SenderUserName='"&CookieUserName&"') and MessageID="&MessageID&"" end if Rs.Open SQL,Conn,1,3 if ReturnUrl="" then ReturnUrl="Default.asp" if Rs.eof then response.redirect ReturnUrl %>
新建 " onclick="return window.confirm('您确定执行本次操作?');">删除<%if Rs("SenderUserName")<>CookieUserName then%> &RecipientUserName=<%=Rs("SenderUserName")%>',600,350);">回复<%end if%> ',600,350);">转发
&pageIndex=previous&box=<%=box%>" title="上一条"> &pageIndex=next&box=<%=box%>" title="下一条">
发件人:"><%=Rs("SenderUserName")%><%if Rs("SenderUserName")<>CookieUserName then%> ">+添加好友<%end if%>
<%=Rs("CreateTime")%>

收件人:"><%=Rs("RecipientUserName")%><%if Rs("RecipientUserName")<>CookieUserName then%> ">+添加好友<%end if%>
主 题:<%=Rs("Subject")%>
<%=Rs("Body")%>
<% if LCASE(Rs("RecipientUserName"))=LCASE(CookieUserName) and Rs("IsRead")=0 then Rs("IsRead")=1 Rs.update Rs.close End Sub HtmlBottom end if %>