messanger.jsp

来自「jsp bbs源代码」· JSP 代码 · 共 219 行

JSP
219
字号
<%
/*##################################################################**
**#  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/        凌云论坛支持信箱    #**
**#                                                                #**
**##################################################################*/
%>
<%@ include file="include/config.jsp"%>
<%@ page contentType="text/html;charset=gb2312" %>
<%@ include file="include/connect.jsp"%>
<%
int db=0;
String tempSTR="",action="",submit="",method="";
//用户cookie变量声明
int id=0,styleid=0,membergone=0;
String cookieid="",cookiename="",usermode="",cookiemode="";
//日期定义
int now_year=0,now_month=0,now_day=0,now_hour=0,now_minute=0,now_second=0;
String now_date="",now_time="";
//定义boardprepare.jsp中的变量
String onlineview="",dispview="",boardtitle="",boardname="",title="",version="",copyright="",support="",programmer="",programemail="",homename="",homeurl="",togb="1",status="",maintainreason="",announcement="1",boardurl="",showfastlogin="",dispborn="",styleQuery="";
//定义本页变量
int number=0,msgid=0,maxmsgno=0,msginboxno=0;
String msgtitle="",msgmessage="",msgfromname="",msgtoname="",msgviewed="",msgsendat="",allowusemsg="",myinfo="0",mess="";
boolean deleteok=false,updateok=false;
String deleteinfo="",errorinfo="";
%>
<%@ include file="include/boardprepare.jsp"%>
<%@ include file="include/style.jsp"%>
<%
tempSTR=request.getParameter("action");
if(tempSTR!=null && !tempSTR.equals(""))
  action=tempSTR;
else action="inbox";
tempSTR=request.getParameter("submit");
if(tempSTR!=null && !tempSTR.equals(""))
  submit=togb.equals("1")?connect.toGB(tempSTR):tempSTR;
tempSTR=request.getParameter("method");
if(tempSTR!=null && !tempSTR.equals(""))
  method=tempSTR;
%>
<!--//html from here-->
<%@ include file="include/head.jsp"%>
<style>
  .gray {CURSOR:hand;filter:gray}
  INPUT {BORDER-TOP-WIDTH: 1px; PADDING-RIGHT: 1px; PADDING-LEFT: 1px; BORDER-LEFT-WIDTH: 1px; FONT-SIZE: 9pt; BORDER-LEFT-COLOR: #cccccc; BORDER-BOTTOM-WIDTH: 1px; BORDER-BOTTOM-COLOR: #cccccc; PADDING-BOTTOM: 1px; BORDER-TOP-COLOR: #cccccc; PADDING-TOP: 1px; HEIGHT: 18px; BORDER-RIGHT-WIDTH: 1px; BORDER-RIGHT-COLOR: #cccccc}
</style>
<script language="JavaScript">
function openscript2(url, width, height) {
  var Win = window.open(url,"openwindow",'width=' + width + ',height=' + height + ',resizable=1,scrollbars=yes,menubar=yes,status=yes' );
}
</script>
<body <%=lbbody%>>
<p>&nbsp;
<br>
<%
rs=connect.executeQuery("select maxmsgno,allowusemsg from config where id=1");
if(rs.next()) {
  maxmsgno=rs.getInt(1);
  allowusemsg=rs.getString(2);
}
if(maxmsgno!=0)
  msginboxno=connect.getRowNum("webqq where toname='"+cookiename+"' and operation='get'");
if(allowusemsg.equals("0")) {
%>
<table cellpadding=0 cellspacing=0 border=0 width=<%=tablewidth%> bgcolor=<%=tablebordercolor%> align=center>
 <tr>
  <td>
   <table cellpadding=3 cellspacing=1 border=0 width=100%>
    <tr>
     <td bgcolor=<%=miscbacktwo%> align=center>
      <font color=<%=fontcolormisc%>><b>短消息已经被管理员关闭</b></font>
     </td>
    </tr>
    <tr>
     <td bgcolor=<%=miscbackone%> align=center><font color=<%=fontcolormisc%>>如有问题,请联系管理员!</font></td>
    </tr>
   </table>
  </td>
 </tr>
</table>
<%
}
else if(cookiemode.equals("1")) {
  boolean logok=false;
  String username="",password="",userstatus="";
  if(submit.equals("登 陆")) {
    tempSTR=request.getParameter("username");
    if(tempSTR!=null && !tempSTR.equals(""))
      username=togb.equals("1")?connect.toGB(tempSTR):tempSTR;
    tempSTR=request.getParameter("password");
    if(tempSTR!=null && !tempSTR.equals(""))
      password=togb.equals("1")?connect.toGB(tempSTR):tempSTR;
    if(!username.equals("") && !username.equals("客人") && !password.equals("")) {
      number=connect.getRowNum("author where username='"+username+"' and password='"+password+"'");
      if(number>0) {
        rs=connect.executeQuery("select id,status,usermode,myinfo,mess from author where username='"+username+"' and password='"+password+"'");
        if(rs.next()) {
          cookieid=String.valueOf(rs.getInt(1));
          userstatus=rs.getString(2);
          cookiemode=String.valueOf(rs.getInt(3));
          myinfo=rs.getString(4);
          mess=rs.getString(5);
          cookiename=username;
          if(userstatus.equals("0")) {
%>
<%@ include file="include/setcookie.jsp"%>
<%
            logok=connect.executeUpdate("update author set lastactivetime=now(),logintime=now(),online='1',visittimes=visittimes+1 where username='"+username+"' and password='"+password+"'");
          }
        }
      }
    }
  }
  if(logok) {
%>
    <script>this.location.reload();</script>
<%
  }
  else {
%>
<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">
    <input type=hidden name="action" value="<%=action%>">
    <tr>
     <td bgcolor=<%=miscbacktwo%> colspan=2 align=center>
      <font color=<%=fontcolormisc%>><b>请输入您的用户名、密码登陆</b></font>
     </td>
    </tr>
    <tr>
     <td bgcolor=<%=miscbackone%>><font color=<%=fontcolormisc%>>请输入您的用户名</font></td>
     <td bgcolor=<%=miscbackone%>><input type=text name="username" value="<%=cookiename%>"></td>
    </tr>
    <tr>
     <td bgcolor=<%=miscbackone%>><font color=<%=fontcolormisc%>>请输入您的密码</font></td>
     <td bgcolor=<%=miscbackone%>><input type=password name="password"></td>
    </tr>
    <tr>
     <td bgcolor=<%=miscbacktwo%> colspan=2 align=center><input type=submit name="submit" value="登 陆"></td>
    </tr>
    </form>
   </table>
  </td>
 </tr>
</table>
<%
  }
}
else if(action.equals("inbox")) {
%>
<%@ include file="include/inbox.jsp"%>
<%
}
else if(action.equals("outbox")) {
%>
<%@ include file="include/outbox.jsp"%>
<%
}
else if(action.equals("msgsend")) {
%>
<%@ include file="include/msgsend.jsp"%>
<%
}
else if(action.equals("msgread")) {
%>
<%@ include file="include/msgread.jsp"%>
<%
}
else if(action.equals("show")) {
%>
<table cellpadding=0 cellspacing=0 border=0 width=<%=tablewidth%> bgcolor=<%=tablebordercolor%> align=center height=280>
 <tr> 
  <td> 
   <table cellpadding=6 cellspacing=1 border=0 width=100% height=279>
    <tr> 
     <td  bgcolor=<%=titlecolor%> height=27> 
      <div align=center>短消息通知</div>
     </td>
    </tr>
    <tr> 
     <td bgcolor=<%=forumcolorone%>>
      <div align=center><br>
       <center>
        <font color=<%=titlefontcolor%>><a href=messanger.jsp?action=inbox><img src=images/newmail.gif border=0></a>有新的短消息
         <br><br>
         <a href=messanger.jsp?action=inbox>按此查看</a><br>
<%
  if(msginboxno>=maxmsgno && maxmsgno!=0 && cookiemode.equals("0"))
     out.println("<br><br>提示:短消息容量被管理员设置为"+maxmsgno+"条<br>你的收件箱中有"+msginboxno+"条短消息<br>为了不妨碍你收发消息,请立即删除掉无用信息!");
%>
        </font>
       </center>
       <br>
      </div>
     </td>
    </tr>
   </table>
  </td>
 </tr>
</table>
<%
}
%>
<%
rs.close();
connect.close();
%>
</body>
</html>

⌨️ 快捷键说明

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