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

📄 setforums.jsp

📁 BBS系统
💻 JSP
📖 第 1 页 / 共 4 页
字号:
     <tr>
      <td bgcolor=#FFFFFF width=40%><font color=#333333><b>允许对贴子投票评分?</b></font></td>
      <td bgcolor=#FFFFFF>
       <select name="ratings">
        <option value="1">允许
        <option value="0" 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="logo.gif"></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=""></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="http://"></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("forumname");
      if(tempSTR!=null && !tempSTR.equals(""))
        forumname=togb.equals("1")?connect.toGB(tempSTR):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(!forumname.equals("")) {
        number=connect.getRowNum("forum where forumname=\""+forumname+"\"");
        if(number!=0)
          errorinfo="分类中已经有此分类名存在!请重新输入分类名!";
      }
      if(!forumname.equals("") && errorinfo.equals("")) {
        postok=connect.executeUpdate("insert into forum (forumname) values (\""+forumname+"\")");
        if(postok && !dbname.equals("")) {
          rs=connect.executeQuery("select max(id) from forum");
          if(rs.next())
            forum=rs.getInt(1);
          connect.executeUpdate("insert into db (forum,dbname,dbdescription,htmlstat,lycodestat,privateforum,dbpassword,indexforum,startnewthreads,ratings,dbgraphic,teamlogo,teamurl) values ("+forum+",\""+dbname+"\",\""+dbdescription+"\",\""+htmlstat+"\",\""+lycodestat+"\",\""+privateforum+"\",\""+dbpassword+"\",\""+indexforum+"\",\""+startnewthreads+"\",\""+ratings+"\",\""+dbgraphic+"\",\""+teamlogo+"\",\""+teamurl+"\")");
          rs=connect.executeQuery("select max(id) from db");
          if(rs.next())
             dbid=rs.getInt(1);
          if(!dbadmin.equals("")) {
            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+"\"");
              }
              number=connect.getRowNum("admin where authorname=\""+dbadmin+"\" and usermode=1 and db="+dbid);
              if(number==0) {
                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+=",";
            while(dbviceadmin.indexOf(",")!=-1) {
              dbviceadminname=connect.tokenItem(dbviceadmin,",");
              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);
            }
          }
        }
      }
      else if(errorinfo.equals("")) {
        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("editforumname")) {
    if(checkaction.equals("")) {
      rs=connect.executeQuery("select forumname from forum where id="+forum);
      if(rs.next())
        forumname=rs.getString(1);
%>
    <form action="setforums.jsp" method="post">
    <input type=hidden name="action" value="<%=action%>">
    <input type=hidden name="forum" value="<%=forum%>">
    <input type=hidden name="checkaction" value="yes">
    <tr>
     <td bgcolor=#333333" colspan=2><font color=#FFFFFF><b>欢迎来到论坛管理中心 / 编辑分类名称</b></font></td>
    </tr>
    <tr>
     <td bgcolor=#EEEEEE align=center colspan=2><font color=#990000><b>编辑 '<%=forumname%>' 分类的名称</b></font></td>
    </tr>
    <tr>
     <td bgcolor=#FFFFFF width=40%><font color=#333333><b>分类名称</b><br>请输入分类名称</font></td>
     <td bgcolor=#FFFFFF><input type=text size=40 name="forumname" value="<%=forumname%>"></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("forumname");
      if(tempSTR!=null && !tempSTR.equals(""))
        forumname=togb.equals("1")?connect.toGB(tempSTR):tempSTR;
      number=connect.getRowNum("forum where forumname=\""+forumname+"\" and id!="+forum);
      if(number==0) {
        postok=connect.executeUpdate("update forum set forumname=\""+forumname+"\" where id="+forum);
      }
      else
        errorinfo="您更改后的分类名已经存在!请重新输入!";
%>
    <tr>
     <td bgcolor=#333333" colspan=2><font color=#FFFFFF><b>欢迎来到论坛管理中心 / 编辑分类名称结果</b></font></td>
    </tr>
    <tr>
     <td bgcolor=#EEEEEE align=center colspan=2><font color=#333333><b><%if(postok) out.print("所有信息已经成功保存"); else out.print(errorinfo);%></b></font></td>
    </tr>
<%
    }
  }
  else if(action.equals("adddb")) {
    int dbadminmode=0,dbadminid=0,dbviceadminid=0,dbviceadminmode=0;
    String dbdescription="",dbadmin="",dbviceadmin="",htmlstat="",lycodestat="",privateforum="",dbpassword="",indexforum="",startnewthreads="",ratings="",dbgraphic="",teamlogo="",teamurl="";
    String dbviceadminname="";
    if(checkaction.equals("")) {
      rs=connect.executeQuery("select forumname from forum where id="+forum);
      if(rs.next())
        forumname=rs.getString(1);
%>
    <form action="setforums.jsp" method="post">
    <input type=hidden name="forum" value="<%=forum%>">
    <input type=hidden name="action" value="<%=action%>">
    <input type=hidden name="checkaction" value="yes">
    <tr>
     <td bgcolor=#333333" colspan=2><font color=#FFFFFF><b>欢迎来到论坛管理中心 / 增加论坛</b></font></td>
    </tr>
    <tr>
     <td bgcolor=#EEEEEE align=center colspan=2><font color=#990000><b>在 '<%=forumname%>' 分类中增加新论坛</b></font></td>
    </tr>
    <tr>
     <td bgcolor=#FFFFFF width=40%><font color=#333333><b>论坛名称</b><br>请输入论坛名称</font></td>
     <td bgcolor=#FFFFFF><input type=text size=40 name="dbname" value=""></td>
    </tr>
    <tr>
     <td bgcolor=#FFFFFF width=40%><font color=#333333><b>论坛描述</b><br>请输入论坛描述</font></td>
     <td bgcolor=#FFFFFF><input type=text size=40 name="dbdescription" value=""></td>
    </tr>
    <tr>
     <td bgcolor=#FFFFFF width=40%>
      <font color=#333333><b>论坛版主</b><br>请输入论坛版主(只能输一个)</font>
     </td>
     <td bgcolor=#FFFFFF><input type=text size=40 name="dbadmin" value=""></td>
    </tr>
    <tr>
     <td bgcolor=#FFFFFF width=40%>
      <font color=#333333><b>论坛副版主</b><br>请输入论坛副版主(可以有多个,之间以英文逗号“,”分隔!请不要有空格或其它符号字符!)</font>
     </td>
     <td bgcolor=#FFFFFF><input type=text size=40 name="dbviceadmin" value=""></td>
    </tr>
    <tr>
     <td bgcolor=#FFFFFF width=40%><font color=#333333><b>是否使用 HTML 标签?</b></font></td>
     <td bgcolor=#FFFFFF>
      <select name="htmlstat">
       <option value="1">使用
       <option value="0" selected>不使用
      </select>
      </td>
     </tr>
     <tr>
      <td bgcolor=#FFFFFF width=40%><font color=#333333><b>是否使用 LyBBS 标签?</b></font></td>
      <td bgcolor=#FFFFFF>
       <select name="lycodestat">
        <option value="1" selected>使用
        <option value="0">不使用
       </select>
      </td>
     </tr>
     <tr>
      <td bgcolor=#FFFFFF width=40%><font color=#333333><b>是否作为私有论坛?</b></font></td>
      <td bgcolor=#FFFFFF>
       <select name="privateforum">
        <option value="1">是
        <option value="0" selected>否
       </select>
       对坛主和总斑竹无效
      </td>
     </tr>
     <tr>
      <td bgcolor=#FFFFFF width=40%><font color=#333333><b>私有论坛密码</b>(必须配合上面参数使用)</font></td>
      <td bgcolor=#FFFFFF>
       <input type=text size=12 name="dbpassword" value="" maxlength=20> 对坛主和总斑竹无效
      </td>
     </tr>
     <tr>
      <td bgcolor=#FFFFFF width=40%><font color=#333333><b>是否显示导航栏?</b></font></td>
      <td bgcolor=#FFFFFF>
       <select name="indexforum">
        <option value="1" selected>是
        <option value="0" >否
       </select>

⌨️ 快捷键说明

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