⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 message.asp

📁 1. 硬件环境:MS WINDOWS NT PACK 4 OR LATER /WIN2000 WITH IIS 4.0 OR LATER /WIN9X+PWS 2. 数 据 库:Access2000
💻 ASP
字号:
<!-- #include file="setup.asp" -->
<%

validate "Login.asp",0
Menu=Request.QueryString("menu")
if Menu="post" then%>
		<META http-equiv=Content-Type content=text/html;charset=gb2312>
		<link href=images/bbs.css rel=stylesheet>
		<SCRIPT>
		var i=0;
		function check(theForm) {
		
		if(theForm.incept.value == "" ) {
		alert("昵称不能没有填写!");
		return false;
		}
		
		if(theForm.incept.value == "<%=Request.Cookies("user")%>" ) {
		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="C4D4E5"><TABLE WIDTH=300 BORDER=0 CELLPADDING=3 CELLSPACING=0 BGCOLOR=C4D4E5>
		<TR ALIGN=center><TD><b><FONT COLOR=FFFFFF>发送消息</FONT></A></TD></TR></TABLE>
		<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 bgcolor="F8F8F8" height="35">
		&nbsp;昵称:<input class=bt name="incept" type="text" size="15">
		</TD><TD align=right bgcolor="F8F8F8" height="35">
		<%
		sql="select friend,userface from user where username='"&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="5" onkeydown=presskey()></textarea>
		</TD></TR></TABLE><TABLE WIDTH=300 BORDER=0 CELLSPACING=0 CELLPADDING=0 height="30">
		<tr ALIGN=center><TD bgcolor="C4D4E5">
		
		
		
		<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)>
		<%
		response.end
		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 2,"<li>非法操作",""
		conn.execute("delete from Message where Msgid="&Request("id"))
		Response.Redirect "?topage="&Request.QueryString("topage")
End if


Call Top
Call table()

NewMessage=conn.execute("Select UserPrestige from UserInfo where UserID="&Request.Cookies("User"))(0)
if NewMessage>0 then
conn.execute("update UserInfo set UserPrestige=0 where UserID="&Request.Cookies("user"))
end if
%>
	<script>function checkclick(msg){if(confirm(msg)){event.returnValue=true;}else{event.returnValue=false;}}</script>
	<style>TABLE{BORDER-TOP:0px;BORDER-LEFT:0px;BORDER-BOTTOM:1px}TD{BORDER-RIGHT:0px;BORDER-TOP:0px}</style>
	<title>控制面板</title>
	<br>
	<TABLE  align=center borderColor=a4b6d7 cellSpacing=0 cellPadding=5 width=100% border=1 style="border-collapse: collapse" background=images/title_sub.gif >
	<TBODY><TR>
	<TD align="center"><b><font color="#FFFFFF"><a href=usercp.asp><font color=#ffffff title="">控制面板首页</font></a></font></a></TH></font></b>
	<Td align="center"><b><font color="#FFFFFF"><a href="UserEdit.asp?Menu=UpPhoto"><font color="#FFFFFF">用户照片上传</font></a></TH> </font>
	</b><TD align="center"><b><font color="#FFFFFF"><a href="UserEdit.asp?Menu=Basic"><font color="#FFFFFF">基本资料修改</TH> </font></a> </font>
	</b><TD align="center"><b><font color="#FFFFFF"><a href="UserEdit.asp?menu=Community"><font color="#FFFFFF">社区资料修改</TH></font></a></font>
	</b><TD align="center"><b><font color="#FFFFFF"><a href="UserEdit.asp?menu=UserPsd"><font color="#FFFFFF">用户密码修改</TH> </font></a></font></b>
	<TD align="center"><b><font color="#FFFFFF"><a href="message.asp"><font color="#FFFFFF">用户短信服务</TH> </font></a> </font>
	</b><TD align="center"><b><font color="#FFFFFF"><a href="Quote.asp?menu=fortune"><font color="#FFFFFF">查看财富排行</font></a></TH> </font>
	</b></TR></TBODY></TABLE>
	<HR width="100%" SIZE=1><center>
	<TABLE cellSpacing=0 width=100% align=center bgColor=a4b6d7><TR><TD></TD></TR></TABLE>
	<TABLE  style="WIDTH: 100%;" cellSpacing=0 border=1 borderColor=a4b6d7>
	<TR><TD align="center">
	<a style="text-decoration: none; color: #000000" href="message.asp">
	<img alt src="images/m_inbox.gif" border="0" dypop="收件箱"></a>&nbsp;
	<a style="text-decoration: none; color: #000000" href="message.asp?send=1">
	<img alt src="images/M_issend.gif" border="0" dypop="发件箱"></a>&nbsp;</td></TR>
	</TABLE>
	<TABLE borderColor=a4b6d7 cellSpacing=0 cellPadding=5 width=100% border=1 style="border-collapse: collapse" >
	<TR >
    	<TD width=5% height="100%" align=middle vAlign=center background=images/title_sub.gif> </TD>
	<TD vAlign=center align=middle width=12% background=images/title_sub.gif><B><font color="#FFFFFF"><span id=send>发件人</span></B></TD>
	<TD vAlign=center align=middle width=49% background=images/title_sub.gif><B><font color="#FFFFFF">内容</font></B></TD>
	<TD vAlign=center  align=middle width=17% background=images/title_sub.gif><B><font color="#FFFFFF">日期</font></B></TD>
	<TD vAlign=center align=middle width=17% background=images/title_sub.gif><B><font color="#FFFFFF">操作</font></B></TD>
	</TR>
<%
if Request("send")="1" then
	sql="select * from message where PostID="&Request.Cookies("user")&" order by time Desc"
	response.write "<script>send.innerText='收件人'</script>"
else
	sql="select * from message where InceptID="&Request.Cookies("user")&" order by time Desc"
end if


topage=Request("topage")
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open sql,Conn,1,3
if not rs.eof then
count=rs.recordcount

ToPage=Request.QueryString("ToPage")

if ToPage<>"" then
	ToPage = cint(ToPage)
	if ToPage > rs.pagecount Then ToPage = rs.pagecount
else
	ToPage=1
end if

rs.pagesize=20
TotalPage=rs.pagecount
rs.absolutepage=topage
i=0
Do While Not RS.EOF and i<rs.pagesize
i=i+1
if Request("send")="1" then
author=rs("InceptName")
else
author=rs("PostName")
del="<a href=# onclick=javascript:open('friend.asp?menu=post&inceptID="&rs("PostID")&"&MsgId="&Rs("MsgID")&"','','width=320,height=170')><img alt='回复这个留言' src=images/replynow.gif border=0></a> <a onclick=checkclick('您确定要删除此条讯息?') href=?menu=del&id="&rs("MsgId")&"&ToPage="&ToPage&"><img alt='删除该留言' src=images/del.gif border=0></a>"
end if
%>
<TR>
<TD vAlign=center align=middle width="5%"><IMG src="images/f_norm.gif"></TD>
<TD vAlign=center align=middle width="12%"><%=author%></TD>
<TD width="49%"><%=rs("content")%></TD>
<TD align="center" width="17%"><%=rs("time")%></FONT></TD>
<TD align="center" width="17%"><%=del%></TD></TR>
<%
RS.MoveNext
loop
RS.Close
Set Rs = Nothing%>
</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>
<%
Set Rs = Nothing
htmlend%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -