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

📄 forum.java

📁 又是一个虚拟社区
💻 JAVA
📖 第 1 页 / 共 3 页
字号:
package com.laoer.bbscs.bbs;import java.sql.*;import java.io.*;import java.util.*;import com.laoer.bbscs.db.*;import com.laoer.bbscs.txthtml.*;import com.laoer.bbscs.user.UserData;import com.laoer.bbscs.user.BoardsMaster;import com.laoer.bbscs.txthtml.DoDate;/** * 该类用于帖子的各项操作 * <p>Title: BBS-CS</p> * <p>Description: BBS-CS(BBS式虚拟社区系统)</p> * <p>Copyright: Copyright (c) 2002</p> * <p>Company: loveroom.com.cn</p> * @author 龚天乙(laoer) * @version 3.0 */public class Forum {  String SQL = "";  DbTrans DBSQL;  DoText myDoText;  ResultSet rs = null;  private int id = 0;  private int id1 = 0;  private int id2 = 0;  private int board = 0;  private String boardname = "";  private int re = 0;  private String bq = "1";  private String UID = "";  private String name ="";  private String title = "";  private String detail = "";  private String sign = "";  private String artsize = "";  private int email_inform = 0;  private int msg_inform = 0;  private int click = 0;  private java.util.Date time = null;  private java.util.Date lasttime = null;  private String ip = "";  private java.util.Date vtime = null;  private int isnew = 0;  private String nickname ="";  private int jd = 0;  private int zc = 0;  private int fd = 0;  private int cannotdel = 0;  private int delsign = 0;  private String deluserID = "";  private String delusername = "";  private int cannotre = 0;  private String amend = "";  /**   * 构造函数   */  public Forum() {      this.DBSQL = new DbTrans();      this.myDoText = new DoText();  }  /**   * 设置某帖子各项值   * @param recid 帖子ID   */  public void setForum(String recid) {      SQL = "select * from forum where id = "+recid;      try {          rs = DBSQL.executeQuery(SQL);          if (rs.next()) {              this.id = rs.getInt("id");              this.id1 = rs.getInt("id1");              this.id2 = rs.getInt("id2");              this.board = rs.getInt("board");              this.boardname = rs.getString("boardname");              this.re = rs.getInt("re");              this.bq = rs.getString("bq");              this.UID = rs.getString("UID");              this.name = rs.getString("name");              this.title = rs.getString("title");              this.detail = rs.getString("detail");              this.sign = rs.getString("sign");              this.artsize = rs.getString("artsize");              this.email_inform = rs.getInt("email_inform");              this.msg_inform = rs.getInt("msg_inform");              this.click = rs.getInt("click");              this.time = rs.getTimestamp("time");              this.lasttime = rs.getTimestamp("lasttime");              this.ip = rs.getString("ip");              this.vtime = rs.getTime("vtime");              this.isnew = rs.getInt("new");              this.nickname = rs.getString("nickname");              this.jd = rs.getInt("jd");              this.zc = rs.getInt("zc");              this.fd = rs.getInt("fd");              this.cannotdel = rs.getInt("cannotdel");              this.delsign = rs.getInt("delsign");              this.deluserID = rs.getString("deluserID");              this.delusername = rs.getString("delusername");              this.cannotre = rs.getInt("cannotre");              this.amend = rs.getString("amend");          }          rs.close();      }      catch (SQLException e) {      }  }  /**   * 取得帖子id   * @return int型id1   */  public int getid() {      return this.id;  }  /**   * 取得帖子id1   * @return int型id2   */  public int getid1() {      return this.id1;  }  /**   * 取得帖子id2   * @return int型id2   */  public int getid2() {      return this.id2;  }  /**   * 取得帖子所在版面ID   * @return int型版面ID   */  public int getBoard() {      return this.board;  }  /**   * 取得版面名   * @return String型版面名   */  public String getBoardName() {      return this.boardname;  }  /**   * 取得帖子回复数   * @return int型回复数   */  public int getRe() {      return this.re;  }  /**   * 取得帖子表情   * @return String型表情   */  public String getBQ() {      return this.bq;  }  /**   * 取得发帖用户ID   * @return String用户ID   */  public String getUID() {      return this.UID;  }  /**   * 取得发帖用户名   * @return String型用户名   */  public String getUserName() {      return this.name;  }  /**   * 取得帖子标题   * @return String型标题   */  public String getTitle() {      return this.title;  }  /**   * 取得帖子内容   * @return String型内容   */  public String getDetail() {      return this.detail;  }  /**   * 取得发帖用户签名   * @return String型签名   */  public String getSign() {      return this.sign;  }  /**   * 取得帖子字数   * @return String型字数   */  public String getArtSize() {      return this.artsize;  }  public int getEmailInform() {      return this.email_inform;  }  public int getMsgInform() {      return this.msg_inform;  }  public int getClick() {      return this.click;  }  public java.util.Date getTime() {      return this.time;  }  public java.util.Date getLastTime() {      return this.lasttime;  }  public String getIP() {      return this.ip;  }  public java.util.Date getVtime() {      return this.vtime;  }  public int getIsNew() {      return this.isnew;  }  public String getNickName() {      return this.nickname;  }  public int getJD() {      return this.jd;  }  public int getZC() {      return this.zc;  }  public int getFD() {      return this.fd;  }  public int getCanNotDel() {      return this.cannotdel;  }  public int getDelSign() {      return this.delsign;  }  public String getDelUserID() {      return this.deluserID;  }  public String getDelUserName() {      return this.delusername;  }  public int getCanNotRe() {      return this.cannotre;  }  public String getAmend() {      return this.amend;  }  public void setDelSign(String recid,String strUserID,String strUserName,String delip) {      SQL = "update forum set delsign = 1,deluserID='"+ strUserID +"',delusername='"+strUserName+"',deltime=now(),delip='"+ delip +"' where id = "+recid;      try {          DBSQL.executeUpdate(SQL);      }      catch (SQLException e) {      }  }  public void setDelWaste(String recid) {      SQL = "delete from forum where id = "+recid;      try {          DBSQL.executeUpdate(SQL);      }      catch (SQLException e) {      }  }  public boolean setDelAllWaste(String bid) {      SQL = "delete from forum where board = "+bid+" and delsign = 1";      try {          DBSQL.executeUpdate(SQL);          return true;      }      catch (SQLException e) {          return false;      }  }  public void setDecRe(int id2) {      SQL = "update forum set re=re-1 where (id="+ id2 +" and id2="+ id2 +")";      try {          DBSQL.executeUpdate(SQL);      }      catch (SQLException e) {      }  }  public void setCanNotDel(String recid) {      SQL = "update forum set cannotdel = 1 where id = "+recid;      try {          DBSQL.executeQuery(SQL);      }      catch (SQLException e) {      }  }  public boolean setDelForums(String[] delforum,String strUserID,String strUserName,String bid,String delip) {

⌨️ 快捷键说明

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