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

📄 post_editpost.jsp

📁 论坛软件系统亦称电子公告板(BBS)系统
💻 JSP
字号:
<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="/WEB-INF/c.tld" prefix="c"%>
<%@ taglib uri="/WEB-INF/jrun-tag.tld" prefix="jrun"%>
<jsp:include flush="true" page="header.jsp" />
<div id="nav">
	<a href="${settings.indexname}"> ${settings.bbname} </a> ${navigation} &raquo;
	<c:choose>
		<c:when test="${isfirstpost&& special == 1}">编辑投票主题</c:when>
		<c:when test="${isfirstpost&& special == 3}">编辑悬赏主题</c:when>
		<c:when test="${isfirstpost&& special == 5}">编辑辩论主题</c:when>
		<c:otherwise>编辑帖子</c:otherwise>
	</c:choose>
</div>
<c:if test="${special==4 || special==5}">
	<script type="text/javascript" src="include/javascript/calendar.js"></script>
</c:if>
<script type="text/javascript">
var postminchars = parseInt('${settings.minpostsize}');
var postmaxchars = parseInt('${settings.maxpostsize}');
var disablepostctrl = parseInt('${usergroups.disablepostctrl}');
var typerequired = parseInt('${threadtypes.required}');
var attachments = new Array();
var bbinsert = parseInt('${settings.bbinsert}');
var attachimgurl = new Array();
var isfirstpost = parseInt('${isfirstpost=='true'?1:0}');
var special = parseInt('${special}');
var allowposttrade = parseInt('${usergroups.allowposttrade}');
var allowpostreward = parseInt('${usergroups.allowpostreward}');
var allowpostactivity = parseInt('${usergroups.allowpostactivity}');
lang['board_allowed'] = '系统限制';
lang['lento'] = '到';
lang['bytes'] = '字节';
lang['post_curlength'] = '当前长度';
lang['post_subject_and_message_isnull'] = '请完成标题或内容栏。';
lang['post_subject_toolong'] = '您的标题超过 80 个字符的限制。';
lang['post_message_length_invalid'] = '您的帖子长度不符合要求。';
lang['post_type_isnull'] = '请选择主题对应的分类。';
lang['post_reward_credits_null'] = '对不起,您输入悬赏积分。';
</script>
<jsp:include flush="true" page="post_preview.jsp" />
<form method="post" id="postform" action="post.jsp?action=edit&amp;extra=page%3D1&amp;editsubmit=yes&amp" onSubmit="return validate(this)"; enctype="multipart/form-data">
	<div class="mainbox formbox">
		<h1>
			<c:choose>
				<c:when test="${isfirstpost&& special == 1}">编辑投票主题</c:when>
				<c:when test="${isfirstpost&&special == 3}">编辑悬赏主题</c:when>
				<c:when test="${isfirstpost&&special == 5}">编辑辩论主题</c:when>
				<c:otherwise>编辑帖子</c:otherwise>
			</c:choose>
		</h1>
		<table summary="Edit Post" cellspacing="0" cellpadding="0" id="editpost">
			<thead>
				<c:if test="${jsprun_uid>0}">
				<tr>
					<th>用户名</th>
					<td>${user.username} <em class="tips">[<a href="logging.jsp?action=logout&amp;formhash=${formhash}">退出登录</a>]</em></td>
				</tr>
				</c:if>
			</thead>
			<c:if test="${special == 3&&isfirstpost}">
				<tr>
					<th>悬赏价格(${extcredit.title})</th>
					<td>
					<c:choose>
						<c:when test="${thread.price>0}">
							<input onkeyup="getrealprice(this.value)" type="text" name="rewardprice" size="6" value="${thread.price}" tabindex="2" />
							税后追加: <span id="realprice">0</span> ${extcredit.unit} (最低 ${usergroups.minrewardprice} ${extcredit.unit}<c:if test="${usergroups.maxrewardprice>0}"> - ${usergroups.maxrewardprice} ${extcredit.unit}</c:if>)
						</c:when>
						<c:when test="${thread.price<0&&ismoderator}"><input type="text" name="rewardprice" size="6" value="${thread.price}" tabindex="2" /></c:when>
						<c:otherwise><input onkeyup="getrealprice(this.value)" type="hidden" name="rewardprice" size="6" value="${thread.price}" tabindex="2" />${thread.price} ${extcredit.unit}</c:otherwise>
					</c:choose>
					</td>
				</tr>
				<c:if test="${thread.price>0}">
					<script type="text/javascript">
						$('realprice').innerHTML = 0;
						function getrealprice(price){
							if(!price.search(/^\d+$/) ) {
								n = parseInt(price) + Math.ceil(parseInt(price * ${settings.creditstax})) - (parseInt(${thread.price}) + Math.ceil(parseInt(${thread.price} * ${settings.creditstax})));
								if(price > 32767) {
									$('realprice').innerHTML = '<b>售价不能高于 32767</b>';
								} else if (price < ${thread.price}) {
									$('realprice').innerHTML = '<b>不能降低悬赏积分</b>';
								}else if (price < ${usergroups.minrewardprice} || (${usergroups.maxrewardprice} > 0 && price > ${usergroups.maxrewardprice})) {
									$('realprice').innerHTML = '<b>售价超出范围</b>';
								} else {
									$('realprice').innerHTML = n;
								}
							}else{
								$('realprice').innerHTML = '<b>填写无效</b>';
							}
						}
					</script>
				</c:if>
			</c:if>
			<tr>
				<th style="border-bottom: 0;">标题</th>
				<td style="border-bottom: 0;">
					<c:if test="${isfirstpost&&threadtypes.types!=null}">
						<select name="typeid" onchange="ajaxget('post.jsp?action=threadtypes&typeid='+this.options[this.selectedIndex].value+'&fid=${thread.fid}&sid=${jsprun_sid}&rand='+Math.random(), 'threadtypes', 'threadtypeswait')">
								<option value="0">&nbsp;</option>
								<c:forEach items="${threadtypes.types}" var="threadtype">
									<option value="${threadtype.key}"${threadtypes.special[threadtype.key]==1? "class='special'":""} ${threadtype.key==thread.typeid?"selected='selected'":""}>${threadtype.value}</option>
								</c:forEach>
							</select>
							<span id="threadtypeswait"></span>
					</c:if>
					<c:choose>
						<c:when test="${special==3&&!ismoderator&&isfirstpost&&thread.replies>0}"><input type="hidden" name="subject" id="subject" size="45" value="${post.subject}" tabindex="3" />${post.subject}</c:when>
						<c:otherwise><input type="text" name="subject" id="subject" size="45" value="${post.subject}" tabindex="3" /></c:otherwise>
					</c:choose>
					<input type="hidden" name="origsubject" value="${post.subject}" />
					<c:if test="${special==6}">
						<input type="hidden" name="subjectu8" value="" />
						<input type="hidden" name="tagsu8" value="" />
						<input type="hidden" name="vid" value="1" />
					</c:if>
				</td>
			</tr>
			<c:if test="${special==1 && isfirstpost && (usergroups.alloweditpoll==1 || thread.authorid==jsprun_uid)}">
				<input type="hidden" name="polls" value="yes">
				<tr><th>有效记票天数</th><td><input type="text" name="expiration" value="${sparetime}" size="6" tabindex="4" /> <em class="tips">(0或空为不限制)</em></td></tr>
				<tr>
					<th valign="top">投票选项<br />
						每行填写 1 个选项<br />
						最多可填写 ${settings.maxpolloptions} 个选项 ${settings.maxpolloptions}<br /><br />
						<input type="checkbox" name="visibilitypoll" value="1" tabindex="4" ${polls.visible==1?"checked":""}/>
						提交投票后结果才可见
						<br />
						<input type="checkbox" name="multiplepoll" value="1" tabindex="5" onclick="this.checked?$('maxchoicescontrol').style.display='':$('maxchoicescontrol').style.display='none';"  <c:if test="${polls.multiple==1}">checked</c:if>/>
						多选投票
						<br />
						<c:if test="${sparetime!='已结束'}">
						<input type="checkbox" name="close" value="1" />
						关闭投票
						<br />
						</c:if>
						<span id="maxchoicescontrol" style="display: none">最多可选项数:<input type="text" name="maxchoices" value="${polls.maxchoices}" size="5" /> <br /></span>
					</th>
					<td>
						显示顺序&nbsp;<a id="addpolloptlink" href="#" onclick="addpollopt()">[增加投票项]</a>
						<br />
						<c:forEach items="${options}" var="option">
							<input type="hidden" name="polloptionid[]" value="${option.polloptionid}">
							<input type="text" name="displayorder[]" value="${option.displayorder}" size="5" tabindex="6" style="text-align:right">
							<input type="text" name="polloption[]" value="${option.polloption}" tabindex="7" size="55" />
							<br />
						</c:forEach>
						<span id="addpolloptindex"></span>
					</td>
				</tr>
				<script type="text/javascript">
					var max = ${optionsize};
					function addpollopt() {
						if(max < ${settings.maxpolloptions}) {
							max++;
							var optrow='<input type="text" name="displayordernew" value="" size="5" style="text-align:right">&nbsp;<input type="text" name="polloptionnew" value="" size="55"><br />';
							$('addpolloptindex').innerHTML = $('addpolloptindex').innerHTML + optrow;
							if(max == ${settings.maxpolloptions}) {
								$('addpolloptlink').disabled=true;
							}
						}
					}
				</script>
			</c:if>
			<tbody id="threadtypes"></tbody>
			<tr><jsp:include flush="true" page="post_editor.jsp" /></tr>
			<c:if test="${isfirstpost}">
				<c:if test="${settings.tagstatus>0}">
					<tr>
						<th><label for="tags">标签(TAG)</label></th>
						<td><input size="45" type="text" id="tags" name="tags" value="${tags}" tabindex="200" /> &nbsp;<button onclick="relatekw();return false">可用标签</button><span id="tagselect"></span><em class="tips"> (用空格隔开多个标签,最多可填写 <strong>5</strong> 个)</em></td>
					</tr>
				</c:if>
				<c:if test="${special==5}">
					<tr>
						<th>正方观点</th>
						<td><textarea name="affirmpoint" rows="10" cols="20" style="width:99%; height:60px" tabindex="201" onkeydown="ctlent(event)">${debates.affirmpoint}</textarea></td>
					</tr>
					<tr>
						<th>反方观点</th>
						<td><textarea name="negapoint" rows="10" cols="20" style="width:99%; height:60px" tabindex="202" onkeydown="ctlent(event)">${debates.negapoint}</textarea></td>
					</tr>
					<tr>
						<th>结束时间</th>
						<td>
							<c:choose>
								<c:when test="${debates.endtime>0}"><input onclick="showcalendar(event, this, true)" type="text" name="endtime" size="45" value="<jrun:showTime timeInt="${debates.endtime}" type="${dateformat} ${timeformat}" timeoffset="${timeoffset}"/>" tabindex="203" /></c:when>
								<c:otherwise><input onclick="showcalendar(event, this, true)" type="text" name="endtime" size="45" value="" tabindex="203" /></c:otherwise>
							</c:choose>
						</td>
					</tr>
					<tr>
						<th>裁判</th>
						<td><input type="text" name="umpire" size="45" tabindex="204" onblur="checkuserexists(this.value, 'checkuserinfo')" value="${debates.umpire}" /><span id="checkuserinfo"></span></td>
					</tr>
				</c:if>
				<thead><tr><th>其他信息</th><td>&nbsp;</td></tr></thead>
				<c:if test="${usergroups.allowsetreadperm>0}">
					<tr>
						<th>所需阅读权限</th>
						<td><input type="text" name="readperm" size="6" value="${thread.readperm}" tabindex="205" /> <em class="tips">(0或空为不限制)</em></td>
					</tr>
				</c:if>
				<c:if test="${usergroups.maxprice>0&&special==0&&extcredit!=null}">
					<tr>
						<th>售价(${extcredit.title})</th>
						<td>
							<c:choose>
								<c:when test="${thread.price==-1&&settings.maxchargespan>0 && (timestamp - thread.dateline >= settings.maxchargespan * 3600)}"><input type="text" name="price" size="6" value="${thread.price==-1?0:thread.price}" tabindex="206" disabled /> <em class="tips">${extcredit.unit} ${thread.price==-1?"(本主题被强制退款)":"(本主题自发表起已超过最长出售时限)"}</em></c:when>
								<c:otherwise><input type="text" name="price" size="6" value="${thread.price==-1?0:thread.price}" tabindex="206" /> <em class="tips">${extcredit.unit} (最高 ${usergroups.maxprice} ${extcredit.unit}<c:if test="${settings.maxincperthread>0}">,单一主题作者最高收入 ${settings.maxincperthread>0} ${extcredit.unit}</c:if><c:if test="${settings.maxchargespan>0}">,最高出售时限 ${settings.maxchargespan} 小时</c:if>) 您可以使用 <code><strong>[free]</strong>message<strong>[/free]</strong></code> 代码发表无需付费也能查看的免费信息</em></c:otherwise>
							</c:choose>
						</td>
					</tr>
				</c:if>
				<c:if test="${!(special>0)}">
					<tr>
						<th>图标</th>
						<td>
							<label><input class="radio" type="radio" name="iconid" value="0" checked="checked" tabindex="208" /> 无</label>
							<c:forEach items="${icons}" var="icon"><input class="radio" type="radio" name="iconid" value="${icon.key}" ${thread.iconid==icon.key?"checked":""}/><img src="images/icons/${icon.value}" alt="" /> </c:forEach>
							<br />
						</td>
					</tr>
				</c:if>
			</c:if>
			<tr class="btns">
				<th>&nbsp;</th>
				<td>
					<input type="hidden" name="special" value="${special}">
					<input type="hidden" name="isfirst" value="${isfirstpost}">
					<input type="hidden" name="page" value="${param.page}">
					<input type="hidden" name="wysiwyg" id="${editorid}_mode" value="${editormode}" />
					<input type="hidden" name="fid" id="fid" value="${fid}" />
					<input type="hidden" name="tid" value="${thread.tid}" />
					<input type="hidden" name="pid" value="${post.pid}" />
					<input type="hidden" name="postsubject" value="${post.subject}" />
					<button type="submit" name="editsubmit" id="postsubmit" value="true" tabindex="300">
						<c:choose>
							<c:when test="${isfirstpost&& special == 1}">编辑投票主题</c:when>
							<c:when test="${isfirstpost&& special == 3}">编辑悬赏主题</c:when>
							<c:when test="${isfirstpost&& special == 5}">编辑辩论主题</c:when>
							<c:otherwise>编辑帖子</c:otherwise>
						</c:choose>
					</button>
					<em>[完成后可按 Ctrl+Enter 发布]</em>&nbsp;&nbsp; &nbsp;<a href="###" id="restoredata" onclick="loadData()" title="恢复上次自动保存的数据">恢复数据</a>
				</td>
			</tr>
		</table>
	</div>
<jsp:include flush="true" page="post_editpost_attachlist.jsp"/>
</form>
<jsp:include flush="true" page="post_js.jsp" />
<script type="text/javascript">
	function checkuserexists(username, objname) {
		var x = new Ajax();
		username = is_ie && document.charset == 'utf-8' ? encodeURIComponent(username) : username;
		x.get('ajax.jsp?inajax=1&action=checkuserexists&username=' + username, function(s){
			var obj = $(objname);
			obj.innerHTML = s;
		});
	}
	if(${thread.typeid>0&&isfirstpost}){
		ajaxget('post.jsp?action=threadtypes&tid=${thread.tid}&fid=${thread.fid}&typeid=${thread.typeid}&themeid=1', 'threadtypes', 'threadtypeswait');
	}
	</script>
<jsp:include flush="true" page="footer.jsp" />

⌨️ 快捷键说明

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