📄 msgsend.jsp
字号:
<%
/*##################################################################**
**# LyBBS ver 1.2.b2 (1.2.beta-2版) / 凌云论坛 ver 1.2.b2 #**
**# #**
**# 版权所有: 凌云工作室 (原流星电脑工作室) #**
**# #**
**# 制作人 : 星语凌 『teddy (Yongshan Ye)』 #**
**# #**
**# 主页地址: http://www.unix-now.com/lybbs 凌云论坛主页 #**
**# http://www.ierp.info/lybbs 凌云论坛镜像站 #**
**# http://horseye@sina.com/ 凌云论坛支持信箱 #**
**# #**
**##################################################################*/
%>
<script language="JavaScript">
function friendlist(){
this.messanger.toname.value=this.messanger.friend.value;
}
function onlinelist(){
this.messanger.toname.value=this.messanger.online.value;
}
</script>
<%
if(submit.equals("发 送")) {
rs=connect.executeQuery("select myinfo,mess from author where username='"+cookiename+"'");
if(rs.next()) {
myinfo=rs.getString(1);
mess=rs.getString(2);
}
tempSTR=request.getParameter("msgtitle");
if(tempSTR!=null && !tempSTR.equals(""))
msgtitle=togb.equals("1")?connect.toGB(tempSTR):tempSTR;
tempSTR=request.getParameter("msgmessage");
if(tempSTR!=null && !tempSTR.equals(""))
msgmessage=togb.equals("1")?connect.toGB(tempSTR):tempSTR;
tempSTR=request.getParameter("toname");
if(tempSTR!=null && !tempSTR.equals(""))
msgtoname=togb.equals("1")?connect.toGB(tempSTR):tempSTR;
if(msgtitle.equals("") || msgmessage.equals("") || msgtoname.equals(""))
errorinfo="标题、内容和接收用户名都不能空!";
else if(msginboxno>=maxmsgno && maxmsgno!=0 && cookiemode.equals("0"))
errorinfo="您的短消息数已经达到最大容量"+maxmsgno+"条,请先清除!";
else if(myinfo.equals("1") && !cookiemode.equals("4")) {
errorinfo="被发送用户选择了免打扰模式!";
}
else {
msgtitle=connect.toHtml(msgtitle);
msgmessage=connect.toHtml(msgmessage);
rs=connect.executeQuery("select usermode from author where username='"+msgtoname+"' and usermode!=1");
if(rs.next()) {
if(cookiemode.equals("0")) {
if(rs.getInt(1)==0) {
number=connect.getRowNum("webqq where toname='"+msgtoname+"' and operation='get'");
if(number>=maxmsgno && maxmsgno!=0)
errorinfo="短消息无法发送,因为被发用户"+msgtoname+"的收件箱已满!";
else {
updateok=connect.executeUpdate("insert into webqq (fromname,toname,title,message,sendat,operation) values ('"+cookiename+"','"+msgtoname+"','"+msgtitle+"','"+msgmessage+"',now(),'get')");
connect.executeUpdate("insert into webqq (fromname,toname,title,message,sendat,operation) values ('"+cookiename+"','"+msgtoname+"','"+msgtitle+"','"+msgmessage+"',now(),'send')");
}
}
else {
updateok=connect.executeUpdate("insert into webqq (fromname,toname,title,message,sendat,operation) values ('"+cookiename+"','"+msgtoname+"','"+msgtitle+"','"+msgmessage+"',now(),'get')");
connect.executeUpdate("insert into webqq (fromname,toname,title,message,sendat,operation) values ('"+cookiename+"','"+msgtoname+"','"+msgtitle+"','"+msgmessage+"',now(),'send')");
}
}
else {
updateok=connect.executeUpdate("insert into webqq (fromname,toname,title,message,sendat,operation) values ('"+cookiename+"','"+msgtoname+"','"+msgtitle+"','"+msgmessage+"',now(),'get')");
connect.executeUpdate("insert into webqq (fromname,toname,title,message,sendat,operation) values ('"+cookiename+"','"+msgtoname+"','"+msgtitle+"','"+msgmessage+"',now(),'send')");
}
}
else
errorinfo="没有找到您要发送消息的注册用户!可能还没注册!无法完成发送!";
}
}
else if(method.equals("reply") || method.equals("feedback")) {
tempSTR=request.getParameter("msgid");
if(tempSTR!=null && !tempSTR.equals(""))
msgid=Integer.parseInt(tempSTR);
if(msgid!=0) {
rs=connect.executeQuery("select fromname,title,message from webqq where id="+msgid);
if(rs.next()) {
msgfromname=rs.getString(1);
msgtitle=rs.getString(2);
msgmessage=rs.getString(3);
}
}
}
else {
tempSTR=request.getParameter("toname");
if(tempSTR!=null && !tempSTR.equals(""))
msgtoname=togb.equals("1")?connect.toGB(tempSTR):tempSTR;
}
%>
<table cellpadding=0 cellspacing=0 border=0 width=<%=tablewidth%> bgcolor=<%=tablebordercolor%> align=center>
<tr>
<td>
<table cellpadding=3 cellspacing=1 border=0 width=100%>
<form action=messanger.jsp method=post name=messanger>
<input type=hidden name="action" value="<%=action%>">
<input type=hidden name="method" value="<%=method%>">
<tr>
<td bgcolor=<%=miscbacktwo%> align=center colspan=2>
<font color=<%=fontcolormisc%>><b>发送短消息</b></font>
</td>
</tr>
<tr>
<td bgcolor=<%=miscbackone%> align=center colspan=2>
<a href=messanger.jsp?action=inbox><img src=images/inboxpm.gif border=0 alt="收件箱" class="gray" width=50 height=40></a>
<a href=messanger.jsp?action=outbox><img src=images/outboxpm.gif border=0 alt="发件箱" class="gray" width=50 height=40></a>
<a href=messanger.jsp?action=msgsend><img src=images/newpm.gif border=0 alt="发送消息" class="gray" width=50 height=40></a>
<a href="javascript:openscript2('friendlist.jsp',420,320)"><img src=images/friendpm.gif border=0 alt="打开好友录" class="gray" width=50 height=40></a>
</td>
</tr>
<%
if(!submit.equals("发 送")) {
%>
<tr>
<td bgcolor=<%=miscbacktwo%> colspan=2 align=center>
<font color=<%=fontcolormisc%>><b>请完整输入下列信息</b></font>
</td>
</tr>
<tr>
<td bgcolor=<%=miscbackone%> width=20%><font color=<%=fontcolormisc%>><b>收件人:</b></font></td>
<td bgcolor=<%=miscbackone%>><input type=text name="toname" size=16 <%if(method.equals("reply")) out.print("value=\""+msgfromname+"\"");else if(!msgtoname.equals("")) out.println("value=\""+msgtoname+"\"");%>>
<select name="friend" onchange="friendlist()">
<option>好友名单</option>
<%
rs=connect.executeQuery("select friendname from friend where authorid="+cookieid);
while(rs.next()) {
out.println("<option value='"+rs.getString(1)+"'>"+rs.getString(1)+"</option>");
}
%>
</select>
<select name="online" onchange="onlinelist()">
<option>在线名单</option>
<%
rs=connect.executeQuery("select username from author where online='1' and usermode!='1'");
while(rs.next()) {
out.println("<option value='"+rs.getString(1)+"'>"+rs.getString(1)+"</option>");
}
%>
</select>
</td>
</tr>
<tr>
<td bgcolor=<%=miscbackone%> valign=top><font color=<%=fontcolormisc%>><b>标题:</b></font></td>
<td bgcolor=<%=miscbackone%>><input type=text name="msgtitle" size=36 maxlength=80 <%if(method.equals("reply")) out.print("value=\"Re:"+msgtitle+"\"");else if(method.equals("feedback")) out.print("value=\"Fw:"+msgtitle+"\"");%>></td>
</tr>
<tr>
<td bgcolor=<%=miscbackone%> valign=top><font color=<%=fontcolormisc%>><b>内容:</b></td>
<td bgcolor=<%=miscbackone%>><textarea cols=35 rows=6 name="msgmessage"><%if(method.equals("feedback")) out.print("您好!下面是转发的消息:"+msgmessage);%></textarea></td>
</tr>
<tr>
<td bgcolor=<%=miscbacktwo%> colspan=2 align=center>
<input type=submit name=submit value="发 送">
<input type="reset" name="reset" value="清 除">
</td>
</tr>
<%
}
else {
if(updateok) {
%>
<tr>
<td bgcolor=<%=miscbackone%> align=center colspan=2>
<font color=<%=fontcolormisc%>><b>给<%=msgtoname%>的短消息已经发出。</b>
<p>该消息同时也复制到您的发件箱中了!
</font>
</td>
</tr>
<%
}
else {
%>
<tr>
<td bgcolor=<%=miscbackone%> valign=middle align=center colspan=2>
<font face=宋体 color=<%=fontcolormisc%>><b>错误: 发送消息</b></font>
</td>
</tr>
<tr>
<td bgcolor=<%=miscbacktwo%> valign=middle colspan=2>
<font face=宋体 color=<%=fontcolormisc%>>
<b>关于 发送消息 的详细错误原因</b>
<ul>
<li><b><%=errorinfo%></b>
<%
if(myinfo.equals("1"))
out.println("<li>详细原因:"+mess);
%>
<li>你是否仔细阅读了<a href="help.jsp">帮助文件</a>?
</ul>
<br><br>
<center><a href="javascript:history.go(-1)"> << 返回上一页</a></center>
</font>
</td>
</tr>
<%
}
}
%>
</form>
</table>
</td>
</tr>
</table>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -