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

📄 forummsg.java

📁 一个用jsp写的完整的论坛源代码
💻 JAVA
字号:
package com.bcxy.bbs.forum;

/**
 * Title:
 * Description:
 * Copyright:
 * Company: www.liyunet.com
 * 
 * @author lishujiang	
 * @version 1.0
 */

import org.apache.log4j.Logger;

import com.bcxy.bbs.filter.MyFilter;
import com.bcxy.bbs.util.BBSConst;
import com.bcxy.db.JdbcWrapper;
import com.bcxy.util.StringUtil;

public class ForumMSG {

	private Logger log = Logger.getLogger(ForumMSG.class);

	private int announceID = 0, parentID = 0, childNum = 0, forumID = 0;

	private String userName = "", userEmail = "", dateAndTime = "";

	public String topic = "", body = "";

	private int hits = 0, length = 0, rootID = 0, layer = 0, orders = 0,
			isBest = 0;

	private String userIP = "", expression = "";

	private int times = 0, lockTopic = 0, signFlag = 0, emailFlag = 0,
			isTop = 0, isVote = 0, viewMode = 0, viewNumber = 0;

	private User msgUser;

	public ForumMSG() {
	}

	public ForumMSG(int announceID) {
		JdbcWrapper jw = new JdbcWrapper();
		try {
			jw.executeQuery("select * from " + BBSConst.TABLE_BBS1
					+ " where announceID=" + announceID);
			if (jw.next()) {
				this.setAnnounceID(jw.getInt(1));
				this.setParentID(jw.getInt(2));
				this.setChildNum(jw.getInt(3));
				this.setForumID(jw.getInt(4));
				this.setUserName(jw.getString(5));
				this.setUserEmail(jw.getString(6));
				this.setTopic(jw.getString(7));
				this.setBody(jw.getString(8));
				this.setDateAndTime(jw.getString(9));
				this.setHits(jw.getInt(10));
				this.setLength(jw.getInt(11));
				this.setRootID(jw.getInt(12));
				this.setLayer(jw.getInt(13));
				this.setOrders(jw.getInt(14));
				this.setIsBest(jw.getInt(15));
				this.setUserIP(jw.getString(16));
				this.setExpression(jw.getString(17));
				this.setTimes(jw.getInt(18));
				this.setLockTopic(jw.getInt(19));
				this.setSignFlag(jw.getInt(20));
				this.setEmailFlag(jw.getInt(21));
				this.setIsTop(jw.getInt(22));
				this.setIsVote(jw.getInt(23));
				this.setViewMode(jw.getInt(24));
				this.setViewNumber(jw.getInt(25));
			}
		} catch (Exception e) {
			log.error("取得论坛帖子信息出错", e);
		} finally {
			jw.close();
		}
	}

	public void setUser(User msgUser) {
		this.msgUser = msgUser;
	}

	public User getUser() {
		return msgUser;
	}

	public void setAnnounceID(int announceID) {
		this.announceID = announceID;
	}

	public int getAnnounceID() {
		return this.announceID;
	}

	public void setParentID(int parentID) {
		this.parentID = parentID;
	}

	public int getParentID() {
		return this.parentID;
	}

	public void setChildNum(int childNum) {
		this.childNum = childNum;
	}

	public int getChildNum() {
		return this.childNum;
	}

	public void setForumID(int forumID) {
		this.forumID = forumID;
	}

	public int getForumID() {
		return this.forumID;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public String getUserName() {
		return this.userName;
	}

	public void setUserEmail(String userEmail) {
		this.userEmail = userEmail;
	}

	public String getUserEmail() {
		return this.userEmail;
	}

	public void setTopic(String topic) {
		this.topic = topic;
	}

	public String getNoFilterTopic() {
		return this.topic;
	}

	public String getTopic() {
		return (new MyFilter(StringUtil.replace(StringUtil
				.convertNewlines(StringUtil.escapeHTMLTags(this.topic)), " ",
				" "))).getFilterString();
	}

	public void setBody(String body) {
		this.body = body;
	}

	public String getNoFilterBody() {
		return this.body;
	}

	public String getBody() {
		return (new MyFilter(StringUtil.replace(StringUtil
				.convertNewlines(StringUtil.escapeHTMLTags(this.body)), " ",
				" "))).getFilterString();
	}

	public String getHTMLBody() {
		return (new MyFilter((StringUtil.convertNewlines((this.body)))))
				.getFilterString();
	}

	public void setDateAndTime(String dateAndTime) {
		this.dateAndTime = dateAndTime;
	}

	public String getDateAndTime() {
		return this.dateAndTime;
	}

	public void setHits(int hits) {
		this.hits = hits;
	}

	public int getHits() {
		return this.hits;
	}

	public void setLength(int length) {
		this.length = length;
	}

	public int getLength() {
		return this.length;
	}

	public void setRootID(int rootID) {
		this.rootID = rootID;
	}

	public int getRootID() {
		return rootID;
	}

	public void setLayer(int layer) {
		this.layer = layer;
	}

	public int getLayer() {
		return this.layer;
	}

	public void setOrders(int orders) {
		this.orders = orders;
	}

	public int getOrders() {
		return this.orders;
	}

	public void setIsBest(int isBest) {
		this.isBest = isBest;
	}

	public boolean getIsBest() {
		if (isBest == 1)
			return true;
		else
			return false;
	}

	public void setUserIP(String userIP) {
		this.userIP = userIP;
	}

	public String getUserIP() {
		return this.userIP;
	}

	public void setExpression(String expression) {
		this.expression = expression;
	}

	public String getExpression() {
		return this.expression;
	}

	public void setTimes(int times) {
		this.times = times;
	}

	public int getTimes() {
		return this.times;
	}

	public void setLockTopic(int lockTopic) {
		this.lockTopic = lockTopic;
	}

	public boolean getLockTopic() {
		if (lockTopic >= 1)
			return true;
		else
			return false;
	}

	public void setSignFlag(int signFlag) {
		this.signFlag = signFlag;
	}

	public boolean getSignFlag() {
		if (signFlag == 1)
			return true;
		else
			return false;
	}

	public void setEmailFlag(int emailFlag) {
		this.emailFlag = emailFlag;
	}

	public boolean getEmailFlag() {
		if (emailFlag == 1)
			return true;
		else
			return false;
	}

	public void setIsTop(int isTop) {
		this.isTop = isTop;
	}

	public boolean getIsTop() {
		if (isTop == 1)
			return true;
		else
			return false;
	}

	public void setIsAllTop(int isTop) {
		this.isTop = isTop;
	}

	public boolean getIsAllTop() {
		if (isTop == 2)
			return true;
		else
			return false;
	}

	public void setIsVote(int isVote) {
		this.isVote = isVote;
	}

	public boolean getIsVote() {
		if (isVote == 1)
			return true;
		else
			return false;
	}

	public int getViewMode() {
		return viewMode;
	}

	public void setViewMode(int viewMode) {
		this.viewMode = viewMode;
	}

	public int getViewNumber() {
		return viewNumber;
	}

	public void setViewNumber(int viewNumber) {
		this.viewNumber = viewNumber;
	}
}

⌨️ 快捷键说明

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