亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? forum.java

?? 這是用JAVA做的論壇系統(tǒng) 老師給的 讓我們參考
?? JAVA
?? 第 1 頁 / 共 3 頁
字號:


			dbc.executeUpdate();
			dbc.close();
			return "dispbbs.jsp?forumID="+forumID+"&rootID="+rootID+"&announceID="+announceID+"#"+announceID;
  		}
  		catch(UserNotFoundException e){
  			throw new Exception("沒有發(fā)現(xiàn)用戶");
  		}
  		catch(Exception e){
  			e.printStackTrace();
  			throw new Exception("<Br>"+"<li>"+e.getMessage());
		}
	}
	public String masterSaveMSG(HttpServletRequest request,HttpServletResponse response) throws Exception{

		String userName=GCookie.getCookieValue(request,"UJBBUName","");

		//String userPassword=ParamUtil.getString(request,"userPassword","");
		String sql="";
		String char_changed = "[align=right][此貼子已經(jīng)被"+userName+"于"+Format.getDateTime()+"編輯過][/align]";
        	try{

        		User tempUser=SkinUtil.checkUser(request,response,4);
				DBConnect dbc=new DBConnect();
				ResultSet rs;
        		int forumID=ParamUtil.getInt(request,"forumID");
				int announceID=ParamUtil.getInt(request,"announceID");
				int rootID=ParamUtil.getInt(request,"rootID");

        		String subject=ParamUtil.getString(request,"subject","");
        		String content=ParamUtil.getString(request,"content","")+"\n\n\n\n"+char_changed;
        		String expression=ParamUtil.getString(request,"expression","");
        		int signFlag=ParamUtil.getInt(request,"signFlag",1);
        		int emailFlag=ParamUtil.getInt(request,"emailFlag",0);
        		if(subject.equals("")) throw new Exception("沒有主體文字");

			sql="update bbs.bbs1 set Topic=?,Body=?,DateAndTime=getdate(),length=?,ip=?,expression=?,signflag=?,emailflag=? where announceID=?";
			dbc.prepareStatement(sql);
			dbc.setBytes(1,(new String(subject.getBytes("ISO-8859-1"),"GBK")).getBytes());
			dbc.setBytes(2,(new String(content.getBytes("ISO-8859-1"),"GBK")).getBytes());
			dbc.setInt(3,content.length());
			dbc.setString(4,request.getRemoteAddr());
			dbc.setString(5,expression);
			dbc.setInt(6,signFlag);
			dbc.setInt(7,emailFlag);
			dbc.setInt(8,announceID);


			dbc.executeUpdate();
			dbc.close();
			return "dispbbs.jsp?forumID="+forumID+"&rootID="+rootID+"&announceID="+announceID+"#"+announceID;
  		}
  		catch(UserNotFoundException e){
  			throw new Exception("沒有發(fā)現(xiàn)用戶");
  		}
  		catch(Exception e){
  			e.printStackTrace();
  			throw new Exception("<Br>"+"<li>"+e.getMessage());
		}
	}
	public String addTopic(HttpServletRequest request,HttpServletResponse response) throws Exception{

		String userName=ParamUtil.getString(request,"userName","");
		String userPassword=ParamUtil.getString(request,"userPassword","");
		String sql="";

        	try{

        		//SkinUtil.userLogin(request,response,2);
        		User tempUser=new User(userName,userPassword,2);
				DBConnect dbc=new DBConnect();
        		int forumID=ParamUtil.getInt(request,"forumID",1);
        		String subject=ParamUtil.getString(request,"subject","");
        		String content=ParamUtil.getString(request,"content","");
        		String expression=ParamUtil.getString(request,"expression","");
				int isVote=ParamUtil.getInt(request,"isVote",0);
        		int signFlag=ParamUtil.getInt(request,"signFlag",1);
        		int emailFlag=ParamUtil.getInt(request,"emailFlag",0);
        		if(subject.equals("")) throw new Exception("沒有主體文字");

			sql="insert into bbs.bbs1(Boardid,ParentID,Child,username,topic,body,DateAndTime,hits,length,rootid,layer,orders,ip,Expression,locktopic,signflag,emailflag,istop,isbest,isvote,times) values "+
				"("+
				forumID+",0,0,?,?,?,'"+
				Format.getDateTime()+"',0,"+
				content.length()+",0,1,0,'"+request.getRemoteAddr()+"','"+
				expression+".gif',0,"+signFlag+","+emailFlag+",0,0,"+isVote+",0)";

			dbc.prepareStatement(sql);
			dbc.setBytes(1,(new String(userName.getBytes("ISO-8859-1"),"GBK")).getBytes());
			dbc.setBytes(2,(new String(subject.getBytes("ISO-8859-1"),"GBK")).getBytes());
			dbc.setBytes(3,(new String(content.getBytes("ISO-8859-1"),"GBK")).getBytes());
			dbc.executeUpdate();
			ResultSet rs=dbc.executeQuery("select announceid from bbs.bbs1 order by announceid desc");
	        	rs.next();
	        	int announceID=rs.getInt(1);
				voteID=announceID;
			sql="update bbs.bbs1 set rootid="+announceID+",times="+announceID+" where announceid="+announceID;
			dbc.executeUpdate(sql);
			String shortTopic="";
			if ("".equals(subject))
				if(content.length()>21)
					shortTopic=content.substring(0,20);
				else
					shortTopic=content;
			else
				if(subject.length()>21)
					shortTopic=subject.substring(0,20);
				else
					shortTopic=subject;
			ResultSet tmprs=dbc.executeQuery("Select count(announceid) from bbs.bbs1 Where day(dateandtime)-day(getdate())=0 and boardid="+forumID);
	    		tmprs.next();
	    		int forumToday=tmprs.getInt(1);
	    		tmprs=null;
			sql="update bbs.board set lastpostuser=?,lastposttime='"+Format.getDateTime()+"',lastbbsnum=lastbbsnum+1,lasttopicnum=lasttopicnum+1,todaynum="+forumToday+",lastrootid="+announceID+",lasttopic=? where  boardid="+forumID;
			dbc.clearParameters();
			dbc.prepareStatement(sql);
			dbc.setBytes(1,(new String(userName.getBytes("ISO-8859-1"),"GBK")).getBytes());
			dbc.setBytes(2,(new String(shortTopic.getBytes("ISO-8859-1"),"GBK")).getBytes());
			dbc.executeUpdate();
			tmprs=dbc.executeQuery("Select count(announceid) from bbs.bbs1 Where day(dateandtime)-day(getdate())=0");
	    		tmprs.next();
	    		int allTodays=tmprs.getInt(1);
			dbc.executeUpdate("update bbs.config set topicnum=topicnum+1,bbsnum=bbsnum+1,todayNum="+allTodays);
			dbc.close();
			ForumPropertiesManager.resetManager();
			return "dispbbs.jsp?forumID="+forumID+"&rootID="+announceID+"&announceID="+announceID;
  		}
  		catch(UserNotFoundException e){
  			throw new Exception("沒有發(fā)現(xiàn)用戶");
  		}
  		catch(Exception e){
  			e.printStackTrace();
  			throw new Exception("<Br>"+"<li>數(shù)據(jù)庫操作失敗,請以后再試");
		}
	}
	public String addMSG(HttpServletRequest request,HttpServletResponse response)throws UserNotFoundException ,Exception{
		//try{
			String userName=ParamUtil.getString(request,"userName","");
			String userPassword=ParamUtil.getString(request,"userPassword","");
			//SkinUtil.userLogin(request,response,3);
			User tempUser=new User(userName,userPassword,3);
        		DBConnect dbc=new DBConnect();
        		int forumID=this.forumID;
        		String subject=ParamUtil.getString(request,"subject","");
        		String content=ParamUtil.getString(request,"content","");
        		String expression=ParamUtil.getString(request,"expression","face7.gif");
				String sql="";
				int rootID=ParamUtil.getInt(request,"rootID");
				ResultSet rs;
				dbc.prepareStatement("select locktopic from bbs.bbs1 where announceid="+rootID);
				rs=dbc.executeQuery();
				if(!rs.next()){
					dbc.close();
					throw new Exception("<li>對不起,沒有發(fā)現(xiàn)此主題!</li>");
				}
				else{
					//rs.next();
					if(rs.getInt(1)==1||rs.getInt(1)==2){
						dbc.close();
						throw new Exception("對不起,此帖子已經(jīng)鎖定,您不能回復!");
					}
				}

				int iLayer,iOrders;
        		int signFlag=ParamUtil.getInt(request,"signFlag",1);
        		int emailFlag=ParamUtil.getInt(request,"emailFlag",0);

				int parentID=ParamUtil.getInt(request,"parentID",rootID);
				sql="select layer,orders from bbs.bbs1 where announceid="+parentID;
				rs=dbc.executeQuery(sql);
				if(rs.next()){
					if(rs.getString(1)!=null)
						iLayer=0;
					else
						iLayer=rs.getInt(1);
					if(rs.getString(2)!=null)
						iOrders=0;
					else
						iOrders=rs.getInt(2);
				}
				else{
					iLayer=0;
					iOrders=0;
				}
				rs.close();
				if (rootID!=0){
					iLayer=iLayer+1;
					dbc.executeUpdate("update bbs.bbs1 set orders=orders+1 where rootid="+rootID+" and orders>"+iOrders);
					iOrders=iOrders+1;
		     	}
        		sql="insert into bbs.bbs1(Boardid,ParentID,Child,username,topic,body,DateAndTime,hits,length,rootid,layer,orders,ip,Expression,locktopic,signflag,emailflag,istop,isbest,isvote,times) values "+
				"("+
				forumID+","+parentID+",0,"+
				"?,?,?,'"+
				Format.getDateTime()+"',0,"+
				content.length()+","+rootID+","+iLayer+","+iOrders+",'"+request.getRemoteAddr()+"','"+
				expression+"',0,"+signFlag+","+emailFlag+",0,0,0,0)";
			dbc.prepareStatement(sql);
			dbc.setBytes(1,(new String(userName.getBytes("ISO-8859-1"),"GBK")).getBytes());
			dbc.setBytes(2,(new String(subject.getBytes("ISO-8859-1"),"GBK")).getBytes());
			dbc.setBytes(3,(new String(content.getBytes("ISO-8859-1"),"GBK")).getBytes());
			dbc.executeUpdate();
			rs=dbc.executeQuery("select announceid from bbs.bbs1 order by announceid desc");
        	rs.next();
        	int announceID=rs.getInt(1);
			sql="update bbs.bbs1 set child=child+1,times="+announceID+" where rootID="+rootID;
          		dbc.executeUpdate(sql);
          	String shortTopic="";

           if ("".equals(subject))
				if(content.length()>21)
					shortTopic=content.substring(0,20);
				else
					shortTopic=content;
			else
				if(subject.length()>21)
					shortTopic=subject.substring(0,20);
				else
					shortTopic=subject;
			ResultSet tmprs=dbc.executeQuery("Select count(announceid) from bbs.bbs1 Where day(dateandtime)-day(getdate())=0 and boardid="+forumID);
	    		tmprs.next();
	    		int forumToday=tmprs.getInt(1);
	    		tmprs=null;

			sql="update bbs.board set lastpostuser=?,lastposttime='"+Format.getDateTime()+"',lastbbsnum=lastbbsnum+1,todaynum="+forumToday+",lastrootid="+rootID+",lasttopic=? where  boardid="+forumID;
			dbc.clearParameters();
			dbc.prepareStatement(sql);
			dbc.setBytes(1,(new String(userName.getBytes("ISO-8859-1"),"GBK")).getBytes());
			dbc.setBytes(2,(new String(shortTopic.getBytes("ISO-8859-1"),"GBK")).getBytes());
			dbc.executeUpdate();
			tmprs=dbc.executeQuery("Select count(announceid) from bbs.bbs1 Where day(dateandtime)-day(getdate())=0");
	    		tmprs.next();
	    		int allTodays=tmprs.getInt(1);
			dbc.executeUpdate("update bbs.config set bbsnum=bbsnum+1,todayNum="+allTodays);
			dbc.close();
			ForumPropertiesManager.resetManager();
			return "dispbbs.jsp?forumID="+forumID+"&rootID="+rootID+"&announceID="+announceID+"#"+announceID;


	}
	public String addVote(HttpServletRequest request,HttpServletResponse response) throws Exception{
		try{

			String vote=ParamUtil.getString(request,"vote");
			String userName=ParamUtil.getString(request,"userName","");
			if(vote==null)		throw new Exception("<li>請您輸入選舉內(nèi)容</li>");
			String voteNum="";

		String reg="(\r|\n)";
		String [] tempString=vote.split(reg);


		for(int i=0;i<tempString.length;i++)

			if(!tempString[i].trim().equals(""))
				if(i==tempString.length-1)
					voteNum+="0";
				else
					voteNum+="0|";








			int voteType=ParamUtil.getInt(request,"voteType",0);

			String url=this.addTopic(request,response);
			DBConnect dbc=new DBConnect("insert into bbs.vote(announceID,vote,voteNum,voteType,voteUser) values(?,?,?,?,?)");
			dbc.setInt(1,voteID);
			dbc.setBytes(2,(new String(vote.getBytes("ISO-8859-1"),"GBK")).getBytes());
			dbc.setString(3,voteNum);
			dbc.setInt(4,voteType);
			dbc.setBytes(5,(new String(userName.getBytes("ISO-8859-1"),"GBK")).getBytes());
			dbc.executeUpdate();
			dbc.close();
			return url;
		}
		catch(Exception e){
			e.printStackTrace();
			throw new Exception(e.getMessage());
		}

	}
	public ForumVote getForumVote(int announceID) throws Exception{
		DBConnect dbc=new DBConnect("select * from bbs.vote where announceID=?");
		dbc.setInt(1,announceID);
		ResultSet rs=dbc.executeQuery();
		if(rs.next()){
		ForumVote forumVote=new ForumVote();
		forumVote.setVoteID(rs.getInt(1));
		forumVote.setAnnounceID(rs.getInt(2));
		forumVote.setVote(rs.getString(3));
		forumVote.setVoteNum(rs.getString(4));
		forumVote.setVoteUser(rs.getString(5));
		forumVote.setVoteType(rs.getInt(6));
		return forumVote;
		}
		else
			throw new Exception("<li>錯誤,對不起,沒有發(fā)現(xiàn)投票!</li>");
	}
	public String addVoteNum(HttpServletRequest request,HttpServletResponse response) throws Exception {
		String userName=GCookie.getCookieValue(request,"UJBBUName","");
		String userPassword=GCookie.getCookieValue(request,"UJBBUPSW","");
		User tempUser=new User(userName,userPassword,1);
		int announceID=ParamUtil.getInt(request,"announceID");
		int forumID=ParamUtil.getInt(request,"forumID");
		ForumVote theVote=this.getForumVote(announceID);
		String voteNum="";
		int [] voteNumS=theVote.getVoteNumS();
		if(theVote.getUserSign(userName))
			throw new Exception("<li>對不起,您已經(jīng)投票了!</li>");
		else{
			if(theVote.getVoteType()==0){
				int postID=ParamUtil.getInt(request,"postVote");
				voteNumS[postID]++;
			}
			else{
				for(int i=0;i<voteNumS.length;i++){
					if(ParamUtil.getString(request,"postVote_"+(i))!=null)
						voteNumS[i]++;
					}
			}

			for(int i=0;i<voteNumS.length;i++)
				if(i==voteNumS.length-1)
					voteNum+=Integer.toString(voteNumS[i]);
				else
					voteNum+=Integer.toString(voteNumS[i])+"|";

		}
		DBConnect dbc=new DBConnect("select * from bbs.vote where announceID="+announceID);
		ResultSet rs=dbc.executeQuery();
		rs.next();
		String voteUser=rs.getString(5);
		voteUser+="|"+userName;
		dbc.prepareStatement("update bbs.vote set voteNum='"+voteNum+"',voteUser=? where announceID="+announceID);
		dbc.setBytes(1,(new String(voteUser.getBytes("ISO-8859-1"),"GBK")).getBytes());
		dbc.executeUpdate();

		return "dispbbs.jsp?forumID="+forumID+"&rootID="+announceID+"&announceID="+announceID;



	}
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美三区免费完整视频在线观看| 国产精品538一区二区在线| 99久久精品免费看国产 | 午夜精品久久久久久久 | 不卡的av在线播放| 中文字幕在线观看不卡| 99久久亚洲一区二区三区青草| 国产精品你懂的在线欣赏| 色综合 综合色| 天堂蜜桃91精品| 久久日一线二线三线suv| 国产1区2区3区精品美女| 亚洲免费观看高清在线观看| 欧美日韩亚洲高清一区二区| 极品美女销魂一区二区三区免费| 国产精品毛片大码女人| 欧美日韩精品高清| 精品亚洲国内自在自线福利| 中文字幕亚洲综合久久菠萝蜜| 欧美午夜精品一区二区三区| 麻豆成人久久精品二区三区小说| 国产精品视频一区二区三区不卡| 在线观看日韩国产| 国产毛片一区二区| 亚洲午夜成aⅴ人片| 欧美大片国产精品| 色综合色综合色综合| 九色porny丨国产精品| 亚洲激情av在线| 久久理论电影网| 欧美日韩高清不卡| 99久久国产综合色|国产精品| 日韩av电影免费观看高清完整版 | 亚洲日韩欧美一区二区在线| 日韩一区二区免费高清| 成人动漫一区二区三区| 青青国产91久久久久久| 亚洲狼人国产精品| 久久亚洲一区二区三区明星换脸| 91黄色免费观看| 国产精品99久久久久久似苏梦涵| 亚洲午夜久久久久久久久电影院 | 韩国三级电影一区二区| 一区二区三区欧美激情| 国产欧美va欧美不卡在线| 欧美一三区三区四区免费在线看| 91免费视频观看| 粉嫩高潮美女一区二区三区| 美女高潮久久久| 一区二区三区91| 1区2区3区精品视频| 欧美精品一区二区三区在线| 欧美探花视频资源| 91在线播放网址| 成人性生交大合| 国产在线播放一区二区三区| 免费看日韩a级影片| 亚洲成人综合视频| 夜夜夜精品看看| 亚洲欧美日韩中文字幕一区二区三区 | 欧美精品一区二区在线播放| 91麻豆精品国产自产在线| 欧美亚洲日本一区| 91日韩在线专区| 成人av在线网| 丁香另类激情小说| 国产另类ts人妖一区二区| 麻豆成人免费电影| 麻豆高清免费国产一区| 美腿丝袜亚洲一区| 美女视频黄a大片欧美| 免费看欧美美女黄的网站| 日韩二区三区四区| 蜜桃视频在线观看一区| 久久成人精品无人区| 久久精品99久久久| 国产美女在线观看一区| 高清av一区二区| www.日韩大片| 91精品福利在线| 6080亚洲精品一区二区| 欧美二区三区的天堂| 日韩一卡二卡三卡国产欧美| 欧美一区二区免费观在线| 精品少妇一区二区三区视频免付费| 日韩欧美一卡二卡| 日韩精品在线一区二区| 久久看人人爽人人| 国产精品福利一区二区| 一区二区欧美国产| 天天综合网天天综合色| 久久99精品久久只有精品| 国产成人免费在线视频| 99视频热这里只有精品免费| 欧美性色综合网| 日韩片之四级片| 国产精品拍天天在线| 亚洲制服丝袜av| 久久成人免费网站| av一区二区不卡| 欧美夫妻性生活| 久久久精品蜜桃| 一区二区三区在线看| 麻豆国产精品777777在线| 成人黄色小视频在线观看| 91激情五月电影| 亚洲精品一线二线三线无人区| 日本一区二区三区久久久久久久久不| 亚洲伦理在线免费看| 美女一区二区久久| 99精品在线免费| 日韩小视频在线观看专区| 中文子幕无线码一区tr| 亚洲va欧美va天堂v国产综合| 国产专区欧美精品| 色婷婷精品大在线视频| 精品国产不卡一区二区三区| 亚洲男人天堂av| 国产精品影视在线| 欧美日韩国产综合久久| 久久久久久一级片| 亚洲gay无套男同| 成人深夜在线观看| 日韩视频免费直播| 亚洲色图欧美偷拍| 国产精品中文字幕日韩精品 | 欧美浪妇xxxx高跟鞋交| 日本一区二区免费在线| 热久久久久久久| 色综合 综合色| 国产情人综合久久777777| 日韩av电影免费观看高清完整版| 成人av在线一区二区| 欧美xxxxx牲另类人与| 亚洲一卡二卡三卡四卡无卡久久 | 久久久噜噜噜久久中文字幕色伊伊 | 亚洲资源在线观看| 成人网男人的天堂| 26uuu精品一区二区三区四区在线| 中文字幕一区二区三区四区不卡| 久久精品国内一区二区三区| 欧美视频一区二| 国产精品白丝在线| 国产成人av影院| 久久综合色鬼综合色| 日日摸夜夜添夜夜添国产精品| 色婷婷狠狠综合| 亚洲欧洲av在线| 国产99精品国产| 久久久久国产精品厨房| 蜜桃一区二区三区在线| 欧美一区二区在线视频| 亚洲丰满少妇videoshd| 日本高清不卡视频| 亚洲视频免费观看| av资源网一区| 亚洲欧洲精品一区二区三区不卡| 国产精品亚洲一区二区三区在线| 欧美一区二区国产| 日本aⅴ免费视频一区二区三区| 欧美精品成人一区二区三区四区| 亚洲综合免费观看高清完整版在线| 91片黄在线观看| 亚洲乱码国产乱码精品精的特点 | 国产三级欧美三级| 国产一区三区三区| 久久久久国产精品人| 国产福利一区二区三区| 久久久久88色偷偷免费| 高清国产一区二区| 国产精品美女久久久久久| 99久久99久久综合| 一区二区三区四区蜜桃 | 韩国中文字幕2020精品| 337p粉嫩大胆噜噜噜噜噜91av| 久久激情五月激情| 久久在线免费观看| 成人免费视频视频在线观看免费| 中文字幕一区二区三区视频 | 7777精品久久久大香线蕉| 免费在线观看成人| 久久久亚洲精品石原莉奈| 成人晚上爱看视频| 一区二区三区电影在线播| 欧美日韩一二区| 精品亚洲porn| 中文字幕亚洲精品在线观看| 欧美亚洲国产一区在线观看网站| 日韩国产欧美在线播放| 欧美哺乳videos| 99精品欧美一区| 日韩av在线发布| 国产亚洲欧美中文| 日本电影亚洲天堂一区| 日本不卡视频在线观看| 欧美极品美女视频| 欧美撒尿777hd撒尿| 久久99国产精品久久99| 亚洲欧洲日韩女同| 欧美一区二区不卡视频|