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

📄 _addtopictodb__jsp.java

📁 CMS 1、增加子站点功能
💻 JAVA
📖 第 1 页 / 共 4 页
字号:
/*
 * JSP generated by Resin-3.1.0 (built Fri, 22 Dec 2006 07:00:35 PST)
 */

package _jsp._forum;
import javax.servlet.*;
import javax.servlet.jsp.*;
import javax.servlet.http.*;
import java.io.File;
import cn.js.fan.util.ErrMsgException;
import cn.js.fan.web.*;
import java.util.Calendar;
import com.redmoon.forum.person.UserSet;
import cn.js.fan.util.*;
import java.util.Vector;
import java.util.Iterator;
import com.redmoon.forum.ad.*;
import com.redmoon.forum.ui.*;
import com.redmoon.forum.security.*;
import com.redmoon.forum.*;
import com.redmoon.forum.Leaf;
import com.redmoon.forum.person.*;
import com.redmoon.forum.music.*;

public class _addtopictodb__jsp extends com.caucho.jsp.JavaPage
{
  private final java.util.HashMap<String,java.lang.reflect.Method> _jsp_functionMap = new java.util.HashMap<String,java.lang.reflect.Method>();
  private boolean _caucho_isDead;
  
  public void
  _jspService(javax.servlet.http.HttpServletRequest request,
              javax.servlet.http.HttpServletResponse response)
    throws java.io.IOException, javax.servlet.ServletException
  {
    javax.servlet.http.HttpSession session = request.getSession(true);
    com.caucho.server.webapp.WebApp _jsp_application = _caucho_getApplication();
    javax.servlet.ServletContext application = _jsp_application;
    com.caucho.jsp.PageContextImpl pageContext = com.caucho.jsp.QJspFactory.allocatePageContext(this, _jsp_application, request, response, null, session, 8192, true, false);
    javax.servlet.jsp.JspWriter out = pageContext.getOut();
    final javax.el.ELContext _jsp_env = pageContext.getELContext();
    javax.servlet.ServletConfig config = getServletConfig();
    javax.servlet.Servlet page = this;
    response.setContentType("text/html;charset=utf-8");
    request.setCharacterEncoding("UTF-8");
    com.redmoon.forum.ui.LabelTag _jsp_LabelTag_0 = null;
    com.redmoon.forum.ad.AdTag _jsp_AdTag_1 = null;
    com.redmoon.forum.ui.LabelTag _jsp_LabelTag_2 = null;
    try {
      out.write(_jsp_string0, 0, _jsp_string0.length);
      cn.js.fan.util.StrUtil StrUtil;
      StrUtil = (cn.js.fan.util.StrUtil) pageContext.getAttribute("StrUtil");
      if (StrUtil == null) {
        StrUtil = new cn.js.fan.util.StrUtil();
        pageContext.setAttribute("StrUtil", StrUtil);
      }
      out.write(_jsp_string1, 0, _jsp_string1.length);
      cn.js.fan.security.Form form;
      form = (cn.js.fan.security.Form) pageContext.getAttribute("form");
      if (form == null) {
        form = new cn.js.fan.security.Form();
        pageContext.setAttribute("form", form);
      }
      out.write(_jsp_string2, 0, _jsp_string2.length);
      
boolean isSuccess = false;
String privurl = "";

boolean cansubmit = false;
com.redmoon.forum.Config cfg = com.redmoon.forum.Config.getInstance();
int interval = cfg.getIntProperty("forum.addMsgInterval");
int maxtimespan = interval;
try {
	cansubmit = form.cansubmit(request, "addtopic", maxtimespan);// \u9632\u6b62\u91cd\u590d\u5237\u65b0	
}
catch (ErrMsgException e) {
	out.println(StrUtil.Alert_Back(e.getMessage()));
	return;
}

      out.write(_jsp_string1, 0, _jsp_string1.length);
      com.redmoon.forum.MsgMgr Topic;
      Topic = (com.redmoon.forum.MsgMgr) pageContext.getAttribute("Topic");
      if (Topic == null) {
        Topic = new com.redmoon.forum.MsgMgr();
        pageContext.setAttribute("Topic", Topic);
      }
      out.write(_jsp_string1, 0, _jsp_string1.length);
      
String boardcode = "";
long id = -1;
if (cansubmit) {
	try {
		isSuccess = Topic.AddNew(application, request);
		privurl = Topic.getprivurl();
		boardcode = Topic.getCurBoardCode();
		id = Topic.getId();
	}
	catch (ErrMsgException e) {
		out.println(StrUtil.Alert_Back(e.getMessage()));
		// e.printStackTrace();
		return;
	}
}

String addFlag = ParamUtil.get(request, "addFlag");
if (Topic.isBlog()) {
	// \u8bf4\u660e\u662f\u4ece\u535a\u5ba2\u7528\u6237\u7ba1\u7406\u540e\u53f0\u53d1\u8868\u7684
	if (addFlag.equals("blog")) {
		MsgDb md = Topic.getMsgDb(Topic.getId());
		if (md.getCheckStatus()==MsgDb.CHECK_STATUS_NOT) {
			out.print(StrUtil.Alert_Redirect(SkinUtil.LoadString(request, "res.label.forum.addtopic", "need_check"), "../blog/user/listtopic.jsp?blogId=" + md.getBlogId()));			
		}
		else
			out.print(StrUtil.Alert_Redirect(SkinUtil.LoadString(request, "info_op_success"), "../blog/user/listtopic.jsp?blogId=" + md.getBlogId()));	
		return;
	}
	// \u662f\u4ece\u8bba\u575b\u53d1\u8d34\u65f6\u9009\u62e9\u535a\u5ba2\u76ee\u5f55\u53d1\u8868\u7684
	if (boardcode.equals(Leaf.CODE_BLOG)) {
		out.print(StrUtil.Alert_Redirect(SkinUtil.LoadString(request, "info_op_success"), "blog/showblog.jsp?rootid=" + id));	
		return;
	}
}

      out.write(_jsp_string1, 0, _jsp_string1.length);
      
// \u53d6\u5f97\u76ae\u80a4\u8def\u5f84
Leaf lf = new Leaf();
lf = lf.getLeaf(boardcode);
String skincode = lf.getSkin();
if (skincode.equals(UserSet.defaultSkin)) {
	skincode = UserSet.getSkin(request);
	if (skincode==null || skincode.equals(""))
		skincode = UserSet.defaultSkin;
}	
SkinMgr skm = new SkinMgr();
Skin skin = skm.getSkin(skincode);
String skinPath = skin.getPath();

      out.write(_jsp_string3, 0, _jsp_string3.length);
      if (_jsp_LabelTag_0 == null) {
        _jsp_LabelTag_0 = new com.redmoon.forum.ui.LabelTag();
        _jsp_LabelTag_0.setPageContext(pageContext);
        _jsp_LabelTag_0.setParent((javax.servlet.jsp.tagext.Tag) null);
        _jsp_LabelTag_0.setRes("res.label.forum.addtopic");
        _jsp_LabelTag_0.setKey("addtopic");
      }

      _jsp_LabelTag_0.doEndTag();
      out.write(_jsp_string4, 0, _jsp_string4.length);
      out.print((Global.AppName));
      out.write(_jsp_string5, 0, _jsp_string5.length);
      
response.setHeader("Pragma","No-cache");
response.setHeader("Cache-Control","no-cache");
response.setDateHeader("Expires", 0);

      out.write(_jsp_string6, 0, _jsp_string6.length);
      out.print((skinPath));
      out.write(_jsp_string7, 0, _jsp_string7.length);
      if (addFlag.equals("")) {
      out.write(_jsp_string8, 0, _jsp_string8.length);
      
String hUrl = StrUtil.getUrl(request);
// \u8fdb\u5165info.jsp\u9875\u9762\u65f6\u4e0d\u68c0\u6d4b\u5237\u65b0
if (hUrl.indexOf("/info.jsp")==-1) {
	if (!ActionMonitor.canVisit(request, response)) {
		String fastStr = SkinUtil.LoadString(request, "res.label.forum.inc.header", "visit_too_fast");
		fastStr = StrUtil.format(fastStr, new Object[] {new Integer(com.redmoon.forum.Config.getInstance().getVisitInterval()/1000)});
		out.print(SkinUtil.makeErrMsg(request, fastStr));
		return;
	}
}

if (ForumDb.getInstance().getStatus()==ForumDb.STATUS_STOP) {
	// \u9632\u6b62\u8fdb\u5165info.jsp\u9875\u9762\u65f6\u53cd\u590dredirect
	if (hUrl.indexOf("/info.jsp")==-1) {
		response.sendRedirect(request.getContextPath() + "/info.jsp?info=" + cn.js.fan.util.StrUtil.UrlEncode(ForumDb.getInstance().getReason()));
		return;
	}
}

if (!com.redmoon.forum.Privilege.isUserLogin(request)) {
	// \u9632\u6b62\u8fdb\u5165info.jsp\u9875\u9762\u65f6\u53cd\u590dredirect
	if (hUrl.indexOf("/info.jsp")==-1) {
		if (!ForumDb.getInstance().canGuestEnterIntoForum()) {
			response.sendRedirect(request.getContextPath() + "/info.jsp?op=login&info=" + StrUtil.UrlEncode(SkinUtil.LoadString(request, "info_please_login")));
			return;	
		}
	}
}

      out.write(_jsp_string9, 0, _jsp_string9.length);
      out.print((request.getContextPath()));

⌨️ 快捷键说明

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