📄 edittopic_we.jsp
字号:
<%@ page contentType="text/html;charset=utf-8"%>
<%@ page import="com.redmoon.forum.*" %>
<%@ page import="java.util.Calendar" %>
<%@ page import="com.redmoon.forum.plugin2.*"%>
<%@ page import="com.redmoon.forum.person.UserSet"%>
<%@ page import="com.redmoon.forum.plugin.*"%>
<%@ page import="com.redmoon.forum.plugin.base.*"%>
<%@ page import="com.redmoon.blog.*" %>
<%@ page import="cn.js.fan.web.*" %>
<%@ taglib uri="/WEB-INF/tlds/LabelTag.tld" prefix="lt" %>
<jsp:useBean id="StrUtil" scope="page" class="cn.js.fan.util.StrUtil"/>
<jsp:useBean id="privilege" scope="page" class="com.redmoon.forum.Privilege"/>
<%
if (!privilege.isUserLogin(request)) {
response.sendRedirect("../info.jsp?op=login&info=" + StrUtil.UrlEncode(SkinUtil.LoadString(request, "info_please_login")));
return;
}
int i=0;
String editid = request.getParameter("editid");
String privurl = request.getParameter("privurl");
if (editid==null && !StrUtil.isNumeric(editid)) {
out.print(SkinUtil.makeErrMsg(request, SkinUtil.LoadString(request, SkinUtil.ERR_ID)));
return;
}
String name = privilege.getUser(request);
MsgMgr mm = new MsgMgr();
MsgDb Topic = mm.getMsgDb(Long.parseLong(editid));
String boardcode = Topic.getboardcode();
String boardname;
Leaf curleaf = new Leaf();
curleaf = curleaf.getLeaf(boardcode);
boardname = curleaf.getName();
// 取得皮肤路径
String skincode = curleaf.getSkin();
if (skincode.equals("") || 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();
com.redmoon.forum.Config cfg1 = new com.redmoon.forum.Config();
int msgTitleLengthMin = cfg1.getIntProperty("forum.msgTitleLengthMin");
int msgTitleLengthMax = cfg1.getIntProperty("forum.msgTitleLengthMax");
int msgLengthMin = cfg1.getIntProperty("forum.msgLengthMin");
int msgLengthMax = cfg1.getIntProperty("forum.msgLengthMax");
int maxAttachmentCount = cfg1.getIntProperty("forum.maxAttachmentCount");
int maxAttachmentSize = cfg1.getIntProperty("forum.maxAttachmentSize");
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title><lt:Label res="res.label.forum.edittopic" key="edittopic"/> - <%=Global.AppName%></title>
<link href="<%=skinPath%>/skin.css" rel="stylesheet" type="text/css">
<STYLE>TABLE {
BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 1px
}
TD {
BORDER-RIGHT: 0px; BORDER-TOP: 0px
}
</STYLE>
<script>
function findObj(theObj, theDoc)
{
var p, i, foundObj;
if(!theDoc) theDoc = document;
if( (p = theObj.indexOf("?")) > 0 && parent.frames.length)
{
theDoc = parent.frames[theObj.substring(p+1)].document;
theObj = theObj.substring(0,p);
}
if(!(foundObj = theDoc[theObj]) && theDoc.all) foundObj = theDoc.all[theObj];
for (i=0; !foundObj && i < theDoc.forms.length; i++)
foundObj = theDoc.forms[i][theObj];
for(i=0; !foundObj && theDoc.layers && i < theDoc.layers.length; i++)
foundObj = findObj(theObj,theDoc.layers[i].document);
if(!foundObj && document.getElementById) foundObj = document.getElementById(theObj);
return foundObj;
}
function getradio(myitem)
{
var radioboxs = document.all.item(myitem);
if (radioboxs!=null)
{
for (i=0; i<radioboxs.length; i++)
{
if (radioboxs[i].type=="radio" && radioboxs[i].checked)
{
return radioboxs[i].value;
}
}
}
return "";
}
function frmAnnounce_onsubmit()
{
if (!cws_validateMode())
return false;
if (document.frmAnnounce.topic.value.length<<%=msgTitleLengthMin%>)
{
alert("<lt:Label res="res.forum.MsgDb" key="err_too_short_title"/><%=msgTitleLengthMin%>");
return false;
}
if (document.frmAnnounce.topic.value.length><%=msgTitleLengthMax%>)
{
alert("<lt:Label res="res.forum.MsgDb" key="err_too_large_title"/><%=msgTitleLengthMax%>");
return false;
}
var html;
html = cws_getText();
html = cws_rCode(html,"<a> </a>","");
if (html.length<<%=msgLengthMin%>)
{
alert("<lt:Label res="res.forum.MsgDb" key="err_too_short_content"/><%=msgLengthMin%>");
return false;
}
if (html.length><%=msgLengthMax%>)
{
alert("<lt:Label res="res.forum.MsgDb" key="err_too_large_content"/><%=msgLengthMax%>");
return false;
}
loadDataToWebeditCtrl(frmAnnounce, frmAnnounce.webedit);
frmAnnounce.webedit.AddSpecialFile("filename", frmAnnounce.filename.value);
frmAnnounce.webedit.AddField("ip", "<%=request.getRemoteAddr()%>");
frmAnnounce.webedit.UploadArticle();
if (frmAnnounce.webedit.ReturnMessage.indexOf("+")!=-1) {
alert(frmAnnounce.webedit.ReturnMessage);
window.location.href = "<%=privurl%>";
}
else
alert(frmAnnounce.webedit.ReturnMessage);
return false;
}
function SubmitWithFileDdxc() {
frmAnnounce.webedit.isDdxc = 1;
if (document.frmAnnounce.topic.value.length<<%=msgTitleLengthMin%>)
{
alert("<lt:Label res="res.forum.MsgDb" key="err_too_short_title"/><%=msgTitleLengthMin%>");
return false;
}
if (document.frmAnnounce.topic.value.length><%=msgTitleLengthMax%>)
{
alert("<lt:Label res="res.forum.MsgDb" key="err_too_large_title"/><%=msgTitleLengthMax%>");
return false;
}
var html;
html = cws_getText();
html = cws_rCode(html,"<a> </a>","");
if (html.length<<%=msgLengthMin%>)
{
alert("<lt:Label res="res.forum.MsgDb" key="err_too_short_content"/><%=msgLengthMin%>");
return false;
}
if (html.length><%=msgLengthMax%>)
{
alert("<lt:Label res="res.forum.MsgDb" key="err_too_large_content"/><%=msgLengthMax%>");
return false;
}
loadDataToWebeditCtrl(frmAnnounce, frmAnnounce.webedit);
frmAnnounce.webedit.AddSpecialFile("filename", frmAnnounce.filename.value);
frmAnnounce.webedit.AddField("ip", "<%=request.getRemoteAddr()%>");
frmAnnounce.webedit.MTUpload();
}
function Operate() {
recordFilePath = frmAnnounce.Recorder.FilePath;
frmAnnounce.webedit.InsertFileToList(recordFilePath);
}
function clearAll(){
document.frmAnnounce.title.value=""
IframeID.document.body.innerHTML = "";
}
function changeAttachName(attach_id, msgId, nm) {
var obj = findObj(nm);
// document.frames.hideframe.location.href = "fwebedit_do.jsp?op=changeattachname&page_num=1&doc_id=" + doc_id + "&attach_id=" + attach_id + "&newname=" + obj.value
form3.action = "edittopicdo_we.jsp?op=changeattachname&msgId=" + msgId + "&attach_id=" + attach_id;
form3.newname.value = obj.value;
form3.submit();
}
function delAttach(attach_id, msgId) {
if (!window.confirm("<lt:Label res="res.label.forum.edittopic" key="confirm_del"/>")) {
return;
}
document.frames.hideframe.location.href = "edittopicdo_we.jsp?op=delAttach&msgId=" + msgId + "&attach_id=" + attach_id
}
</script>
<script language=JavaScript src='inc/formpost.js'></script>
<script src="inc/ubbcode.jsp"></script>
</head>
<body topmargin="2">
<%
String editFlag = ParamUtil.get(request, "editFlag");
if (!editFlag.equals("blog") && !boardcode.equals(Leaf.CODE_BLOG)) {%>
<%@ include file="inc/header.jsp"%>
<jsp:include page="inc/position.jsp" flush="true">
<jsp:param name="boardcode" value="<%=StrUtil.UrlEncode(boardcode)%>" />
</jsp:include>
<%}%>
<%
String topic="",content="";
int expression=1;
if (!privilege.canEdit(request, Topic))
{
out.print(SkinUtil.makeErrMsg(request, SkinUtil.LoadString(request, "pvg_invalid")));
return;
}
String show_ubbcode = "" + Topic.getShowUbbcode();
String show_smile = "" + Topic.getShowSmile();
String email_notify = "" + Topic.getEmailNotify();
long rootid = Topic.getRootid();
topic = Topic.getTitle();
content = Topic.getContent();
expression = Topic.getExpression();
%>
<table width="98%" border="1" align="center" cellpadding="4" cellspacing="0" borderColor="<%=skin.getTableBorderClr()%>">
<form name=frmAnnounce method="post" action="edittopicdo_we.jsp">
<TBODY>
<tr bgcolor="#0078bf">
<td colspan="2" class="td_title"><lt:Label res="res.label.forum.edittopic" key="edittopic"/> <a href="showtopic_tree.jsp?rootid=<%=Topic.getRootid()%>&showid=<%=Topic.getId()%>"><%=StrUtil.toHtml(Topic.getTitle())%></a></td>
</tr>
<tr>
<td colspan="2"><%
String pluginCode = Topic.getRootMsgPluginCode();
PluginMgr pm = new PluginMgr();
Vector vplugin = pm.getAllPluginUnitOfBoard(boardcode);
if (vplugin.size()>0) {
Iterator irplugin = vplugin.iterator();
while (irplugin.hasNext()) {
PluginUnit pu = (PluginUnit)irplugin.next();
IPluginUI ipu = pu.getUI(request, response, out);
IPluginViewEditMsg pv = ipu.getViewEditMsg(boardcode, Topic.getId());
if (pv.IsPluginBoard()) {
boolean showPlugin = false;
if (pu.getType().equals(pu.TYPE_BOARD))
showPlugin = true;
else if (pu.getType().equals(pu.TYPE_TOPIC)) {
if (pluginCode.equals(pu.getCode()))
showPlugin = true;
}
if (showPlugin) {
if (!pu.getEditTopicPage().equals("")) {
%>
<jsp:include page="<%=pu.getEditTopicPage()%>" flush="true">
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -