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

📄 setforums.jsp

📁 BBS系统
💻 JSP
📖 第 1 页 / 共 4 页
字号:
      </td>
     </tr>
     <tr>
      <td bgcolor=#FFFFFF width=40%><font color=#333333><b>允许对贴子投票评分?</b></font></td>
      <td bgcolor=#FFFFFF>
       <select name="ratings">
        <option value="1" <%if(ratings.equals("1")) out.print("selected");%>>允许
        <option value="0" <%if(ratings.equals("0")) out.print("selected");%>>不允许
       </select>
      </td>
     </tr>
     <tr>
      <td bgcolor=#FFFFFF width=40%>
       <font color=#333333><b>论坛图片</b><br>请输入图片名称,此图片被用来放置在页面左边菜单下。<BR><b>不要包含 URL 地址或绝对路径!</font>
      </td>
      <td bgcolor=#FFFFFF><input type=text size=40 name="dbgraphic" value="<%=dbgraphic%>"></td>
     </tr>
     <tr>
      <td bgcolor=#FFFFFF width=40%>
       <font face=宋体 color=#333333><b>队伍图片</b>(如果没有,请保持原样)<br>请输入图片名称,此图片被用来放置在主页面下。<BR><b>不要包含 URL 地址或绝对路径!</b></font>
      </td>
      <td bgcolor=#FFFFFF><input type=text size=40 name="teamlogo" value="<%=teamlogo%>"></td>
     </tr>
     <tr>
      <td bgcolor=#FFFFFF width=40%><font face=宋体 color=#333333><b>队伍网址</b>(如果没有,请保持原样)</td>
      <td bgcolor=#FFFFFF><input type=text size=40 name="teamurl" value="<%=teamurl%>"></td>
     </tr>
     <tr>
      <td bgcolor=#FFFFFF align=center colspan=2><input type=submit value="提 交"></td>
     </tr>
     </form>
