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

📄 forum.java

📁 BBS-CS是采用JSP+JavaBean+Servlet开发的一套网络虚拟社区系统。
💻 JAVA
📖 第 1 页 / 共 3 页
字号:
      Forum myForum = new Forum();      UserData myUserData = new UserData();      BoardsMaster myBoardsMaster = new BoardsMaster();      int len = 0 ;      String recid = "";      int id2 = 0;      String UID = "";      String strAuthorName = "";      int jd = 0;      int artunm = 0;      int bx = 0;      try {          len = java.lang.reflect.Array.getLength(delforum);      }      catch (Exception e) {          len = 0;      }      if (len > 0) {          for (int i = 0;i < len;i++) {              myForum.setForum(delforum[i]);              recid = String.valueOf(myForum.getid());              id2 = myForum.getid2();              strAuthorName = myForum.getUserName();              UID = myForum.getUID();              jd = myForum.getJD();              myUserData.setUserData(UID);              artunm = myUserData.getUserArtNum();              bx = myUserData.getUserBx();              myForum.setDelSign(recid,strUserID,strUserName,delip);              if (artunm > 0) {                  if (!(myBoardsMaster.getBoardMaster(strAuthorName,bid) || myBoardsMaster.getBoardsMaster(strAuthorName,bid))) {                      myUserData.setUpdateUserData(UID,"+0","-1","+0");                  }              }              if (jd != 0 && bx>5) {                  myUserData.setUpdateUserData(UID,"-5","+0","+0");              }              String intid2 = String.valueOf(id2);              if (!(intid2.equals(recid))) {                  myForum.setDecRe(id2);              }          }          myForum.close();          myUserData.close();          myBoardsMaster.close();          return true;      }      else {          return false;      }  }  public boolean setDelWastes(String[] delwaste) {      int len = 0;      try {          len = java.lang.reflect.Array.getLength(delwaste);      }      catch (Exception e) {          len = 0;      }      if (len > 0) {          for (int i = 0;i < len;i++) {              setDelWaste(delwaste[i]);          }          return true;      }      else {          return false;      }  }  public void setZcOrFd(String recid, String zc, String fd) {      SQL = "update forum set zc=zc"+zc+",fd=fd"+fd+" where id="+ recid;      try {          DBSQL.executeUpdate(SQL);      }      catch (SQLException e) {      }  }  public boolean setUnDel(String recid) {      SQL = "update forum set delsign = 0 where id = "+recid;      try {          DBSQL.executeUpdate(SQL);          return true;      }      catch (SQLException e) {          return false;      }  }  public boolean isElite(String recid) {      int jd = 0;      SQL = "select jd from forum where id="+ recid;      try {          rs = DBSQL.executeQuery(SQL);          if (rs.next()) {              jd = rs.getInt("jd");          }          rs.close();      }      catch (SQLException e) {      }      if (jd != 0) {          return true;      }      else {          return false;      }  }  public boolean setElite(String recid,String bid,String strUserName) {      String strListElite = "";      SQL = "update forum set jd='"+bid+"',doelitename='"+strUserName+"',doelitetime=now() where id="+ recid;      try {          DBSQL.executeUpdate(SQL);          return true;      }      catch (SQLException e) {          return false;      }  }  public String getEliteDirDH(String pid,String bid,String fileName) {      EliteDH myEliteDH = new EliteDH(this.DBSQL);      return myEliteDH.getDH(pid,bid,fileName);  }  public String getEliteDH(String bid,String pid) {      String strEliteDH = "";      int boardID = 0;      SQL = "select boardID from boards where ID = "+bid;      try {          rs = DBSQL.executeQuery(SQL);          if (rs.next()) {              boardID = rs.getInt("boardID");          }          rs.close();      }      catch (SQLException e) {      }      String strBoardName = "";      if (boardID != 0) {          SQL = "select boardname from board where ID = "+boardID;          try {              rs = DBSQL.executeQuery(SQL);              if (rs.next()) {                  strBoardName = rs.getString("boardname");              }              rs.close();              strEliteDH +="<a href='jinghua.jsp'>讨论区精华</a> >> "+"<a href='eliter.jsp?boardID="+boardID+"'>"+myDoText.iso2gb(strBoardName)+"</a> >> ";          }          catch (SQLException e) {          }          return strEliteDH;      }      else {          return "";      }  }  public String getEliteList(String bid, String pid) {      String strListElite = "";      /*      int numelite = 0;      if (pid != null && pid.length()>0 && pid.equals("0")) {          SQL = "select count(*) as numelite from elite where PID = "+pid+" and  rootID="+rootid;      }      else {          SQL = "select count(*) as numelite from elite where PID = "+bid+" and  rootID="+rootid;      }      try {          rs = DBSQL.executeQuery(SQL);          if (rs.next()) {              numelite = rs.getInt("numelite");          }          rs.close();      }      catch (SQLException e) {      }      */      String tablecolor = "";      int numelite = 1;      int i = 1;      int n = 2;      /*      if (pid != null && pid.length()>0 && pid.equals("0")) {          SQL = "select * from elite where PID = "+pid+" and  rootID="+rootid;      }      else {          SQL = "select * from elite where PID = "+bid+" and  rootID="+rootid;      }      */      SQL = "select * from elite where PID = "+pid+" and  rootID="+bid;      try {          rs = DBSQL.executeQuery(SQL);          while (rs.next()) {              if ((i %= n)==1) {                  tablecolor = "#ffffff";              }              else {                  tablecolor = "#F2F2F2";              }              strListElite += "<TR BGCOLOR="+tablecolor+">\n";              strListElite += "<TD HEIGHT=20 WIDTH=5% ALIGN=center>\n";              strListElite += "<FONT FACE=Arial, Helvetica, sans-serif SIZE=1 COLOR=#999999>"+numelite+"</FONT>\n";              strListElite += "</TD>\n<TD WIDTH=5% ALIGN=center>\n";              strListElite += "<IMG SRC='images/dir.gif' ALT=目录>\n";              strListElite += "</TD>\n<TD WIDTH=40% ALIGN=center>\n";              strListElite += "<A href='elite.jsp?bid="+rs.getInt("rootID")+"&pid="+rs.getInt("ID")+"'>"+myDoText.iso2gb(rs.getString("elitename"))+"</A>\n";              strListElite += "</TD>\n";              strListElite += "<TD WIDTH=15%  ALIGN=center>\n";              strListElite += rs.getString("createuser");              strListElite += "</TD>\n<TD WIDTH=15%  ALIGN=center>\n";              strListElite += rs.getString("zluser");              strListElite += "</TD>\n";              strListElite += "<TD  ALIGN=center WIDTH=20%><FONT COLOR=#999999>"+rs.getString("elitetime")+"</FONT></TD>\n";              strListElite += "</TR>\n";              strListElite += "<TR BGCOLOR=#CCCCCC><TD COLSPAN=6 HEIGHT=2><SPACER HEIGHT=1 TYPE=block></TD></TR>\n";              strListElite += "<TR BGCOLOR=#999999>\n";              strListElite += "<TD COLSPAN=6 HEIGHT=1><SPACER HEIGHT=1 TYPE=block></TD>";              strListElite += "</TR>\n";              i++;              numelite++;          }          rs.close();      }      catch (SQLException e) {      }      //numelite++;      //i = numelite;      //i++;      /**      if (pid != null && pid.length()>0 && pid.equals("0")) {          SQL = "select * from forum where jd = "+rootid +" order by id";      }      else {           SQL = "select * from forum where jd = "+bid +" order by id";      }*/      SQL = "select * from forum where jd = "+bid +" and jdpid = "+pid+" order by id";      try {          rs = DBSQL.executeQuery(SQL);          while (rs.next()) {          if ((i %= n)==1) {              tablecolor = "#ffffff";          }          else {              tablecolor = "#F2F2F2";          }              strListElite += "<TR BGCOLOR="+tablecolor+">\n";              strListElite += "<TD HEIGHT=20 WIDTH=5% ALIGN=center>\n";              strListElite += "<FONT FACE=Arial, Helvetica, sans-serif SIZE=1 COLOR=#999999>"+numelite+"</FONT>\n";              strListElite += "</TD>\n<TD WIDTH=5% ALIGN=center>\n";              strListElite += "<IMG SRC='images/file.gif' ALT=文件>\n";              strListElite += "</TD>\n<TD WIDTH=40% ALIGN=center>\n";              strListElite += "<A href='readelite.jsp?rootid="+rs.getInt("board")+"&recid="+rs.getInt("id")+"&bid="+rs.getInt("jd")+"'>"+myDoText.iso2gb(rs.getString("title"))+"</A>\n";              strListElite += "</TD>\n";              strListElite += "<TD WIDTH=15%  ALIGN=center>\n";              strListElite += rs.getString("name");              strListElite += "</TD>\n<TD WIDTH=15%  ALIGN=center>\n";              strListElite += rs.getString("doelitename");              strListElite += "</TD>\n";              strListElite += "<TD  ALIGN=center WIDTH=20%>"+rs.getString("doelitetime")+"</TD>\n";              strListElite += "</TR>\n";              strListElite += "<TR BGCOLOR=#CCCCCC><TD COLSPAN=6 HEIGHT=2><SPACER HEIGHT=1 TYPE=block></TD></TR>\n";              strListElite += "<TR BGCOLOR=#999999>\n";              strListElite += "<TD COLSPAN=6 HEIGHT=1><SPACER HEIGHT=2 TYPE=block></TD>";              strListElite += "</TR>\n";              numelite++;              i++;          }          rs.close();      }      catch (SQLException e) {      }      return strListElite;  }  public String getMEliteList(String bid, String pid) {      String strListElite = "";      int numelite = 1;      /*      if (pid != null && pid.length()>0 && pid.equals("0")) {          SQL = "select count(*) as numelite from elite where PID = "+pid+" and  rootID="+rootid;      }      else {          SQL = "select count(*) as numelite from elite where PID = "+bid+" and  rootID="+rootid;      }      //SQL = "select count(*) as numelite from elite where PID = "+bid+" and rootID = "+rootid;      try {          rs = DBSQL.executeQuery(SQL);          if (rs.next()) {              numelite = rs.getInt("numelite");          }          rs.close();      }      catch (SQLException e) {      }      */      String tablecolor = "";      int i = 1;      int n = 2;      /*      if (pid != null && pid.length()>0 && pid.equals("0")) {          SQL = "select * from elite where PID = "+pid+" and  rootID="+rootid;      }      else {          SQL = "select * from elite where PID = "+bid+" and  rootID="+rootid;      }      */      //SQL = "select * from elite where PID = "+bid+" and rootID = "+rootid;;      SQL = "select * from elite where PID = "+pid+" and  rootID="+bid;      try {          rs = DBSQL.executeQuery(SQL);          if ((i %= n)==1) {              tablecolor = "#ffffff";          }          else {              tablecolor = "#F2F2F2";          }          while (rs.next()) {              strListElite += "<TR BGCOLOR="+tablecolor+">\n";              strListElite += "<TD HEIGHT=20 WIDTH=5% ALIGN=center>\n";              strListElite += "<FONT FACE=Arial, Helvetica, sans-serif SIZE=1 COLOR=#999999>"+numelite+"</FONT>\n";              strListElite += "</TD>\n<TD WIDTH=5% ALIGN=center>\n";              strListElite += "<IMG SRC='images/dir.gif' ALT=目录><INPUT TYPE=checkbox NAME=delelitedir value='"+ rs.getInt("ID") +"'>\n";              strListElite += "</TD>\n<TD WIDTH=40% ALIGN=center>\n";              strListElite += "<A href='elitemanager.jsp?bid="+rs.getInt("rootID")+"&pid="+rs.getInt("ID")+"'>"+myDoText.iso2gb(rs.getString("elitename"))+"</A>\n";              strListElite += "</TD>\n";              strListElite += "<TD WIDTH=15%  ALIGN=center>\n";              strListElite += rs.getString("createuser");              strListElite += "</TD>\n<TD WIDTH=15%  ALIGN=center>\n";              strListElite += rs.getString("zluser");              strListElite += "</TD>\n";              strListElite += "<TD  ALIGN=center WIDTH=20%><FONT COLOR=#999999>"+rs.getString("elitetime")+"</FONT></TD>\n";              strListElite += "</TR>\n";              strListElite += "<TR BGCOLOR=#CCCCCC><TD COLSPAN=6 HEIGHT=2><SPACER HEIGHT=1 TYPE=block></TD></TR>\n";

⌨️ 快捷键说明

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