📄 message.asp
字号:
<!-- #include file="setup.asp" -->
<%
if Request.Cookies("username")="" then
error("<li>您还还未<a href=login.asp>登陆</a>社区")
end if
if Request("menu")="post" then
%>
<META http-equiv=Content-Type content=text/html;charset=gb2312>
<link href=images/skins/<%=Request.Cookies("skins")%>/bbs.css rel=stylesheet>
<SCRIPT>
var i=0;
function check(theForm) {
if(theForm.incept.value == "" ) {
alert("昵称不能没有填写!");
return false;
}
if(theForm.incept.value == "<%=Request.Cookies("username")%>" ) {
alert("请输入你要发送的对象,不能发讯息给自己!");
return false;
}
if(theForm.content.value == "" ) {
alert("不能发空讯息!");
return false;
}
if (theForm.content.value.length > 255){
alert("对不起,您的讯息不能超过 255 个字节!");
return false;
}
i++;if (i>1) {document.form.submit1.disabled = true;}return true;
}
function presskey(eventobject){if(event.ctrlKey && window.event.keyCode==13){this.document.form.submit();}}
function DoTitle(addTitle) {
document.form.incept.value=addTitle
}
function Check(){var Name=document.form.incept.value;
window.open("friend.asp?menu=post&log=1&incept="+Name,"_top","width=320,height=170");
}
</SCRIPT><style>
.bt {BORDER-RIGHT: 1px; BORDER-TOP: 1px; FONT-SIZE: 9pt; BORDER-LEFT: 1px; BORDER-BOTTOM: 1px;}
</style><TITLE>发送消息</TITLE><body topmargin=0 bgcolor="ECE9D8">
<TABLE WIDTH=300 BORDER=0 CELLSPACING=0 CELLPADDING=0><TR><form name=form action="friend.asp" method="post">
<input type="hidden" name="menu" value="addpost">
<TD height="35">
昵称:<input name="incept" type="text" size="15">
</TD><TD align=right height="35">
<%
sql="select friend,userface from user where username='"&HTMLEncode(Request.Cookies("username"))&"'"
rs.Open sql,Conn
master=split(rs("friend"),"|")
for i = 1 to ubound(master)-1
masterlist=""+masterlist+"<option value="&master(i)&">"&master(i)&"</option>"
next
rs.close
%>
<select onchange=DoTitle(this.options[this.selectedIndex].value)>
<option>好友列表</option>
<%=masterlist%>
</select>
</TD></TR><TR><TD VALIGN=top ALIGN=right colspan="2" bgcolor="F8F8F8">
<textarea name="content" cols="39" rows="6" onkeydown=presskey()></textarea>
</TD></TR></TABLE><TABLE WIDTH=300 BORDER=0 CELLSPACING=0 CELLPADDING=0 height="30">
<tr ALIGN=center><TD>
<input onclick=javascript:Check() type="button" value="聊天记录">
</td><TD><input type="reset" value="取消发送" OnClick="window.close();"> </td><TD><input name=submit1 type="submit" value="发送讯息" onclick="return check(this.form)"></td>
</TR></form>
</TABLE>
<body onload=resizeTo(330,206)>
<%
responseend
end if
if instr(Request.ServerVariables("http_referer"),""&Request.ServerVariables("server_name")&"") = 0 then
error("<li>来源错误")
end if
if Request("menu")="del" then
if isnumeric(""&Request("id")&"") = flase then
error("<li>非法操作")
end if
conn.execute("delete from [message] where id="&Request("id")&" and incept='"&Request.Cookies("username")&"'")
end if
top
if newmessage>0 then
conn.execute("update [user] set newmessage=0 where username='"&HTMLEncode(Request.Cookies("username"))&"'")
end if
%>
<script>function checkclick(msg){if(confirm(msg)){event.returnValue=true;}else{event.returnValue=false;}}</script>
<title>控制面板</title>
<table width=97% align="center" border="0">
<tr>
<td vAlign="top" width="30%"><img src="images/logo.gif" border="0"></td>
<td vAlign="center" align="top"> <img src="images/closedfold.gif" border="0"> <a href=Default.asp?menu=listtitle><%=clubname%></a><br>
<img src="images/bar.gif" border="0"><img src="images/openfold.gif"> 控制面板</td>
</tr>
</table>
<br>
<TABLE align=center width="95%" class=a1>
<TBODY>
<TR>
<Td width="14%" align="center"><b><font color="#FFFFFF"><a href="usercp.asp">
<font color="#FFFFFF">控制面板首页</font></a></TH> </font> </b>
<TD width="14%" align="center"><b><font color="#FFFFFF"><a href="EditProfile.asp">
<font color="#FFFFFF">基本资料修改</TH> </font></a> </font> </b>
<TD width="13%" align="center"><b><font color="#FFFFFF"> <a href="EditProfile.asp?menu=contact"><font color="#FFFFFF">编辑论坛选项</TH></font></a></font></b>
<TD width="14%" align="center"><b><font color="#FFFFFF"> <a href="EditProfile.asp?menu=pass"><font color="#FFFFFF">用户密码修改</TH>
</font> </a> </font> </b>
<TD width="14%" align="center"><b><font color="#FFFFFF"><a href="message.asp">
<font color="#FFFFFF">用户短信服务</TH> </font></a> </font> </b>
<TD width="14%" align="center"><b><font color="#FFFFFF"><a href="friend.asp">
<font color="#FFFFFF">编辑好友列表</font></a></TH> </font> </b>
<TD width="17%" align="center"><b><font color="#FFFFFF"><a href="favorites.asp">
<font color="#FFFFFF">用户收藏管理</font></a></TH></font></b></TR></TBODY></TABLE>
<HR width="95%" SIZE=1>
<center>
<TABLE cellSpacing=1 border=0 width="95%" class=a2 cellpadding="3">
<TR><TD align="center" bgcolor="#FFFFFF" colspan=5>
<a style="text-decoration: none; color: #000000" href="message.asp">
<img alt src="images/m_inbox.gif" border="0" dypop="收件箱"></a>
<a style="text-decoration: none; color: #000000" href="message.asp?send=1">
<img alt src="images/M_issend.gif" border="0" dypop="已发送邮件"></a>
<a href="friend.asp">
<img alt src="images/M_address.gif" border="0" dypop="发送讯息"></a>
<a href=# onclick="javascript:open('?menu=post','','width=320,height=170')"><img alt src="images/m_write.gif" border="0" dypop="发送讯息"></a></td></TR>
<TR>
<TD vAlign=center align=middle
width=5% class=a1 height="20"> </TD>
<TD vAlign=center align=middle
width=12% class=a1 height="20"><B><span id=send>发件人</span></B></TD>
<TD vAlign=center align=middle
width=50% class=a1 height="20"><B>内容</B></TD>
<TD align=middle
width=17% class=a1 height="20"><B>日期</B></TD>
<TD vAlign=center align=middle
width=16% class=a1 height="20"><B>操作</B></TD>
</TR>
<%
pagesetup=10 '设定帖子每页的显示数量
if Request("send")="1" then
count=conn.execute("Select count(id)from message where author='"&Request.Cookies("username")&"'")(0)
sql="select * from message where author='"&Request.Cookies("username")&"' order by time Desc"
response.write "<script>send.innerText='收件人'</script>"
else
count=conn.execute("Select count(id)from message where incept='"&Request.Cookies("username")&"'")(0)
sql="select * from message where incept='"&Request.Cookies("username")&"' order by time Desc"
end if
rs.Open sql,Conn
if not rs.eof then
%>
<%
If Count/pagesetup > (Count\pagesetup) then
TotalPage=(Count\pagesetup)+1
else TotalPage=(Count\pagesetup)
End If
PageCount= 0
RS.MoveFirst
if Request.QueryString("ToPage")<>"" then PageCount = cint(Request.QueryString("ToPage"))
if PageCount <=0 then PageCount = 1
if PageCount > TotalPage then PageCount = TotalPage
RS.Move (PageCount-1) * pagesetup
i=0
Do While Not RS.EOF and i<pagesetup
i=i+1
if Request("send")="1" then
author=rs("incept")
else
author=rs("author")
del="<a href=# onclick=javascript:open('friend.asp?menu=post&incept="&rs("author")&"','','width=320,height=170')><img alt='回复这个帖子' src=images/replynow.gif border=0></a> <a onclick=checkclick('您确定要删除此条讯息?') href=?menu=del&id="&rs("id")&"><img alt='删除该留言' src=images/del.gif border=0></a>"
end if
%>
<TR>
<TD vAlign=center align=middle width="5%" bgcolor="#FFFFFF"> <IMG
src="images/f_norm.gif"></TD>
<TD vAlign=center align=middle width="12%" bgcolor="#FFFFFF"> <A href="Profile.asp?username=<%=author%>"><%=author%></A>
</TD>
<TD width="50%" bgcolor="#FFFFFF"><%=rs("content")%> </TD>
<TD align="center" width="17%" bgcolor="#FFFFFF"><%=rs("time")%></FONT> </TD>
<TD align="center" width="16%" bgcolor="#FFFFFF"> <%=del%> </TD>
</TR>
<%
RS.MoveNext
loop
RS.Close
%>
</TD></TR></TABLE><BR>
Page:[
<%
for i=1 to TotalPage
If i<>PageCount then
Response.Write " <a href=?topage="& i &"&send="&Request("send")&">" & i & "</a> "
else
Response.Write "<font color=#000000>"&i&"</font> "
end if
next
Response.Write " ]"
end if
%></TABLE><br>
<%htmlend%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -