📄 bbsconf.java
字号:
package com.laoer.bbscs.admin;import java.sql.*;import java.io.*;import java.util.*;import com.laoer.bbscs.db.*;import com.laoer.bbscs.txthtml.*;/** * <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 BBSConf { String SQL = ""; DbTrans DBSQL; DoText myDoText; ResultSet rs = null; private String leftbgcolor = ""; private String letftextcolor = ""; private String rightbgcolor = ""; private String righttextcolor = ""; private String tablemaincolor = ""; private String tabletintcolor = ""; private String tabledarkcolor = ""; private String left_a = ""; private String left_alink = ""; private String left_avisited = ""; private String left_ahover = ""; private String left_aactive = ""; private String right_a = ""; private String right_alink = ""; private String right_avisited = ""; private String right_ahover = ""; private String right_aactive = ""; private int confStyle = 0; private int upimg = 0; private String strWebSite = ""; private String strWebURL = ""; public BBSConf() { this.DBSQL = new DbTrans(); this.myDoText = new DoText(); SQL = "select * from bbsconf where ID = 1"; try { rs = DBSQL.executeQuery(SQL); if (rs.next()) { this.confStyle = rs.getInt("pagestyle"); this.upimg = rs.getInt("upimg"); this.leftbgcolor = rs.getString("leftbgcolor"); this.letftextcolor = rs.getString("letftextcolor"); this.rightbgcolor = rs.getString("rightbgcolor"); this.righttextcolor = rs.getString("righttextcolor"); this.tablemaincolor = rs.getString("tablemaincolor"); this.tabletintcolor = rs.getString("tabletintcolor"); this.tabledarkcolor = rs.getString("tabledarkcolor"); this.left_a = rs.getString("left_a"); this.left_alink = rs.getString("left_alink"); this.left_avisited = rs.getString("left_avisited"); this.left_ahover = rs.getString("left_ahover"); this.left_aactive = rs.getString("left_aactive"); this.right_a = rs.getString("right_a"); this.right_alink = rs.getString("right_alink"); this.right_avisited = rs.getString("right_avisited"); this.right_ahover = rs.getString("right_ahover"); this.right_aactive = rs.getString("right_aactive"); this.strWebSite = rs.getString("website"); this.strWebURL = rs.getString("webURL"); } rs.close(); } catch (SQLException e){ } } public String getleftbgcolor() { return this.leftbgcolor; } public String getletftextcolor() { return this.letftextcolor; } public String getrightbgcolor() { return this.rightbgcolor; } public String getrighttextcolor() { return this.righttextcolor; } public String gettablemaincolor() { if (getConfStyle()==1) { return "#355397"; } else { return this.tablemaincolor; } } public String gettabletintcolor() { if (getConfStyle()==1) { return "#EEF3F9"; } else { return this.tabletintcolor; } } public String gettabledarkcolor() { if (getConfStyle()==1) { return "#E1EAF4"; } else { return this.tabledarkcolor; } } public String getleft_a() { return this.left_a; } public String getleft_alink() { return this.left_alink; } public String getleft_avisited() { return this.left_avisited; } public String getleft_ahover() { return this.left_ahover; } public String getleft_aactive() { return this.left_aactive; } public String getright_a() { return this.right_a; } public String getright_alink() { return this.right_alink; } public String getright_avisited() { return this.right_avisited; } public String getright_ahover() { return this.right_ahover; } public String getright_aactive() { return this.right_aactive; } public String getWebSite() { return this.strWebSite; } public String getWebURL() { return this.strWebURL; } /** * 修改风格样式 * @param leftbgcolor 左侧帧底色 * @param letftextcolor 左侧帧字色 * @param rightbgcolor 右侧帧底色 * @param righttextcolor 右侧帧字色 * @param tablemaincolor 表格主色 * @param tabletintcolor 表格浅色 * @param tabledarkcolor 表格深色 * @param left_a 左侧帧样式表 * @param left_alink 左侧帧样式表 * @param left_avisited 左侧帧样式表 * @param left_ahover 左侧帧样式表 * @param left_aactive 左侧帧样式表 * @param right_a 右侧帧样式表 * @param right_alink 右侧帧样式表 * @param right_avisited 右侧帧样式表 * @param right_ahover 右侧帧样式表 * @param right_aactive 右侧帧样式表 * @return 布尔逻辑值 修改成功返回真,否则返回假 */ public boolean setUpdateStyle(String leftbgcolor, String letftextcolor, String rightbgcolor, String righttextcolor, String tablemaincolor, String tabletintcolor, String tabledarkcolor, String left_a,String left_alink, String left_avisited, String left_ahover, String left_aactive, String right_a, String right_alink, String right_avisited, String right_ahover, String right_aactive) { boolean isUpdate = false; SQL = "update bbsconf set leftbgcolor = '"+ leftbgcolor +"',letftextcolor = '"+ letftextcolor +"',rightbgcolor = '"+ rightbgcolor +"',righttextcolor = '"+ righttextcolor +"',tablemaincolor = '"+ tablemaincolor +"',tabletintcolor = '"+ tabletintcolor +"',tabledarkcolor = '"+ tabledarkcolor +"',left_a = '"+ left_a +"',left_alink = '"+ left_alink +"',left_avisited = '"+ left_avisited +"',left_ahover = '"+ left_ahover +"',left_aactive = '"+ left_aactive +"',right_a = '"+ right_a +"',right_alink = '"+ right_alink +"',right_avisited = '"+ right_avisited +"',right_ahover = '"+ right_ahover +"',right_aactive = '"+ right_aactive +"' where ID = 1"; try { DBSQL.executeQuery(SQL); isUpdate = true; } catch (SQLException e){ isUpdate = false; } return isUpdate; } /** public int getConfStyle() { int confStyle = 1; SQL = "select pagestyle from bbsconf where ID = 1"; try { rs = DBSQL.executeQuery(SQL); if (rs.next()) { this.confStyle = rs.getInt("pagestyle"); } rs.close(); } catch (SQLException e){ } return this.confStyle; } */ /** * 取得页面风格属性 * @return int型页面风格属性值 */ public int getConfStyle() { return this.confStyle; } public int getUpImg() { return this.upimg; } /** * 取得上传图片属性 * @return int型图像上传属性 */ public int getConfUpImg() { int confUpImg = 2; SQL = "select upimg from bbsconf where ID = 1"; try { rs = DBSQL.executeQuery(SQL); if (rs.next()) { confUpImg = rs.getInt("upimg"); } rs.close(); } catch (SQLException e){ } return confUpImg; } public String getLeftCSS() { String leftCSS = ""; if (getConfStyle() == 1) { leftCSS += "<style>\n<!--\n"; leftCSS += "a { color: #FFFFFF; text-decoration: none }\n"; leftCSS += "a:link { text-decoration: none; color: #FFFFFF; font-family: 宋体 }\n"; leftCSS += "a:visited { text-decoration: none; color: #FFFFFF; font-family: 宋体 }\n"; leftCSS += "a:hover { text-decoration: underline; color: #CCCCCC }\n"; leftCSS += "a:active { text-decoration: underline; color: #CCCCCC }\n"; leftCSS += "body { font-size: 9pt }\n"; leftCSS += "table { font-size: 9pt }\n"; leftCSS += ".bt { font-family: 宋体; font-size: 14px }\n"; leftCSS += "-->\n</style>\n"; } else { leftCSS += "<style>\n<!--\n"; leftCSS += "a {"+myDoText.iso2gb(this.left_a) + "}\n"; leftCSS += "a:link {"+myDoText.iso2gb(this.left_alink) + "}\n"; leftCSS += "a:visited {"+myDoText.iso2gb(this.left_avisited) + "}\n"; leftCSS += "a:hover {"+myDoText.iso2gb(this.left_ahover) + "}\n"; leftCSS += "a:active {"+myDoText.iso2gb(this.left_aactive) + "}\n"; leftCSS += "body { font-size: 9pt }\n"; leftCSS += "table { font-size: 9pt }\n"; leftCSS += ".bt { font-family: 宋体; font-size: 14px }\n"; leftCSS += "-->\n</style>\n"; } return leftCSS; } public String getLeftBGTextColor() { String leftBGTextColor = ""; if (getConfStyle() == 1) { leftBGTextColor = "bgcolor=\"#336699\" text=\"#FFFFFF\""; } else { leftBGTextColor = "bgcolor=\""+this.leftbgcolor+"\" text=\""+ this.letftextcolor +"\""; } return leftBGTextColor; } public String getRightCSS1() { String rightCSS = ""; if (getConfStyle() == 1) { rightCSS += "<style>\n<!--\n"; rightCSS += "a { color: #0000FF; text-decoration: none }\n"; rightCSS += "a:link { text-decoration: none; color: #0000FF; font-family: 宋体 }\n"; rightCSS += "a:visited { text-decoration: none; color: #0000FF; font-family: 宋体 }\n"; rightCSS += "a:hover { text-decoration: underline; color: #FF0000 }\n"; rightCSS += "a:active { text-decoration: underline; color: #FF0000 }\n"; rightCSS += "body { font-size: 9pt }\n"; rightCSS += "table { font-size: 9pt }\n"; rightCSS += ".bt { font-family: 宋体; font-size: 14px }\n"; rightCSS += "-->\n</style>\n"; } else { rightCSS += "<style>\n<!--\n"; rightCSS += "a {"+myDoText.iso2gb(this.right_a) + "}\n"; rightCSS += "a:link {"+myDoText.iso2gb(this.right_alink) + "}\n"; rightCSS += "a:visited {"+myDoText.iso2gb(this.right_avisited) + "}\n"; rightCSS += "a:hover {"+myDoText.iso2gb(this.right_ahover) + "}\n"; rightCSS += "a:active {"+myDoText.iso2gb(this.right_aactive) + "}\n"; rightCSS += "body { font-size: 9pt }\n"; rightCSS += "table { font-size: 9pt }\n"; rightCSS += ".bt { font-family: 宋体; font-size: 14px }\n"; rightCSS += "-->\n</style>\n"; } return rightCSS; } public String getRightCSS2() { String rightCSS = ""; if (getConfStyle() == 1) { rightCSS += "<style>\n<!--\n"; rightCSS += "a { color: #0000FF; text-decoration: none }\n"; rightCSS += "a:link { text-decoration: none; color: #0000FF; font-family: 宋体 }\n"; rightCSS += "a:visited { text-decoration: none; color: #0000FF; font-family: 宋体 }\n"; rightCSS += "a:hover { text-decoration: underline; color: #FF0000 }\n"; rightCSS += "a:active { text-decoration: underline; color: #FF0000 }\n"; rightCSS += "body { font-size: 14px }\n"; rightCSS += "table { font-size: 14px }\n"; rightCSS += ".bt { font-family: 宋体; font-size: 9pt }\n"; rightCSS += "-->\n</style>\n"; } else { rightCSS += "<style>\n<!--\n"; rightCSS += "a {"+myDoText.iso2gb(this.right_a) + "}\n"; rightCSS += "a:link {"+myDoText.iso2gb(this.right_alink) + "}\n"; rightCSS += "a:visited {"+myDoText.iso2gb(this.right_avisited) + "}\n"; rightCSS += "a:hover {"+myDoText.iso2gb(this.right_ahover) + "}\n"; rightCSS += "a:active {"+myDoText.iso2gb(this.right_aactive) + "}\n"; rightCSS += "body { font-size: 14px }\n"; rightCSS += "table { font-size: 14px }\n"; rightCSS += ".bt { font-family: 宋体; font-size: 9pt }\n"; rightCSS += "-->\n</style>\n"; } return rightCSS; } public String getRightBGTextColor() { String RightBGTextColor = ""; if (getConfStyle() == 1) { RightBGTextColor = "bgcolor=\"#FFFFFF\" text=\"#000000\""; } else { RightBGTextColor = "bgcolor=\""+this.rightbgcolor+"\" text=\""+ this.righttextcolor +"\""; } return RightBGTextColor; } public String getRightBGTextColor1() { String RightBGTextColor1 = ""; if (getConfStyle() == 1) { RightBGTextColor1 = "bgcolor=\"#e6f4ff\" text=\"#000000\""; } else { RightBGTextColor1 = "bgcolor=\""+this.rightbgcolor+"\" text=\""+ this.righttextcolor +"\""; } return RightBGTextColor1; } public String getConfTableMainColor() { String confTableDarkColor = ""; if (getConfStyle() == 1) { confTableDarkColor = "#70a6ff"; } else { confTableDarkColor = this.gettablemaincolor(); } return confTableDarkColor; } public String getConfTableDarkColor() { String confTableTintColor = ""; if (getConfStyle() == 1) { confTableTintColor = "#c0e0ff"; } else { confTableTintColor = this.gettabledarkcolor(); } return confTableTintColor; } public void close() { try { DBSQL.close(); } catch (SQLException e){ } }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -