?? forum.java
字號:
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 + -