📄 clubclassinfo.java
字号:
/* * Made in GamVan */package com.gamvan.club;import com.gamvan.conn.*;import com.gamvan.tools.*;import com.gamvan.club.ClubCounter;import java.sql.*;import java.util.*;public class ClubClassInfo{ String ccName=""; //分类或版面名称 String ccSummary = ""; //分类或版面简介 String ccUserPass = ""; //分类或版面的认证用户 int ccOrder = 0; //分类或版面的排序ID int ccIDD = 0; //分类或版面的上级ID int ccType = 0; //类型,判断是分类还是版面 0为分类 1为版面 int ccPro = 0; //分类或版面的属性 int ccHidden = 0; //是否隐藏 默认0不隐藏 int ccUpfileMax = 0; //上传附件的最大限制,单位字节 int ccUpfilePass = 0; //判断是否打开了上传 int ccStyle = 0; //论坛的风格 0 为默认风格BBS, 1 为讨论区风格 int ccUgid = 10; //浏览版面所需的等级 int ccTopicNum = 15; //主题显示条数 int ccReplyNum = 10; //回复显示数 int ccTopic = 0; //主题统计 int ccReply = 0; //回复统计 int ccTodayTopic = 0; //主题统计 int ccTodayReply = 0; //回复统计 int ccYesterTopic = 0; //主题统计 int ccYesterReply = 0; //回复统计 int ccMostOnline = 0; //最多在线人数 int ccList = 0; private Statement sta; private String sqlCommand = new String(); private String message; private boolean bea; //建立数据库联接 ConnClub bridge = new ConnClub(); public void classInfo(int ccID){ bea = false; try{ Connection con = bridge.getConnection(); sta = con.createStatement(); ResultSet rs; sqlCommand = "Select * From GVclubClass where ccID = " + ccID ; rs = sta.executeQuery(sqlCommand); if(rs.next()){ ccID = rs.getInt("ccID"); ccIDD = rs.getInt("ccIDD"); ccName = rs.getString("ccName"); ccOrder = rs.getInt("ccOrder"); ccType = rs.getInt("ccType"); ccStyle = rs.getInt("ccStyle"); ccPro = rs.getInt("ccPro"); ccHidden = rs.getInt("ccHidden"); ccUpfilePass = rs.getInt("ccUpfilePass"); ccUpfileMax = rs.getInt("ccUpfileMax"); ccUgid = rs.getInt("ccUgid"); ccTopicNum = rs.getInt("ccTopicNum"); ccReplyNum = rs.getInt("ccReplyNum"); ccMostOnline = rs.getInt("ccMostOnline"); ccSummary = rs.getString("ccSummary"); ccUserPass = rs.getString("ccUserPass"); ccTopic = rs.getInt("ccTopic"); ccReply = rs.getInt("ccReply"); ccList = rs.getInt("ccList"); ccTodayTopic = rs.getInt("ccTodayTopic"); ccTodayReply = rs.getInt("ccTodayReply"); ccYesterTopic = rs.getInt("ccYesterTopic"); ccYesterReply = rs.getInt("ccYesterReply"); bea = true; } rs.close(); sta.close(); con.close(); }catch(Exception e){ bea = false; } } public void classCounter(int ccid, int ct, int cr){ try{ java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat("yyyy-MM-dd"); String isDate = sdf.format(new java.util.Date()); ClubCounter ccu = new ClubCounter(); ccu.counterInfo(); String clubToday = ccu.getClubToday(); java.util.Date date1 = sdf.parse(clubToday); java.util.Date date0 = sdf.parse(isDate); boolean isAfter = date0.after(date1); String sqlCommand = new String(); sqlCommand = "Update GVclubClass set "; sqlCommand += "ccTopic = ccTopic + "+ ct + ""; sqlCommand += ", ccReply = ccReply +"+ cr +""; if(isAfter){ sqlCommand += ", ccYesterTopic = ccTodayTopic"; sqlCommand += ", ccYesterReply = ccTodayReply"; sqlCommand += ", ccTodayTopic = "+ ct + ""; sqlCommand += ", ccTodayReply = "+ cr +""; }else{ sqlCommand += ", ccTodayTopic = ccTodayTopic + "+ ct + ""; sqlCommand += ", ccTodayReply = ccTodayReply +"+ cr +""; } if(ccid>0){ sqlCommand += " where ccID = "+ ccid +""; } message = sqlCommand; Connection con = bridge.getConnection(); PreparedStatement pps = con.prepareStatement(sqlCommand); pps.executeUpdate(); pps.close(); con.close(); }catch(Exception e){ message = e.toString(); } } public boolean getBea(){ return this.bea; } public int getList(){ return this.ccList; } public int getIDD(){ return this.ccIDD; } public String getMessage(){ return this.message; } public String getName(){ return this.ccName; } public int getType(){ return this.ccType; } public int getOrder(){ return this.ccOrder; } public int getStyle(){ return this.ccStyle; } public int getPro(){ return this.ccPro; } public int getHidden(){ return this.ccHidden; } public int getUgid(){ return this.ccUgid; } public int getTopicNum(){ return this.ccTopicNum; } public int getReplyNum(){ return this.ccReplyNum; } public String getSummary(){ return this.ccSummary.trim(); } public String getUserPass(){ return this.ccUserPass; } public int getMostOnline(){ return this.ccMostOnline; } public int getTopic(){ return this.ccTopic; } public int getReply(){ return this.ccReply; } public int getTodayTopic(){ return this.ccTodayTopic; } public int getTodayReply(){ return this.ccTodayReply; } public int getYesterTopic(){ return this.ccYesterTopic; } public int getYesterReply(){ return this.ccYesterReply; } public int getUpfilePass(){ return this.ccUpfilePass; } public int getUpfileMax(){ return this.ccUpfileMax; }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -