📄 user_sms.asp
字号:
rs.close
set rs=nothing
end if
%>
<table width="100%" border="0" cellpadding="4" cellspacing="1" class="tableBC">
<tr><td height="22" class="tdT"> 阅读短信</td></tr>
<tr>
<td width="*" height="22" valign="middle" align="left" class="intdT"><b>短信标题:</b><%=sms_title%></td>
</tr>
<tr>
<td height="100" valign="top" class="tdBC"><%=filterKeyWord(ubbCode(sms_content,0,1,1,1))%></td>
</tr>
<tr>
<td height="25" valign="middle" align="center" class="intdT">发信人:<%=sendtitle%></td>
</tr>
</table>
<%
End Sub
Sub smsOperation()
If request.Form("sendok")<>"" Then
dim incept_user,sms_title,sms_content,sms_type,errmsg,rs
incept_user=trim(request("incept_user"))
sms_title=request("sms_title")
sms_content=request("content")
sms_type=cint(request("sms_type"))
errmsg=""
if ms_submit=0 then
if chkIsOut=false then
showmsg "<font color=""#ff0000"">茂 盛系统返回提示信息:</font><br><br>对不起,本站不允许从外部提交数据","系统出错信息"
exit sub
end if
end if
if isInteger(sms_type)=false then
sms_type=1
end if
if Lcase(userInfo(1))=Lcase(incept_user) then
showmsg "对不起,不能给自己发送短信","操作出错信息"
exit sub
end if
if trim(incept_user)="" then
errmsg=errmsg&"<li><font color=#ff0000>收信人</font> 不能为空!</li>"
elseif chkIsAvaStr(incept_user)=false then
showmsg "<font color=""#ff0000"">系统返回信息:</font><br><br>名字中含有非法字符!","出错信息"
exit sub
end if
if (trim(sms_title)="") or (strLength(trim(sms_title))>40) then
errmsg=errmsg&"<li><font color=#ff0000>短信标题</font> 不能为空或者大于40个字符</li>"
end if
if trim(sms_content)="" or (strLength(trim(sms_content))>1000) then
errmsg=errmsg&"<li><font color=#ff0000>短信内容</font> 不能为空或者小于10个字符大于1000个字符</li>"
end if
if errmsg<>"" then
showmsg errmsg,"出错信息"
errmsg=""
exit sub
end if
incept_user=chkFormStr(incept_user)
sms_title=chkFormStr(filterHtml(sms_title))
sms_content=htmlencode(sms_content)
set rs=server.CreateObject("ADODB.RecordSet")
sql="select * from ms_user where user_name='"&incept_user&"'"
rs.Open sql,connstr,1,1
if rs.recordcount=0 then
errmsg="<li>你填写的 <font color=#ff0000>收信人</font> 不存在!</li>"
rs.close
set rs=nothing
showmsg errmsg,"操作出借信息"
exit sub
end if
rs.close
set rs=nothing
if operation="sendmessage" then
sql="insert into ms_sms(send_user,incept_user,sms_title,sms_content,sms_date,sms_isSend) values('"&userinfo(1)&"','"&incept_user&"','"&sms_title&"','"&sms_content&"',#"&now&"#,"&sms_type&")"
if sms_type=1 then
re_msg="恭喜恭喜,您已成功给"&incept_user&"发送了一条短信啦!"
else
re_msg="恭喜恭喜,您已成功保存一条短信到发信箱里啦!"
end if
elseif operation="edit" then
sms_id=request("sms_id")
if isInteger(sms_id)=false then
errmsg="<li>id编号参数应为整型参数"&sms_id&"</li>"
end if
sql="update ms_sms set send_user='"&userinfo(1)&"',incept_user='"&incept_user&"',sms_title='"&sms_title&"',sms_content='"&sms_content&"',sms_date=#"&now&"#,sms_isSend="&sms_type&" where sms_id="&sms_id
re_msg="恭喜恭喜,您已成功给"&incept_user&"发送了一条短信啦!"
elseif operation="replay" then
sql="insert into ms_sms(send_user,incept_user,sms_title,sms_content,sms_date,sms_isSend) values('"&userinfo(1)&"','"&incept_user&"','"&sms_title&"','"&sms_content&"',#"&now&"#,"&sms_type&")"
re_msg="恭喜恭喜,您已成功给"&incept_user&"回复了一条短信啦!"
elseif operation="fw" then
sql="insert into ms_sms(send_user,incept_user,sms_title,sms_content,sms_date,sms_isSend) values('"&userinfo(1)&"','"&incept_user&"','"&sms_title&"','"&sms_content&"',#"&now&"#,"&sms_type&")"
re_msg="恭喜恭喜,您已成功给"&incept_user&"转发了一条短信啦!"
end if
conn.execute(sql)
showmsg re_msg,"成功信息"
exit sub
End If
Select Case operation
Case "sendmessage"
smstitle="发送短信"
friendname=request.QueryString("friendname")
if friendname<>"" then
incept_user=friendname
end if
Case "edit"
smstitle="编辑短信"
if isNumeric(sms_id) then
set smsrs=conn.execute("select * from ms_sms where sms_id="&sms_id)
if not smsrs.eof and not smsrs.bof then
incept_user=smsrs("incept_user")
sms_title=smsrs("sms_title")
sms_content=smsrs("sms_content")
smsrs.close
set smsrs=nothing
else
showmsg "<font color=""#ff0000"">系统返回如下信息:</font><br><br><li>没有此短信,或者此短信可能已经删除了</li><li><a href="""&request.servervariables("http_referer")&""">单击这里返回</a></li>","出错信息"
smsrs.close
set smsrs=nothing
exit sub
end if
else
showmsg "<font color=""#ff0000"">系统返回如下信息:</font><br><br><li>请输入一个正确的整型参数</li>","出错信息"
exit sub
end if
Case "replay"
smstitle="回复短信"
if isNumeric(sms_id) then
set smsrs=conn.execute("select * from ms_sms where sms_id="&sms_id)
if not smsrs.eof and not smsrs.bof then
incept_user=smsrs("send_user")
sms_title=userinfo(1)&" 回复:"&smsrs("sms_title")
smsrs.close
set smsrs=nothing
else
showmsg "<font color=""#ff0000"">系统返回如下信息:</font><br><br><li>没有此短信,或者此短信可能已经删除了</li><li><a href="""&request.servervariables("http_referer")&""">单击这里返回</a></li>","出错信息"
smsrs.close
set smsrs=nothing
exit sub
end if
else
showmsg "<font color=""#ff0000"">系统返回如下信息:</font><br><br><li>请输入一个正确的整型参数</li>","出错信息"
exit sub
end if
Case "fw"
smstitle="转发短信"
if isNumeric(sms_id) then
set smsrs=conn.execute("select * from ms_sms where sms_id="&sms_id)
if not smsrs.eof and not smsrs.bof then
sms_title=userinfo(1)&" 转发:"&smsrs("sms_title")
content_temp="以下是 "&userinfo(1)&" 转发自 "&smsrs("send_user")&" 于 "&smsrs("sms_date")&" 写的短信"&VbCrlf&_
"------------------------------------------------------------"&vbcrlf
sms_content=content_temp&smsrs("sms_content")
smsrs.close
else
showmsg "<font color=""#ff0000"">系统返回如下信息:</font><br><br><li>没有此短信,或者此短信可能已经删除了</li><li><a href="""&request.servervariables("http_referer")&""">单击这里返回</a></li>","出错信息"
smsrs.close
exit sub
end if
else
showmsg "<font color=""#ff0000"">系统返回如下信息:</font><br><br><li>请输入一个正确的整型参数</li>","出错信息"
exit sub
end if
End Select
sql="select * from ms_user_friend where user_name='"&userinfo(1)&"'"
Set rs=Server.CreateObject("ADODB.RecordSet")
rs.open sql,connstr,1,1
%>
<table width="100%" border="0" cellpadding="1" cellspacing="1" class="tableBC">
<tr valign="middle">
<td height="24" colspan="2" class="tdT"> <%=smstitle%></td>
</tr>
<form name="sendform" action="user_center.asp?action=sms&operation=<%=operation%>" method="post">
<tr valign="middle" class="tdBC">
<td width="70" align="right" height="25"> 收信人:</td>
<td style="padding:3px;">
<input type="hidden" name="sms_id" value="<%=sms_id%>">
<input type="text" name="incept_user" class="wenbenkang" maxlength="20" value="<%=incept_user%>">
*
<select name="user_friend" onChange="{if(this.options[this.selectedIndex].value!=0){this.form.incept_user.value=this.form.user_friend.options[this.selectedIndex].value}}">
<option value="0" selected>从我的好友中添加</option>
<%do while not rs.eof%>
<option value="<%=rs("user_friend")%>"><%=rs("user_friend")%></option>
<%rs.MoveNext
Loop%>
</select>
</td>
</tr>
<tr valign="middle" class="tdBC">
<td height="25" align="right"> 短信标题:</td>
<td style="padding:3px;">
<input name="sms_title" class="wenbenkang" type="text" size="50" maxlength="45" value="<%=sms_title%>"></td>
</tr>
<tr class="tdBC">
<td align="right"> 短信内容:</td>
<td style="padding:3px;" valign="middle">
<textarea name="content" class="textkang" cols="81" rows="5" wrap="VIRTUAL"><%=sms_content%></textarea></td>
</tr>
<tr>
<td height="28" colspan="2" align="center" class="tdT">
<input type="hidden" name="sms_type">
<input type="submit" name="sendok" class="other_button" onclick="this.form.sms_type.value=1" value="发送短信">
<input type="submit" name="sendok" class="other_button" onclick="this.form.sms_type.value=0" value="保存到发信箱">
<input type="reset" name="Submit3" class="other_button" value="清空重写"></td>
</tr></form>
</table>
<%
rs.close
set rs=nothing
End Sub
Sub deleteSms()
dim sms_id
sms_id=request("sms_id")
if not isNumeric(sms_id) then
showmsg "<font color=""#ff0000"">系统返回如下信息:</font><br><br><li>请输入一个正确的整型参数</li>","出错信息"
exit sub
end if
conn.execute("delete from ms_sms where sms_id="&sms_id&" and incept_user='"&userInfo(1)&"' and sms_isSend=1")
showmsg "恭喜恭喜,您已经成功删除一条短信息!","成功信息"
exit sub
End Sub
'========================================================
'MaoSin CMS 1.1 Power by maosin.com
'Email: maosin@163.com , maosin@maosin.com
'Web: http://www.maosin.com http://www.maosin.net
'Copyright (C) 2006 maosin.com All Rights Reserved.
'========================================================
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -