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

📄 mymanageaction.java

📁 论坛软件系统亦称电子公告板(BBS)系统
💻 JAVA
📖 第 1 页 / 共 4 页
字号:
			return null;
		} else {
			if (request.getParameter("subsubmit") != null) {
				String[] delete = request.getParameterValues("delete");
				if (delete != null) {
					StringBuffer tids=new StringBuffer();
					for (String tid : delete) {
						tids.append(tid+",");
					}
					int length=tids.length();
					if (length>0) {
						tids.deleteCharAt(length-1);
						dataBaseService.runQuery("DELETE FROM jrun_subscriptions WHERE uid=" + uid+ " AND tid IN ( " + tids + " )",true);
					}
				}
				request.setAttribute("successInfo","订阅列表已经成功更新,现在将转入更新后的订阅列表。");
				request.setAttribute("requestPath","my.jsp?item=subscriptions");
				return mapping.findForward("showMessage");

			} else {
				Map<String, Integer> multi = this.multi(request, response, uid,"SELECT COUNT(*) count FROM jrun_subscriptions s, jrun_threads t WHERE s.uid = " + uid+ " AND s.tid=t.tid " + threadadd, "my.jsp?item=subscriptions" + extrafid);
				List<Map<String, String>> sublists = dataBaseService.executeQuery("SELECT t.tid, t.fid, t.subject, t.replies, t.lastpost, t.lastposter, f.name FROM jrun_subscriptions s, jrun_threads t, jrun_forums f	WHERE t.tid=s.tid AND t.displayorder>='0' AND f.fid=t.fid AND s.uid="+ uid+ " "+ threadadd+ " ORDER BY t.lastpost DESC LIMIT "+ multi.get("start_limit") + ", " + multi.get("perpage"));
				this.setAttribute(request, session, sublists, "sublists");
				return mapping.findForward("toMy");
			}
		}
	}
	public ActionForward toMyGrouppermission(ActionMapping mapping,ActionForm form, HttpServletRequest request,HttpServletResponse response) {
		String searchgroupid = request.getParameter("searchgroupid");
		short groupid = 0;
		if(searchgroupid!=null){
			groupid=(short)Common.toDigit(searchgroupid);
		}else{
			HttpSession session = request.getSession();
			groupid=(Short) session.getAttribute("jsprun_groupid");
		}
		this.setExtcredits(request);
		List<Map<String, String>> grouplists = dataBaseService.executeQuery("SELECT groupid, type, grouptitle FROM jrun_usergroups ORDER BY (creditshigher<>'0' || creditslower<>'0'), creditslower");
		StringBuffer memberGroups = new StringBuffer();
		StringBuffer systemGroups = new StringBuffer();
		StringBuffer specialGroups = new StringBuffer();
		for (Map<String, String> group : grouplists) {
			String grouptype = group.get("type");
			if ("member".equals(grouptype)) {
				memberGroups.append("<li><a href=\"my.jsp?item=grouppermission&amp;type="+grouptype+"&amp;searchgroupid="+group.get("groupid")+"\">"+group.get("grouptitle")+"</a></li>");
			} else if ("system".equals(grouptype)) {
				systemGroups.append("<li><a href=\"my.jsp?item=grouppermission&amp;type="+grouptype+"&amp;searchgroupid="+group.get("groupid")+"\">"+group.get("grouptitle")+"</a></li>");
			} else if ("special".equals(grouptype)) {
				specialGroups.append("<li><a href=\"my.jsp?item=grouppermission&amp;type="+grouptype+"&amp;searchgroupid="+group.get("groupid")+"\">"+group.get("grouptitle")+"</a></li>");
			}
		}
		request.setAttribute("memberGroups", memberGroups.toString());
		request.setAttribute("systemGroups", systemGroups.toString());
		request.setAttribute("specialGroups",specialGroups.toString());
		grouplists=null;
		List<Map<String,String>> usergroups=dataBaseService.executeQuery("SELECT * FROM jrun_usergroups u LEFT JOIN jrun_admingroups a ON u.groupid=a.admingid WHERE u.groupid='"+groupid+"'");
		if (usergroups != null&&usergroups.size()>0) {
			Map<String,String> usergroup=usergroups.get(0);
			usergroup.put("maxattachsize", String.valueOf(Integer.valueOf(usergroup.get("maxattachsize"))/1000));
			usergroup.put("maxsizeperday", String.valueOf(Integer.valueOf(usergroup.get("maxsizeperday"))/1000));
			request.setAttribute("usergroup", usergroup);
			request.setAttribute("type",request.getParameter("type"));
			return mapping.findForward("toMy");
		} else {
			request.setAttribute("errorInfo", "对不起,没有这个用户组,请返回。");
			return mapping.findForward("showMessage");
		}
	}
	public ActionForward toMyPolls(ActionMapping mapping, ActionForm form,HttpServletRequest request, HttpServletResponse response) {
		HttpSession session = request.getSession();
		int uid = (Integer) session.getAttribute("jsprun_uid");
		this.setExtcredits(request);
		int srchfid = Common.toDigit(request.getParameter("srchfid"),10000000000L, 0L).intValue();
		String threadadd = null;
		String extrafid = null;
		if (srchfid > 0) {
			threadadd = "AND t.fid='" + srchfid + "'";
			extrafid = "&amp;srchfid=" + srchfid;
			request.setAttribute("extrafid", extrafid);
		}else{
			threadadd = "";
			extrafid = "";
		}
		String type = request.getParameter("type");
		if ("poll".equals(type)) {
			Map<String, Integer> multi = this.multi(request, response, uid,"SELECT COUNT(*) count FROM jrun_mythreads m,  jrun_threads t WHERE m.uid="+ uid + " AND m.special='1' " + threadadd+ " AND m.tid=t.tid", "my.jsp?item=polls&type=poll" + extrafid);
			List<Map<String, String>> polllists = dataBaseService.executeQuery("SELECT t.tid, t.subject, t.fid, t.displayorder, t.closed, t.lastposter, t.lastpost, f.name	FROM jrun_threads t, jrun_mythreads m ,jrun_forums f WHERE m.uid="+ uid+ " AND m.tid=t.tid AND t.fid=f.fid AND m.special='1' "+ threadadd+ " ORDER BY m.dateline DESC LIMIT "+ multi.get("start_limit") + ", " + multi.get("perpage"));
			this.setAttribute(request, session, polllists, "polllists");
		} else if ("join".equals(type)) {
			Map<String, Integer> multi = this.multi(request, response, uid,"SELECT COUNT(*) count FROM jrun_myposts m, jrun_threads t	WHERE m.uid=" + uid+ " AND m.special='1' " + threadadd + " AND m.tid=t.tid", "my.jsp?item=polls&type=join" + extrafid);
			List<Map<String, String>> polllists = dataBaseService.executeQuery("SELECT m.dateline, t.tid, t.fid, t.subject, t.displayorder, t.closed, f.name FROM jrun_myposts m, jrun_threads t ,jrun_forums f WHERE m.uid="+ uid+ " AND m.tid=t.tid AND t.fid=f.fid AND m.special='1' "+ threadadd+ " ORDER BY m.dateline DESC LIMIT "+ multi.get("start_limit") + ", " + multi.get("perpage"));
			if(polllists!=null&&polllists.size()>0){
				int timeoffset=(int)((Float)session.getAttribute("timeoffset")*3600);
				String timeformat=(String)session.getAttribute("timeformat");
				String dateformat=(String)session.getAttribute("dateformat");
				SimpleDateFormat sdf_all=new SimpleDateFormat(dateformat+" "+timeformat);
				for (Map<String, String> thread : polllists) {
					thread.put("dateline", Common.gmdate(sdf_all, Integer.valueOf(thread.get("dateline"))+timeoffset));
				}
				request.setAttribute("polllists", polllists);
			}
		}
		return mapping.findForward("toMy");
	}
	@SuppressWarnings({ "unchecked", "static-access" })
	public ActionForward toMyPromotion(ActionMapping mapping, ActionForm form,HttpServletRequest request, HttpServletResponse response) {
		this.setExtcredits(request);
		int srchfid = Common.toDigit(request.getParameter("srchfid"),10000000000L, 0L).intValue();
		String extrafid = null;
		if (srchfid > 0) {
			extrafid = "&amp;srchfid=" + srchfid;
			request.setAttribute("extrafid", extrafid);
		}else{
			extrafid = "";
		}
		Map<String, String> settings = (Map<String, String>) request.getAttribute("settings");
		request.setAttribute("creditspolicy", dataParse.characterParse(settings.get("creditspolicy"),false));
		settings=null;
		return mapping.findForward("toMy");
	}


	public ActionForward toMyActivities(ActionMapping mapping, ActionForm form,HttpServletRequest request, HttpServletResponse response) {
		HttpSession session = request.getSession();
		int uid = (Integer) session.getAttribute("jsprun_uid");
		this.setExtcredits(request);
		int srchfid = Common.toDigit(request.getParameter("srchfid"),10000000000L, 0L).intValue();
		String threadadd = null;
		String extrafid =null;
		if (srchfid > 0) {
			threadadd = "AND t.fid='" + srchfid + "'";
			extrafid = "&amp;srchfid=" + srchfid;
			request.setAttribute("extrafid", extrafid);
		}else{
			threadadd = "";
			extrafid = "";
		}
		String type = request.getParameter("type");
		String ended = request.getParameter("ended");
		ended = ended != null && (ended.equals("yes") || ended.equals("no")) ? ended: "";
		String sign = null;
		String ascadd = null;
		int timestamp = (Integer)(request.getAttribute("timestamp"));
		if ("yes".equals(ended)) {
			sign = " AND starttimefrom<'" + timestamp + "'";
			ascadd = "DESC";
		} else if ("no".equals(ended)) {
			sign = " AND starttimefrom>='" + timestamp + "'";
			ascadd="";
		}else{
			sign="";
			ascadd="";
		}
		if ("orig".equals(type)) {
			Map<String, Integer> multi = this.multi(request, response, uid,"SELECT COUNT(*) count FROM jrun_activities a LEFT JOIN jrun_threads t USING(tid) WHERE a.uid=" + uid+ " AND t.special='4' " + threadadd + sign, "my.jsp?item=activities&type=orig&ended=" + ended+ extrafid);
			List<Map<String, String>> activitylists = dataBaseService.executeQuery("SELECT a.tid,a.cost,a.starttimefrom,a.place,a.expiration,t.subject,t.displayorder FROM jrun_activities a LEFT JOIN jrun_threads t USING(tid) WHERE a.uid=" + uid+ " AND t.special='4' " + threadadd + sign+ " ORDER BY starttimefrom " + ascadd + " LIMIT "+ multi.get("start_limit") + ", " + multi.get("perpage"));
			if(activitylists!=null&&activitylists.size()>0){
				int timeoffset=(int)((Float)session.getAttribute("timeoffset")*3600);
				String timeformat=(String)session.getAttribute("timeformat");
				String dateformat=(String)session.getAttribute("dateformat");
				SimpleDateFormat sdf_all=new SimpleDateFormat(dateformat+" "+timeformat);
				for (Map<String, String> thread : activitylists) {
					thread.put("starttimefrom", Common.gmdate(sdf_all, Integer.valueOf(thread.get("starttimefrom"))+timeoffset));
				}
				request.setAttribute("activitylists", activitylists);
			}
		} else if ("apply".equals(type)) {
			Map<String, Integer> multi = this.multi(request, response, uid,"SELECT COUNT(*) count FROM jrun_activityapplies aa LEFT JOIN jrun_activities a USING(tid) LEFT JOIN jrun_threads t USING(tid) WHERE aa.uid=" + uid + " "+ threadadd + sign, "my.jsp?item=activities&type=apply&ended=" + ended+ extrafid);
			List<Map<String, String>> activitylists = dataBaseService.executeQuery("SELECT aa.verified, aa.tid, starttimefrom, a.place, a.cost, t.subject,t.displayorder FROM jrun_activityapplies aa LEFT JOIN jrun_activities a USING(tid) LEFT JOIN jrun_threads t USING(tid) WHERE aa.uid="+ uid+ " "+ threadadd+ sign+ " ORDER BY starttimefrom "+ ascadd+ " LIMIT "+ multi.get("start_limit")+ ", "+ multi.get("perpage"));
			if(activitylists!=null&&activitylists.size()>0){
				int timeoffset=(int)((Float)session.getAttribute("timeoffset")*3600);
				String timeformat=(String)session.getAttribute("timeformat");
				String dateformat=(String)session.getAttribute("dateformat");
				SimpleDateFormat sdf_all=new SimpleDateFormat(dateformat+" "+timeformat);
				for (Map<String, String> thread : activitylists) {
					thread.put("starttimefrom", Common.gmdate(sdf_all, Integer.valueOf(thread.get("starttimefrom"))+timeoffset));
				}
				request.setAttribute("activitylists", activitylists);
			}
		} else {
			request.setAttribute("errorInfo", "未定义操作,请返回。");
			return mapping.findForward("showMessage");
		}
		request.setAttribute("ended", ended);
		request.setAttribute("timestamp", timestamp);
		return mapping.findForward("toMy");
	}

	public ActionForward toMyTradestats(ActionMapping mapping, ActionForm form,HttpServletRequest request, HttpServletResponse response) {
		HttpSession session = request.getSession();
		int uid = (Integer) session.getAttribute("jsprun_uid");
		this.setExtcredits(request);
		int srchfid = Common.toDigit(request.getParameter("srchfid"),10000000000L, 0L).intValue();
		String extrafid =null;
		if (srchfid > 0) {
			extrafid = "&amp;srchfid=" + srchfid;
			request.setAttribute("extrafid", extrafid);
		}
		List<Map<String, String>> results = dataBaseService.executeQuery("SELECT COUNT(*) AS totalitems, SUM(price) AS tradesum FROM jrun_tradelog WHERE buyerid="+ uid+ " AND status IN ( "+ Tenpayapi.trade_typestatus("successtrades")+ " )");
		request.setAttribute("buystats", results.get(0) != null&& results.get(0).get("tradesum") != null ? results.get(0): null);
		results = dataBaseService.executeQuery("SELECT COUNT(*) AS totalitems, SUM(price) AS tradesum FROM jrun_tradelog WHERE sellerid=" + uid+ " AND status IN ( " + Tenpayapi.trade_typestatus("successtrades")+ " )");
		request.setAttribute("sellstats", results.get(0) != null&& results.get(0).get("tradesum") != null ? results.get(0): null);
		Map<String, Integer> attendstatus = new HashMap<String, Integer>();
		results = dataBaseService.executeQuery("SELECT status FROM jrun_tradelog WHERE buyerid="+ uid + " AND status IN ( " + Tenpayapi.trade_typestatus("buytrades")+ " )");
		int buyerattend = results != null ? results.size() : 0;
		if (buyerattend > 0) {
			for (Map<String, String> result : results) {
				String status = result.get("status");
				Integer sum = attendstatus.get(status);
				if (sum != null) {
					attendstatus.put(status, sum + 1);
				} else {
					attendstatus.put(status, 1);
				}
			}
		}
		request.setAttribute("buyerattend", buyerattend);
		results = dataBaseService.executeQuery("SELECT status FROM jrun_tradelog WHERE sellerid="+ uid + " AND status IN ( " + Tenpayapi.trade_typestatus("selltrades")+ " )");
		int sellerattend = results != null ? results.size() : 0;
		if (sellerattend > 0) {
			for (Map<String, String> result : results) {
				String status = result.get("status");
				Integer sum = attendstatus.get(status);
				if (sum != null) {
					attendstatus.put(status, sum + 1);
				} else {
					attendstatus.put(status, 1);
				}
			}
		}
		request.setAttribute("sellerattend", sellerattend);
		request.setAttribute("attendstatus", attendstatus);
		results = dataBaseService.executeQuery("SELECT COUNT(*) count FROM jrun_tradelog WHERE buyerid=" + uid + " AND status IN ( "+ Tenpayapi.trade_typestatus("tradingtrades") + " )");
		request.setAttribute("goodsbuyer",results.get(0).get("count"));
		results = dataBaseService.executeQuery("SELECT COUNT(*) count FROM jrun_trades WHERE sellerid=" + uid + " AND closed='0'");
		request.setAttribute("goodsseller",results.get(0).get("count"));

⌨️ 快捷键说明

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