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

📄 clubpost.jsp

📁 bbs系统源码有简单的bbs功能 论坛:http://www.mycodes.net/bbs
💻 JSP
📖 第 1 页 / 共 2 页
字号:
<%@ page language="java" contentType="text/html;charset=UTF-8" %>
<%@ include file="./GVinc/gvImport.jsp" %><%@ 
include file="./GVinc/gvTopicVar.jsp" %>
<jsp:useBean id="cci" scope="page" class="com.gamvan.club.classed.ClubClassInfo"/>
<jsp:useBean id="cti" scope="page" class="com.gamvan.club.topic.ClubTopicInfo"/>
<jsp:useBean id="ctp" scope="page" class="com.gamvan.club.topic.ClubTopicPost"/>
<jsp:useBean id="ctt" scope="page" class="com.gamvan.club.topic.ClubTopicType"/>
<jsp:useBean id="ud" scope="page" class="com.gamvan.club.manage.UpLoadDataBase"/><%@ 
include file="./GVinc/gvClassInfo.jsp" %><%
int iPage = ParamUtils.getIntParameter(request, "iPage",1);
int reID = ParamUtils.getIntParameter(request, "reID");
int tID = ParamUtils.getIntParameter(request, "tID");
String act = ParamUtils.getStringParameter(request, "act","add");
String ac = ParamUtils.getStringParameter(request, "ac");
String  userPass="", upfilesname="";
double userTypeNum=0;
short reTopicType = 0;
double reTopicTypeNum=0;
String reUsers = "";
boolean tempBea=false;
boolean isRe = false; //用来判断调用哪个类的方法
/******************************************
* 判断如果是新建主题,则不提取文章信息
* 而回复文章取数据内容出来
* 主要是为了引用回复这个功能
*******************************************/
ClubTopicItem ctit = null;
ClubTopicReItem ctrit = null;
ClubContentReItem ccrItem = null;
ClubContentItem ccItem = null;
com.gamvan.club.web.ClubPage cp = new com.gamvan.club.web.ClubPage(request,response);
if(!act.equals("add")){ //判断是否为回复
/**
 * 用来判断调用哪个类的方法
 * 0调用主题表 1调用回复表
 */
if(reID>0){ //判断是回复主题,还是回复主题的回复
	isRe = true; // 回复主题的回复
}
cp.setIsRe(isRe);
cp.setCcStyle((byte)1);
cp.clubPage();
if(!cp.getPageRun()){
	out.print(cp.getMessage());
	out.close();
	if(true) return;
}
//判断是显示回复还是主题
if(!isRe){
	ctit = (ClubTopicItem)cp.getTopicObject();
	ccItem = (ClubContentItem)cp.getContentObject();
}else{
	ctrit = (ClubTopicReItem)cp.getTopicObject();
	ccrItem = (ClubContentReItem)cp.getContentObject();
}
%><%@ include file="./GVinc/gvTopicGet.jsp" %><%
if(topicIsDel==1){
	out.print(com.gamvan.club.web.ClubErrors.errs(3,"此帖已被删除"));
	out.close();
	if(true) return;
}else if(act.equals("add")){//权限判断开始
	if(!isPass(gvUserGradeTxt,13)){
		out.print(com.gamvan.club.web.ClubErrors.errs(1,"您的级别("+ gvUserGradeName +")不能发表主题,如果你还没有登陆,请先登陆!"));
		out.close();
		if(true) return;
	}
}else if(act.equals("re")){
	if(!isPass(gvUserGradeTxt,14)){
		out.print(com.gamvan.club.web.ClubErrors.errs(1,"您的级别("+ gvUserGradeName +")不能回复主题,如果你还没有登陆,请先登陆!"));
		out.close();
		if(true) return;
	}
}else if(act.equals("edit")){
	if(userName.equals(gvUserName)){
		if(!isPass(gvUserGradeTxt,15)){
			out.print(com.gamvan.club.web.ClubErrors.errs(1,"您的级别("+ gvUserGradeName +")不能编辑自己的主题,如果你还没有登陆,请先登陆!"));
			out.close();
			if(true) return;
		}		
	}else{
		if(!isPass(gvUserGradeTxt,19)){
			out.print(com.gamvan.club.web.ClubErrors.errs(1,"您的级别("+ gvUserGradeName +")不能编辑他人主题,如果你还没有登陆,请先登陆!"));
			out.close();
			if(true) return;
		}	
	}
}

switch(topicType){
	case 1:
		userTypeNum=gvUserMark;
		break;
	case 2:
	//out.print(userTypeNum);
		userTypeNum=cti.selectTopicType(topicID, gvUserID, topicType, topicTypeNum);
		break;
	case 3:
		break;
	case 4:
		ClubTopicReUsersItem ctrui = null;
		ctrui = cti.selectReUsers(topicID);
		if(ctrui!=null){
			reUsers = "|" + ctrui.getReUsers() + "|";
		}
		topicTypeNum = reUsers.indexOf("|" + gvUserName + "|"); //如果回复过则返回0,否则返回-1
		break;
}
if(userName.equals(gvUserName)){
	userTypeNum=-1;
}
if(isPass(gvUserGradeTxt,42)){ //判断是否开通特殊权限
	userTypeNum=-2;
}
}
/******************************************
* 判断如果是新建主题,则不提取文章信息
* END
*******************************************/
StringBuffer sb_temp = new StringBuffer();
sb_temp.append(clubTitle);
sb_temp.append(" - ");
if(ccIDD1>0){
	sb_temp.append(ccName2);
	sb_temp.append(" - ");
}
if(ccIDD>0){
	sb_temp.append(ccName1);
	sb_temp.append(" - ");
}
	sb_temp.append(ccName);
	sb_temp.append(" - ");
