post.jsp
来自「Jive是基于JSP/JAVA技术构架的一个大型BBS论坛系统,这是Jive论坛」· JSP 代码 · 共 661 行 · 第 1/2 页
JSP
661 行
<% if (isMsgModOn) { %> <p> <font color="#cc3300"> <%= SkinUtils.getLocalizedString("skin.default.post.reply_moderate",locale) %> </font> <% } %><% } else { %> <%= SkinUtils.getLocalizedString("skin.default.post.new_description",locale) %> <% if (isThreadModOn) { %> <p> <font color="#cc3300"> <%= SkinUtils.getLocalizedString("skin.default.post.new_moderate",locale) %> </font> <% } %><% } %></font><p><% if (doPost && (!subjectOK || !bodyOK)) { %> <font size="<%= JiveGlobals.getJiveProperty("skin.default.fontSize") %>" color="#990000" face="<%= JiveGlobals.getJiveProperty("skin.default.fontFace") %>"> <% if (!subjectOK) { %> <i><%= SkinUtils.getLocalizedString("skin.default.post.error_subject",locale) %></i> <% } else if (!bodyOK) { %> <i><%= SkinUtils.getLocalizedString("skin.default.post.error_body",locale) %></i> <% } %> </font> <p><% } %><script language="JavaScript" type="text/javascript"><!--var pc = navigator.userAgent.toLowerCase();var ie4_win = (pc.indexOf("win")!=-1) && (pc.indexOf("msie") != -1) && (parseInt(navigator.appVersion) >= 4);var checked = false;function checkPost() { if (!checked) { checked = true; return true; } return false;}function styleTag(tag, ta) { var tagOpen = '[' + tag.toLowerCase() + ']'; var tagClose = '[/' + tag.toLowerCase() + ']'; if (ie4_win) { var selected = document.selection.createRange().text; if (selected) { var addSpace = false; if (selected.charAt(selected.length-1) == ' ') { selected = selected.substring(0, selected.length-1); addSpace = true; } document.selection.createRange().text = tagOpen + selected + tagClose + ((addSpace)?" ":""); } else { ta.value += tagOpen + tagClose; } } else { ta.value += tagOpen + tagClose; } ta.focus(); return;}function caret(ta) { if (ie4_win && ta.createTextRange) { ta.caretPos = document.selection.createRange().duplicate(); }}//--></script><form action="post.jsp" method="post" name="postForm" onsubmit="return checkPost();"><input type="hidden" name="doPost" value="true"><input type="hidden" name="reply" value="<%=reply%>"><input type="hidden" name="forum" value="<%=forumID%>"><input type="hidden" name="thread" value="<%=threadID%>"><input type="hidden" name="message" value="<%=messageID%>"><% if (!isGuest) { %><input type="hidden" name="isLoggedIn" value="true"><% } %><% // Add an "Re: " to the subject if this is a reply if (reply) { subject = parentMessage.getSubject(); if (!subject.startsWith(SkinUtils.getLocalizedString("skin.default.post.reply_prefix",locale) + " ")) { subject = SkinUtils.getLocalizedString("skin.default.post.reply_prefix",locale) + " " + subject; } } // Escape any quotes in the subject. if (subject != null) { subject = StringUtils.replace(subject, "\"", """); }%><table cellpadding="4" cellspacing="0" border="0"><% // Tabindex vars: int tabIndex = 1;%><% if (isGuest) { %><tr> <td align="right"><font size="<%= JiveGlobals.getJiveProperty("skin.default.fontSize") %>" face="<%= JiveGlobals.getJiveProperty("skin.default.fontFace") %>"><%= SkinUtils.getLocalizedString("skin.default.global.name",locale) %></font></td> <td><input type="text" name="name" value="<%= ((name!=null)?name:"") %>" size="30" maxlength="75" tabindex="<%= (tabIndex++) %>"></td></tr><tr> <td align="right"><font size="<%= JiveGlobals.getJiveProperty("skin.default.fontSize") %>" face="<%= JiveGlobals.getJiveProperty("skin.default.fontFace") %>"><%= SkinUtils.getLocalizedString("skin.default.global.email",locale) %></font></td> <td><input type="text" name="email" value="<%= ((email!=null)?email:"") %>" size="30" maxlength="75" tabindex="<%= (tabIndex++) %>"></td></tr><% } %><tr> <td align="right"><font size="<%= JiveGlobals.getJiveProperty("skin.default.fontSize") %>" face="<%= JiveGlobals.getJiveProperty("skin.default.fontFace") %>"><%= SkinUtils.getLocalizedString("skin.default.global.subject",locale) %></font></td> <td><input type="text" name="subject" value="<%= ((subject!=null)?subject:"") %>" size="40" maxlength="75" tabindex="<%= (tabIndex++) %>"></td></tr><% // Display the "Quote Original" button if (reply) { %><tr> <td> </td> <td><font size="<%= JiveGlobals.getJiveProperty("skin.default.fontSize") %>" face="<%= JiveGlobals.getJiveProperty("skin.default.fontFace") %>"> <a href="post.jsp?forum=<%=forumID%>&thread=<%=threadID%>&message=<%=messageID%>&reply=<%=reply%>"e=true" ><%= SkinUtils.getLocalizedString("skin.default.global.left_bracket",locale) %><%= SkinUtils.getLocalizedString("skin.default.post.quote",locale) %><%= SkinUtils.getLocalizedString("skin.default.global.right_bracket",locale) %></a> </font> </td></tr><% } %><tr> <td> </td> <td> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td> <a href="#" onclick="styleTag('b',document.postForm.body);return false;" title="<%= SkinUtils.getLocalizedString("skin.default.post.bold",locale) %>" ><img src="images/bold.gif" width="20" height="22" border="0"></a> </td> <td><img src="images/blank.gif" width="5" height="1" border="0"></td> <td> <a href="#" onclick="styleTag('i',document.postForm.body);return false;" title="<%= SkinUtils.getLocalizedString("skin.default.post.italic",locale) %>" ><img src="images/italics.gif" width="20" height="22" border="0"></a> </td> <td><img src="images/blank.gif" width="5" height="1" border="0"></td> <td> <a href="#" onclick="styleTag('u',document.postForm.body);return false;" title="<%= SkinUtils.getLocalizedString("skin.default.post.underline",locale) %>" ><img src="images/underline.gif" width="20" height="22" border="0"></a> </td> </tr> </table> </td></tr><tr> <td valign="top" align="right"> <font size="<%= JiveGlobals.getJiveProperty("skin.default.fontSize") %>" face="<%= JiveGlobals.getJiveProperty("skin.default.fontFace") %>"><% if (reply) { %> <%= SkinUtils.getLocalizedString("skin.default.post.your_reply",locale) %><% } else { %> <%= SkinUtils.getLocalizedString("skin.default.global.message",locale) %><% } %> </font> </td><% int textareaCols = 58; int textareaRows = 12; if (quote) { String pBody = parentMessage.getUnfilteredBody(); if (pBody != null) { body = SkinUtils.quoteOriginal(pBody,"> ",54); body += "\n"; } }%> <td><textarea name="body" wrap="virtual" cols="<%= textareaCols %>" rows="<%= textareaRows %>" tabindex="<%= (tabIndex++) %>"><%= ((body!=null)?body:"") %></textarea> </td></tr><% if (!isGuest) { %><tr> <td> </td> <% if (reply) { %> <input type="hidden" name="wasAutoWatchReplies" value="<%= (autoWatchReplies)?"true":"false" %>"> <td><input type="checkbox" name="addWatch" tabindex="<%= (tabIndex++) %>" id="cb"<%= (autoWatchReplies)?" checked":"" %>> <font size="<%= JiveGlobals.getJiveProperty("skin.default.fontSize") %>" face="<%= JiveGlobals.getJiveProperty("skin.default.fontFace") %>" ><label for="cb"><%= SkinUtils.getLocalizedString("skin.default.global.watch_topic",locale) %></label></font> </td> <% } else { %> <input type="hidden" name="wasAutoWatchNewTopics" value="<%= (autoWatchNewTopics)?"true":"false" %>"> <td><input type="checkbox" name="addWatch" tabindex="<%= (tabIndex++) %>" id="cb"<%= (autoWatchNewTopics)?" checked":"" %>> <font size="<%= JiveGlobals.getJiveProperty("skin.default.fontSize") %>" face="<%= JiveGlobals.getJiveProperty("skin.default.fontFace") %>" ><label for="cb"><%= SkinUtils.getLocalizedString("skin.default.global.watch_topic",locale) %></label></font> </td> <% } %></tr><% } %><tr> <td> </td> <td> <input type="submit" value="<%= SkinUtils.getLocalizedString("skin.default.global.preview",locale) %>" name="preview" tabindex="<%= (tabIndex++) %>"> <input type="submit" value="<%= SkinUtils.getLocalizedString("skin.default.post.post_message",locale) %>" tabindex="<%= (tabIndex++) %>"> <input type="submit" value="<%= SkinUtils.getLocalizedString("skin.default.global.cancel",locale) %>" name="cancel" tabindex="<%= (tabIndex++) %>"> </td></tr></table><script language="JavaScript" type="text/javascript"><!--<% if (isGuest) { %> document.postForm.name.focus();<% } else { %> <% if (subject == null) { %> document.postForm.subject.focus(); <% } else { %> document.postForm.body.focus(); <% } %><% } %>//--></script></form><p><% // Show the original message if (reply) { User author = parentMessage.getUser(); long parentForumID = parentMessage.getForumThread().getForum().getID(); long parentThreadID = parentMessage.getForumThread().getID(); long parentID = parentMessage.getID();%> <font size="<%= JiveGlobals.getJiveProperty("skin.default.fontSize") %>" face="<%= JiveGlobals.getJiveProperty("skin.default.fontFace") %>"> <b><%= SkinUtils.getLocalizedString("skin.default.post.original",locale) %></b> </font> <p> <table bgcolor="<%= JiveGlobals.getJiveProperty("skin.default.tableBorderColor") %>" cellpadding="0" cellspacing="0" border="0" width="100%"> <tr><td> <table bgcolor="<%= JiveGlobals.getJiveProperty("skin.default.tableBorderColor") %>" cellpadding="4" cellspacing="1" border="0" width="100%"> <tr bgcolor="<%= JiveGlobals.getJiveProperty("skin.default.tableRowColor1") %>"> <td width="1%" rowspan="2" valign="top"> <table cellpadding="0" cellspacing="0" border="0" width="140"> <tr><td> <font size="<%= JiveGlobals.getJiveProperty("skin.default.fontSize") %>" face="<%= JiveGlobals.getJiveProperty("skin.default.fontFace") %>"><% if (author == null) { // Check to see if there is an extended property for name & email // since the gateway feature imports names and emails as extended // props. String guestName = parentMessage.getProperty("name"); String guestEmail = parentMessage.getProperty("email"); String nameAndEmail = getNameAndEmailDisplay(guestName, guestEmail); if (nameAndEmail != null) {%> <i><%= SkinUtils.getLocalizedString("skin.default.global.guest",locale) %><%= SkinUtils.getLocalizedString("skin.default.global.colon",locale) %> <%= nameAndEmail %></i><% } else { %> <i><%= SkinUtils.getLocalizedString("skin.default.global.guest",locale) %></i><% } } else { // author != null String authorName = author.getName(); String userStatus = author.getProperty("status");%> <a href="profile.jsp?user=<%= author.getID() %>" title="<%= (authorName!=null)?authorName:"" %>" ><b><%= author.getUsername() %></b></a> </font> <font size="<%= JiveGlobals.getJiveProperty("skin.default.headerFontSize") %>" face="<%= JiveGlobals.getJiveProperty("skin.default.headerFontFace") %>"> <br><br> <%= SkinUtils.getLocalizedString("skin.default.global.posts",locale) %><%= SkinUtils.getLocalizedString("skin.default.global.colon",locale) %> <%= SkinUtils.getLocalizedNumber(userManager.userMessageCount(author),locale) %> <br> <% String location = author.getProperty("location"); if (location != null) { %> <%= SkinUtils.getLocalizedString("skin.default.global.from",locale) %><%= SkinUtils.getLocalizedString("skin.default.global.colon",locale) %> <%= location %><br> <% } %> <%= SkinUtils.getLocalizedString("skin.default.global.registered",locale) %><%= SkinUtils.getLocalizedString("skin.default.global.colon",locale) %> <%= shortDateFormatter.format(author.getCreationDate()) %> <br><br><% } %> </font> </td> </tr> </table> </td> <td width="97%"> <font size="<%= JiveGlobals.getJiveProperty("skin.default.fontSize") %>" face="<%= JiveGlobals.getJiveProperty("skin.default.fontFace") %>"> <b><%= parentMessage.getSubject() %></b> </font> </td> <td width="1%" nowrap> <font size="<%= JiveGlobals.getJiveProperty("skin.default.fontSize") %>" face="<%= JiveGlobals.getJiveProperty("skin.default.fontFace") %>"> <%= SkinUtils.getLocalizedString("skin.default.global.posted",locale) %><%= SkinUtils.getLocalizedString("skin.default.global.colon",locale) %> <%= SkinUtils.formatDate(request,pageUser,parentMessage.getCreationDate()) %> </font> </td> <td width="1%" nowrap align="center"> <table cellpadding="2" cellspacing="0" border="0"> <tr> <td><img src="images/reply.gif" width="17" height="17" title="<%= SkinUtils.getLocalizedString("skin.default.thread.reply_message",locale) %>" hspace="3" border="0"></td> <td> <font size="<%= JiveGlobals.getJiveProperty("skin.default.fontSize") %>" face="<%= JiveGlobals.getJiveProperty("skin.default.fontFace") %>"> <b><%= SkinUtils.getLocalizedString("skin.default.global.reply",locale) %></b> </font> </td> </tr> </table> </td> </tr> <tr bgcolor="<%= JiveGlobals.getJiveProperty("skin.default.tableRowColor1") %>"> <td width="99%" colspan="3" valign="top"> <font size="<%= JiveGlobals.getJiveProperty("skin.default.fontSize") %>" face="<%= JiveGlobals.getJiveProperty("skin.default.fontFace") %>"> <%= parentMessage.getBody() %> </font> <p> </td> </tr> </table></td></tr></table><% } // end if reply %><br><%@ include file="footer.jsp" %>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?