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

📄 xzbnew.jsp

📁 jsp bbs源代码
💻 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/        凌云论坛支持信箱    #**
**#                                                                #**
**##################################################################*/
%>
<%
if(submit.equals("发 布")) {
  if(cookiemode.equals("1")) {
    tempSTR=request.getParameter("postusername");
    if(tempSTR!=null)
      postusername=togb.equals("1")?connect.toGB(tempSTR):tempSTR;
    tempSTR=request.getParameter("postpassword");
    if(tempSTR!=null)
      postpassword=togb.equals("1")?connect.toGB(tempSTR):tempSTR;
  }
  tempSTR=request.getParameter("xzbtitle");
  if(tempSTR!=null)
    xzbtitle=togb.equals("1")?connect.toGB(tempSTR):tempSTR;
  if(!xzbtitle.equals(""))
    xzbtitle=connect.toHtml(xzbtitle);//去除无用的html链接
  tempSTR=request.getParameter("xzbcontent");
  if(tempSTR!=null)
    xzbcontent=togb.equals("1")?connect.toGB(tempSTR):tempSTR;
  if(!xzbcontent.equals(""))
    xzbcontent=connect.toBr(xzbcontent);//把\n换br
  if(!xzbtitle.equals("")) {
    number=connect.getRowNum("xzb where (UNIX_TIMESTAMP(now())-UNIX_TIMESTAMP(postat))<3600 and db="+db);
    if(number==0) {
      if(cookiemode.equals("1")) {
        isadmin=connect.getRowNum("author where usermode!=0 and usermode!=1 and username='"+postusername+"' and password='"+postpassword+"'");
        if(isadmin==0) {
          rs=connect.executeQuery("select status from author where username='"+postusername+"' and password='"+postpassword+"'");
          if(rs.next()) {
            if(rs.getString(1).equals("0"))
              postok=connect.executeUpdate("insert into xzb (db,author,title,content,postat) values ("+db+",'"+postusername+"','"+xzbtitle+"','"+xzbcontent+"',now())");
            else
              errorinfo="用户名和密码输入不正确!";
          }
        }
        else {
          errorinfo="斑竹和坛主不得参与,谢谢合作!";
        }
      }
      else if(cookiemode.equals("0")) {
        postok=connect.executeUpdate("insert into xzb (db,author,title,content,postat) values ("+db+",'"+cookiename+"','"+xzbtitle+"','"+xzbcontent+"',now())");
      }
      else {
        errorinfo="斑竹和坛主不得参与,谢谢合作!";
      }
    }
    else {
      errorinfo="这个小时已经有人发表过一次小字报了,请过一个小时继续!";
    }
  }
  else {
    errorinfo="必须输入标题!";
  }
%>
  <table cellpadding=0 cellspacing=0 border=0 width=<%=tablewidth%> bgcolor=<%=tablebordercolor%> align=center>
   <tr>
    <td>
     <table cellpadding=3 cellspacing=1 border=0 width=100% style="TABLE-LAYOUT: fixed">
      <tr>
       <td bgcolor=<%=miscbacktwo%> valign=middle align=center>
         <font face="宋体" color=<%=fontcolormisc%>><b><%if(postok) out.println("论坛小字报");else out.println("错误: 发布小字报");%></b></font>
       </td>
      </tr>
      <tr>
       <td bgcolor=<%=miscbackone%> valign=middle>
        <font face="宋体" color=<%=fontcolormisc%>>
<%
  if(postok) {
%>
         如果你的浏览器没有自动返回论坛,请点击下面的链接直接返回。
         <ul>
          <li><b>论坛小字报已经发表。</b>
          <li><a href="xzb.jsp?db=<%=db%>">返回论坛小字报</a>
          <li><a href="index.jsp">返回论坛首页</a>
         </ul>
         <meta http-equiv="refresh" content="5; url=xzb.jsp?db=<%=db%>">
<%
  }
  else {
%>
          <b>关于使用小字报错误的详细原因:</b>
          <ul>
           <li><b><%=errorinfo%></b>
           <li>您是否需要查看<a href="javascript:openScript('help.jsp',500,400)">帮助文件</a>?
          </ul>
          <b>产生使用小字报错误的可能原因:</b>
          <ul>
           <li>密码错误
           <li>用户名错误
           <li>您不是<a href="register.jsp" >注册</a>用户
          </ul>
          <br><br>
          <center>&lt;&lt; <a href="javascript:history.go(-1)">返回上一页</a></center>
<%
  }
%>
        </font>
       </td>
      </tr>
     </table>
    </td>
   </tr>
  </table>
<%
}
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="xzb.jsp" method=post>
    <input type=hidden name="action" value="<%=action%>">
    <input type=hidden name="db" value="<%=db%>">
    <tr>
     <td bgcolor=<%=titlecolor%> colspan=2><font color=<%=titlefontcolor%>><b>谁可以张贴小字报?</b> 任何注册会员(除坛主和版主)均可以张贴!</font></td>
    </tr>
<%
  if(cookiemode.equals("1")) {
%>
    <tr>
     <td bgcolor=<%=miscbackone%> valign=middle><font face="宋体" color=<%=fontcolormisc%>>请输入您的用户名</font></td>
     <td bgcolor=<%=miscbackone%> valign=middle><input type=text name="postusername" value="<%=cookiename%>"></a></td>
    </tr>
    <tr>
     <td bgcolor=<%=miscbackone%> valign=middle><font face="宋体" color=<%=fontcolormisc%>>请输入您的密码</font></td>
     <td bgcolor=<%=miscbackone%> valign=middle><input type=password name="postpassword" value=""></td>
    </tr>
<%
  }
%>
    <tr>
     <td bgcolor=<%=miscbackone%> valign=top><font color=<%=fontcolormisc%>><b>小字报标题(最大 80 字)</b></td>
     <td bgcolor=<%=miscbackone%>>
       <input type="text" maxlength="80" name=xzbtitle size=80><br>
     </td>
    </tr>
    <tr>
     <td bgcolor=<%=miscbacktwo%> valign=top>
      <font color=<%=fontcolormisc%>><b>小字报内容</b>
       <p>在此论坛中:
          <li>HTML 标签: <b>不可用</b>
          <li><a href="javascript:openScript('misc.jsp?action=lycode',300,350)">LyBBS 标签</a>: <b>可用</b>
      </font>
     </td>
     <td bgcolor=<%=miscbacktwo%> valign=top>
      <b>&nbsp;&nbsp;每小时一贴,一旦发布可以免费宣传48小时</b><br> 
      <TEXTAREA cols=58 name=xzbcontent rows=6></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>
    </form>
   </table>
  </td>
 </tr>
</table>
<%
}
%>

⌨️ 快捷键说明

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