if(act.equals("add")){
	sb_temp.append("发表主题");
}
else if(act.equals("re")){
	sb_temp.append("回复主题");
	sb_temp.append(" - ");
	sb_temp.append(topic);
}
else if(act.equals("edit")){
	sb_temp.append("编辑主题");
	sb_temp.append(" - ");
	sb_temp.append(topic);
}
%><html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title><%=sb_temp%></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<META content=<%=clubMeta%> name=keywords>
<link href="./GVimgs/favicon.ico" rel="Bookmark"> 
<link rel="icon" href="./GVimgs/favicon.ico" type="image/x-icon" />
<link rel="shortcut icon" href="./GVimgs/favicon.ico" type="image/x-icon" />
<STYLE type="text/css">@import url(./GVinc/GamVanClubStyle.css);</STYLE>
</head>
<body onload="loadTreeNoimg(<%=ccID%> ,'GVinc/gvMood.jsp?tID=<%=ccID%>');">
<DIV id="waitDiv" style="LEFT: 40%; VISIBILITY: hidden; POSITION: absolute; TOP: 20%; TEXT-ALIGN: center">
<TABLE cellPadding=6 border=0>
<TBODY><TR><TD align=middle>
<IMG  src="GVimgs/loading.gif" alt="请稍候..." width="30" height="30">
<BR>
<FONT color="red">数据载入中,请稍候...</FONT></TD></TR></TBODY></TABLE></DIV>
<IFRAME id=hiddenframe style="DISPLAY: none" src="about:blank" width=0  height=0></IFRAME>
<script language="javascript" type="text/javascript" src="GVscript/GVtopCode.js"></script>
<script language="javascript" type="text/JavaScript" src="GVscript/GVtree.js"></script>
<script language="javascript" type="text/javascript" src="GVscript/GVshowMenu.js"></script>
<script language="javascript" type="text/javascript" src="GVscript/GVpost.js"></script>
<script language="javascript" type="text/javascript" src="GVscriptInc/topBar.js"></script>
<script language="javascript" type="text/javascript">
gv_showWait('waitDiv', 1);
prtie2('<%=sb_temp%>');
</script>
<%
if(request.getMethod().equals("POST")){
	if(session.getAttribute("gvPost")==null){
		session.setAttribute("gvPost",now);
	}else{
		String isNow1 = FormatDateTime.dateAdd("s", -15); //返回30秒前的时间
		String isNow2 = String.valueOf(session.getAttribute("gvPost"));
		//out.print(isNow1);
		//out.println(isNow2);
		if(FormatDateTime.secondCompare(isNow1,isNow2)){
			out.print(OutPrint.prtCenter("您的帖子发的太快了,坐下来喝杯茶吧!","",2));
			out.print(Gfoot());
			out.close();
			if(true)return;
		}else{
			session.setAttribute("gvPost",now);
		}
	}
	
	StringBuffer sb = new StringBuffer();
	topic = ParamUtils.getStringParameter(request,"gvTopic");
	userName = ParamUtils.getStringParameter(request,"gvUserName");
	userPass = ParamUtils.getStringParameter(request,"gvUserPass");
	ctp.setAct(act);
	ctp.setUserName(userName);
	ctp.setUserID(gvUserID);
	ctp.setUserPass(userPass);
	ctp.setUserPass2(ParamUtils.getStringParameter(request,"gvUserPass2"));
	ctp.setTopic(ParamUtils.getStringParameter(request,"gvTopic"));
	ctp.setTopicColor(ParamUtils.getStringParameter(request,"gvTopicColor"));
	ctp.setTopicBold(ParamUtils.getStringParameter(request, "gvTopicBold"));
	ctp.setCcID(ParamUtils.getIntParameter(request,"ccID"));
	ctp.setCcID1(ParamUtils.getIntParameter(request,"ccID1"));
	ctp.setCcID2(ParamUtils.getIntParameter(request,"ccID2"));
	ctp.setMoveCCID(0);
	ctp.setTopicMood(ParamUtils.getShortParameter(request,"gvTopicMood"));
	topicType = ParamUtils.getShortParameter(request,"gvTopicType");
	ctp.setTopicType(topicType);
	if(topicType==1){
		ctp.setTopicTypeNum(ParamUtils.getDoubleParameter(request,"gvTopicTypeNum1"));
	}else if(topicType==2){
		ctp.setTopicTypeNum(ParamUtils.getDoubleParameter(request,"gvTopicTypeNum2"));
	}else if(topicType==3){
		ctp.setTopicTypeNum(ParamUtils.getDoubleParameter(request,"gvTopicTypeNum3"));
	}
	ctp.setTopicAddip(request.getRemoteAddr());
	ctp.setTopicIsPass(clubTopicIsPass);
	ctp.setContent(ParamUtils.getStringParameter(request,"content"));
	ctp.setContentUserPen(ParamUtils.getBooleanParameter(request,"gvContentUserPen"));
	ctp.setContentUrl(ParamUtils.getBooleanParameter(request,"gvContentUrl"));
	ctp.setContentImg(ParamUtils.getBooleanParameter(request,"gvContentImg"));
	ctp.setContentEmail(ParamUtils.getBooleanParameter(request,"gvContentEmail"));
	ctp.setContentCopyRight(ParamUtils.getByteParameter(request,"gvContentCopyRight"));
	ctp.setTopicID(tID);
	ctp.setTopicReID(reID);
	try{
		tempBea = ctp.topicPost(ccID1, ccID2);
	}catch(Exception e){
		out.print(e.toString());
	}
	tID = ctp.getTopicID();
	reID = ctp.getTopicReID();
	sb.append("<table width=\"100%\" border=\"0\" align=\"center\" cellpadding=\"4\" cellspacing=\"1\" class=\"tab\">");
	if(tempBea){
		sb.append("<tr class=\"tab1\" align=\"center\" ><td height=\"25\"><strong>文章发表成功,您现在可以……</strong></td></tr>");
		sb.append("<tr class=\"tab3\" align=\"center\" ><td height=\"25\"><a href=\"clubClass.jsp?ccID="+ ccID +"\" target=\"_self\">返回文章所在版面!</a></td></tr>");
		sb.append("<tr class=\"tab3\" align=\"center\" ><td height=\"25\">");
		sb.append("<a href=\"clubPage.jsp?ccID="+ ccID +"&tID="+ tID +"&reID="+ reID +"&ccStyle=1&iPage="+iPage+"\">查看你所发表的文章!</a>");
		sb.append("</td></tr>");
		ud.setCfUseID(tID); //上传文件使用ID
		ud.setCfUseTxt(topic);//更新上传文件状态
		//out.print(request.getParameter("upfilesname"));
		ud.uploadUpdates(request.getParameter("upfilesname")); //更新上传文件状态
		sb.append("<tr class=\"tab3\" align=\"center\" ><td height=\"25\">");
		sb.append("<span style=\"color:#bb0000\">3秒后,自动跳转至文章所在版面!</span>");
		sb.append("</td></tr>");
		response.setHeader("Refresh", "2; URL=clubClass.jsp?ccID="+ ccID +"");%>
	<cache:flush  key="topic_main"  scope="application"/>	
	<%}else{
		out.print(ctp.getMessage());
		out.print(Gfoot());
		out.close();
		if(true)return;
	}
	sb.append("</table>");
	out.print(sb.toString() + Gfoot());
	out.close();
	if(true)return;
}

%><DIV class="line"></DIV>
<DIV class="list_table_0">
<%=com.gamvan.club.ClubHtmlConst.gamvan_menu(
		com.gamvan.club.ClubHtmlConst.gamvan_classMenu(ccID, ccID1,ccID2,ccName,ccName1,ccName2, ccIDD, ccIDD1)
)%><%
if(act.equals("add")){
	out.print("发表主题");
}
else if(act.equals("re")){
	out.print("回复主题");
}

⌨️ 快捷键说明

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