<%
    }
    else if(checkaction.equals("yes")) {
      tempSTR=request.getParameter("dbid");
      if(tempSTR!=null && !tempSTR.equals(""))
        dbid=Integer.parseInt(tempSTR);
      tempSTR=request.getParameter("dbname");
      if(tempSTR!=null && !tempSTR.equals(""))
        dbname=togb.equals("1")?connect.toGB(tempSTR):tempSTR;
      tempSTR=request.getParameter("dbdescription");
      if(tempSTR!=null && !tempSTR.equals(""))
        dbdescription=togb.equals("1")?connect.toGB(tempSTR):tempSTR;
      tempSTR=request.getParameter("dbadmin");
      if(tempSTR!=null && !tempSTR.equals(""))
        dbadmin=togb.equals("1")?connect.toGB(tempSTR):tempSTR;
      tempSTR=request.getParameter("dbviceadmin");
      if(tempSTR!=null && !tempSTR.equals(""))
        dbviceadmin=togb.equals("1")?connect.toGB(tempSTR):tempSTR;
      tempSTR=request.getParameter("htmlstat");
      if(tempSTR!=null && !tempSTR.equals(""))
        htmlstat=togb.equals("1")?connect.toGB(tempSTR):tempSTR;
      tempSTR=request.getParameter("lycodestat");
      if(tempSTR!=null && !tempSTR.equals(""))
        lycodestat=togb.equals("1")?connect.toGB(tempSTR):tempSTR;
      tempSTR=request.getParameter("privateforum");
      if(tempSTR!=null && !tempSTR.equals(""))
        privateforum=togb.equals("1")?connect.toGB(tempSTR):tempSTR;
      tempSTR=request.getParameter("dbpassword");
      if(tempSTR!=null && !tempSTR.equals(""))
        dbpassword=togb.equals("1")?connect.toGB(tempSTR):tempSTR;
      tempSTR=request.getParameter("indexforum");
      if(tempSTR!=null && !tempSTR.equals(""))
        indexforum=togb.equals("1")?connect.toGB(tempSTR):tempSTR;
      tempSTR=request.getParameter("startnewthreads");
      if(tempSTR!=null && !tempSTR.equals(""))
        startnewthreads=togb.equals("1")?connect.toGB(tempSTR):tempSTR;
      tempSTR=request.getParameter("ratings");
      if(tempSTR!=null && !tempSTR.equals(""))
        ratings=togb.equals("1")?connect.toGB(tempSTR):tempSTR;
      tempSTR=request.getParameter("dbgraphic");
      if(tempSTR!=null && !tempSTR.equals(""))
        dbgraphic=togb.equals("1")?connect.toGB(tempSTR):tempSTR;
      tempSTR=request.getParameter("teamlogo");
      if(tempSTR!=null && !tempSTR.equals(""))
        teamlogo=togb.equals("1")?connect.toGB(tempSTR):tempSTR;
      tempSTR=request.getParameter("teamurl");
      if(tempSTR!=null && !tempSTR.equals(""))
        teamurl=togb.equals("1")?connect.toGB(tempSTR):tempSTR;
      errorinfo="";
      if(!dbname.equals("")) {
        number=connect.getRowNum("db where dbname=\""+dbname+"\" and forum="+forum+" and id!="+dbid);
        if(number!=0)
          errorinfo="此论坛名已经存在!请重新输入论坛名!";
        else {
          postok=connect.executeUpdate("update db set dbname=\""+dbname+"\",dbdescription=\""+dbdescription+"\",htmlstat=\""+htmlstat+"\",lycodestat=\""+lycodestat+"\",privateforum=\""+privateforum+"\",dbpassword=\""+dbpassword+"\",indexforum=\""+indexforum+"\",startnewthreads=\""+startnewthreads+"\",ratings=\""+ratings+"\",dbgraphic=\""+dbgraphic+"\",teamlogo=\""+teamlogo+"\",teamurl=\""+teamurl+"\" where id="+dbid);
          if(!dbadmin.equals("")) {
            number=connect.getRowNum("admin where authorname=\""+dbadmin+"\" and db="+dbid+" and usermode=1");
            if(number==0) {
              rs=connect.executeQuery("select authorid from admin where db="+dbid+" and usermode=1");
              if(rs.next()) {
                previousadminid=rs.getInt(1);
                connect.executeUpdate("delete from admin where authorid="+previousadminid);
                //更改原管理员信息
                number=connect.getRowNum("admin where authorid="+previousadminid);
                if(number==0)
                  usermode=0;
                else {
                  rs2=connect.executeQuery2("select max(usermode) from admin where authorid="+previousadminid);
                  if(rs2.next())
                    usermode=rs2.getInt(1)+2;
                }
                connect.executeUpdate("update author set usermode="+usermode+" where id="+previousadminid+" and usermode!="+usermode);
              }
              rs=connect.executeQuery("select id,usermode from author where username='"+dbadmin+"' and usermode!=1");
              if(rs.next()) {
                dbadminid=rs.getInt(1);
                dbadminmode=rs.getInt(2);
                if(dbadminmode<3) {
                  dbadminmode=3;
                  connect.executeUpdate("update author set usermode="+dbadminmode+" where username=\""+dbadmin+"\"");
                }
                connect.executeUpdate("insert into admin (db,authorid,authorname,usermode) values ("+dbid+","+dbadminid+",'"+dbadmin+"',1)");
                msgtitle=",您好,您已经被升级为版主。";
                msgmessage=",您好:<br>&nbsp;&nbsp;&nbsp;您已经被升级为 "+dbname+" 版块的版主,请尽心尽责维护我们的论坛,介绍相关的技术,热心帮助网友解决问题,让我们一起把论坛做的更好!<BR><BR>----------------------------<BR>LyBBS 由凌云创作室『星语凌(teddy)』荣誉出品<BR>主页:http://www.unix-now.com/lybbs";
                connect.executeUpdate("insert into webqq (fromname,toname,title,message,sendat,operation) values (\""+cookiename+"\",\""+dbadmin+"\",\""+dbadmin+msgtitle+"\",\""+dbadmin+msgmessage+"\",now(),'get')");
              }
              else {
                errorinfo="管理员不正确,请先确认此用户名是否已经注册!";
              }
            }
          }
          if(!dbviceadmin.equals("")) {
            dbviceadmin=connect.Replace(dbviceadmin,"\'","\\\'");//把"'"转化为"\'"
            dbviceadmin=connect.Replace(dbviceadmin,"\"","\\\"");//把"""转化为"\""
            dbviceadmin=connect.Replace(dbviceadmin,",,",",");//把"""转化为"\""
            if(!dbviceadmin.endsWith(",")) dbviceadmin+=",";
            query="select authorid from admin where";
            int i=0;
            while(dbviceadmin.indexOf(",")!=-1) {
              dbviceadminname=connect.tokenItem(dbviceadmin,",");
              if(i++==0)
                query+=" authorname!=\""+dbviceadminname+"\"";
              else
                query+=" and authorname!=\""+dbviceadminname+"\"";
              number=connect.getRowNum("admin where authorname=\""+dbviceadminname.trim()+"\" and usermode=0 and db="+dbid);
              if(number==0) {
                rs=connect.executeQuery("select id,usermode from author where username=\""+dbviceadminname+"\" and usermode!=1");
                if(rs.next()) {
                  dbviceadminid=rs.getInt(1);
                  dbviceadminmode=rs.getInt(2);
                  if(dbviceadminmode<2) {
                    dbviceadminmode=2;
                    connect.executeUpdate("update author set usermode="+dbviceadminmode+" where username=\""+dbviceadminname+"\"");
                  }
                  connect.executeUpdate("insert into admin (db,authorid,authorname,usermode) values ("+dbid+","+rs.getInt(1)+",'"+dbviceadminname+"',0)");
                  msgtitle=",您好,您已经被设为论坛副版主。";
                  msgmessage=",您好:<br>&nbsp;&nbsp;&nbsp;您已经被设为 "+dbname+" 版块的副版主,请尽心尽责维护我们的论坛,介绍相关的技术,热心帮助网友解决问题,让我们一起把论坛做的更好!<BR><BR>----------------------------<BR>LyBBS 由凌云创作室『星语凌(teddy)』荣誉出品<BR>主页:http://www.unix-now.com/lybbs";
                  connect.executeUpdate("insert into webqq (fromname,toname,title,message,sendat,operation) values (\""+cookiename+"\",\""+dbviceadminname+"\",\""+dbadmin+msgtitle+"\",\""+dbadmin+msgmessage+"\",now(),'get')");
                }
                else
                  errorinfo="副版主定义错误,没有此用户名!";
              }
              dbviceadmin=dbviceadmin.substring(dbviceadminname.length()+1);
            }
            query+=" and db="+dbid+" and usermode=0";
            rs=connect.executeQuery(query);
            while(rs.next()) {
              previousadminid=rs.getInt(1);
              connect.executeUpdate("delete from admin where authorid="+previousadminid);
              //更改原管理员信息
              number=connect.getRowNum("admin where authorid="+previousadminid);
              if(number==0)
                 usermode=0;
              else {
                rs2=connect.executeQuery2("select max(usermode) from admin where authorid="+previousadminid);
                if(rs2.next())
                  usermode=rs2.getInt(1)+2;
              }
              connect.executeUpdate("update author set usermode="+usermode+" where id="+previousadminid+" and usermode!="+usermode);
            }
          }
        }
      }
      else {
        errorinfo="论坛名不能空!";
      }
%>
    <tr>
     <td bgcolor=#333333"><font color=#FFFFFF><b>编辑论坛</b></font></td>
    </tr>
    <tr>
     <td bgcolor=#EEEEEE align=center><font color=#990000><b>编辑论坛</b></font></td>
    </tr>
    <tr>
     <td bgcolor=#FFFFFF><font color=#333333><b><%if(postok) {out.print("论坛修改完成! <a href='setforums.jsp'>查看</a><br>");if(!errorinfo.equals("")) out.print("版主或副版主添加错误!详细信息:<br>"+errorinfo);} else out.print(errorinfo);%></b></font></td>
    </tr>
<%
    }
  }
  else if(action.equals("delete")) {
    tempSTR=request.getParameter("db");
    if(tempSTR!=null && !tempSTR.equals(""))
      dbid=Integer.parseInt(tempSTR);
    if(checkaction.equals("")) {
%>
    <tr>
     <td bgcolor=#333333"><font color=#FFFFFF><b>欢迎来到论坛管理中心 / 删除论坛</b></font></td>
    </tr>
    <tr>
     <td bgcolor=#EEEEEE align=center><font color=#990000><b>警告!!</b></font></td>
    </tr>
    <tr>
     <td bgcolor=#FFFFFF align=center>
      <font color=#333333>如果您确定要删除论坛和<font color=#ff0000>属于此论坛中所有帖子</font>,那么请点击下面链接<br>(注意:如果此分类中论坛已经删空,程序将自动删除分类名!)<p>
        &gt;&gt; <a href="setforums.jsp?action=delete&checkaction=yes&db=<%=dbid%>">删除论坛以及论坛下的所有文件</a> &lt;&lt;
      </font>
     </td>
    </tr>
<%
    }
    else if(checkaction.equals("yes")) {
      int previousadminid=0,usermode=0;
      rs=connect.executeQuery("select forum from db where id="+dbid);
      if(rs.next()) {
        forumid=rs.getInt(1);
        number=connect.getRowNum("db where forum="+forumid);
        if(number==1)
          connect.executeUpdate("delete from forum where id="+forumid);
      }
      if(dbid!=0) {
        postok=connect.executeUpdate("delete from db where id="+dbid);
        connect.executeUpdate("delete from posts where db="+dbid);
        rs=connect.executeQuery("select authorid from admin where db="+dbid);
        while(rs.next()) {
          previousadminid=rs.getInt(1);
          connect.executeUpdate("delete from admin where authorid="+previousadminid+" and db="+dbid);
          //更改管理员信息
          number=connect.getRowNum("admin where authorid="+previousadminid);
          if(number==0)
            usermode=0;
          else {
            rs2=connect.executeQuery2("select max(usermode) from admin where authorid="+previousadminid);
            if(rs2.next())
              usermode=rs2.getInt(1)+2;
          }
          connect.executeUpdate("update author set usermode="+usermode+" where id="+previousadminid+" and usermode!="+usermode);
        }
      }
%>
    <tr>
     <td bgcolor=#333333"><font color=#FFFFFF><b>欢迎来到论坛管理中心 / 删除论坛结果</b></font></td></tr>
    <tr>
     <td bgcolor=#FFFFFF><font color=#990000><center><b>论坛已被删除(属于这个论坛的帖子和管理员也同时被删除!)</b></center></font></td>
    </tr>
<%
    }
  }
  else if(action.equals("reorder")) {
    //暂未完成论坛排序
%>
    <tr>
     <td bgcolor=#333333"><font color=#FFFFFF><b>欢迎来到论坛管理中心 / 论坛分类重新排序</b></font></td></tr>
    <tr>
     <td bgcolor=#FFFFFF><font color=#990000><center><b>此模块暂未完成</b></center></font></td>
    </tr>
<%
  }
  else if(action.equals("reorderforum")) {
    //暂未完成论坛排序
%>
    <tr>
     <td bgcolor=#333333"><font color=#FFFFFF><b>欢迎来到论坛管理中心 / 论坛重新排序</b></font></td></tr>
    <tr>
     <td bgcolor=#FFFFFF><font color=#990000><center><b>此模块暂未完成</b></center></font></td>
    </tr>
<%
  }
}
%>
   </table>
  </td>
 </tr>
</table>
  </td>
 </tr>
</table>
<%
rs.close();
connect.close();
%>
</body>
</html>

⌨️ 快捷键说明

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