📄 edittopic_alipay.jsp
字号:
<%@ page contentType="text/html;charset=utf-8"%>
<%@ page import="com.redmoon.blog.*" %>
<%@ page import="com.redmoon.forum.*" %>
<%@ page import="cn.js.fan.util.*" %>
<%@ page import="java.util.*" %>
<%@ page import="com.redmoon.forum.plugin.*"%>
<%@ page import="com.redmoon.forum.plugin2.alipay.*"%>
<%@ page import="com.redmoon.forum.plugin.base.*"%>
<%@ page import="com.redmoon.forum.person.UserSet"%>
<jsp:useBean id="StrUtil" scope="page" class="cn.js.fan.util.StrUtil"/>
<jsp:useBean id="privilege" scope="page" class="com.redmoon.forum.Privilege"/>
<%
long editid = -1;
try {
editid = ParamUtil.getInt(request, "editid");
}
catch (ErrMsgException e) {
out.print(SkinUtil.makeErrMsg(request, "标识错误!"));
return;
}
String privurl = request.getParameter("privurl");
if (!privilege.isUserLogin(request))
{
out.print(StrUtil.makeErrMsg("您尚未登录!"));
return;
}
MsgMgr mm = new MsgMgr();
MsgDb Topic = mm.getMsgDb(editid);
int i=0;
String name = privilege.getUser(request);
try {
if (!privilege.canEdit(request, Topic))
{
out.print(StrUtil.makeErrMsg("您无权编辑!"));
return;
}
}
catch (ErrMsgException e) {
out.print(StrUtil.Alert_Back(e.getMessage()));
return;
}
String topic="",content="";
int expression=1;
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();
String boardname;
String hit = request.getParameter("hit");
String boardcode = Topic.getboardcode();
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");
Vector attachments = Topic.getAttachments();
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title><%=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 delAttach(attach_id, msgId) {
if (!window.confirm("您确定要删除吗?")) {
return;
}
document.frames.hideframe.location.href = "edittopicdo.jsp?op=delAttach&msgId=" + msgId + "&attach_id=" + attach_id
}
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 frmAnnounce_onsubmit() {
if (!cws_validateMode())
return false;
var html;
html=cws_getText();
html=cws_rCode(html,"<a> </a>","");
document.frmAnnounce.Content.value=html;
if (frmAnnounce.topic.value.length<<%=msgTitleLengthMin%>)
{
alert("您输入的主题太短了,注意最短不能少于<%=msgTitleLengthMin%>字!");
return false;
}
if (frmAnnounce.topic.value.length><%=msgTitleLengthMax%>)
{
alert("您输入的主题太长了,注意最长不能超过<%=msgTitleLengthMax%>字!");
return false;
}
if (frmAnnounce.Content.value.length<<%=msgLengthMin%>)
{
alert("您输入的内容太短了,注意最短不能少于<%=msgLengthMin%>字!");
return false;
}
if (frmAnnounce.Content.value.length><%=msgLengthMax%>)
{
alert("您输入的内容太长了,注意最长不能超过<%=msgLengthMax%>字!");
return false;
}
}
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.jsp?op=changeattachname&msgId=" + msgId + "&attach_id=" + attach_id;
form3.newname.value = obj.value;
form3.submit();
}
var attachCount = <%=attachments.size()%> + 1; // 把默认输入框计算在内
function AddAttach() {
if (attachCount>=<%=maxAttachmentCount%>) {
alert("附件最多只能上传<%=maxAttachmentCount%>个!");
return;
}
updiv.insertAdjacentHTML("BeforeEnd", "<table width=100%><tr><lt:Label res="res.label.forum.addtopic" key="file"/> <input type='file' name='filename" + attachCount + "' size=10><td></td></tr></table>");
// updiv.innerHTML += "<table width=100%><tr>文件 <input type='file' name='filename" + attachCount + "' size=10><td></td></tr></table>";
attachCount += 1;
}
</script>
<script src="inc/ubbcode.jsp"></script>
</head>
<body topmargin="2">
<%if (!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>
<table width="98%" border="1" align="center" cellpadding="4" cellspacing="0" borderColor="<%=skin.getTableBorderClr()%>">
<form name=frmAnnounce method="post" action="edittopicdo.jsp" enctype="MULTIPART/FORM-DATA" onSubmit="return frmAnnounce_onsubmit()">
<TBODY>
<tr>
<td colspan="2" class="td_title"> 编辑贴子 <a href="showtopictree.jsp?rootid=<%=Topic.getRootid()%>"><%=Topic.getTitle()%></a></td>
</tr>
</TBODY>
<TBODY>
<tr>
<td colspan="2">
<%
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);
IPluginViewEditMsg pv = ipu.getViewEditMsg(boardcode, Topic.getId());
if (pv.IsPluginBoard()) {
out.print(pu.getName(request) + ": " + pv.render(UIEditMsg.POS_FORM_NOTE) + "<BR>");
out.print(pv.render(UIEditMsg.POS_FORM_ELEMENT));
}
}
}
%></td>
</tr>
<%
// 判别该用户的博客是否已被激活及该贴是否为根贴,只有两项全符合,才会出现编辑博客的选项
if (Topic.getReplyid()==-1) {
UserConfigDb ucd = new UserConfigDb();
ucd = ucd.getUserConfigDb(Topic.getName());
if (ucd!=null && ucd.isLoaded()) {
%>
<tr>
<td>发表至博客目录</td>
<td>
<%
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -