forum.jsp
来自「Jive是基于JSP/JAVA技术构架的一个大型BBS论坛系统,这是Jive论坛」· JSP 代码 · 共 459 行 · 第 1/2 页
JSP
459 行
<%/** * $RCSfile: forum.jsp,v $ * $Revision: 1.18 $ * $Date: 2002/08/09 23:04:32 $ */%><%@ page import="java.util.*, com.jivesoftware.util.*, com.jivesoftware.forum.*, com.jivesoftware.forum.util.*" errorPage="error.jsp"%><%@ include file="global.jsp" %><% // Put the request URI and query string in the session as an attribute. // This is done so the error.jsp and auth.jsp pages can figure out what // page sent it an error and redirect appropriately. setRedirectURL(request);%><% // Get parameters long forumID = ParamUtils.getLongParameter(request,"forum",-1L); int start = ParamUtils.getIntParameter(request,"start",0); int range = getThreadRange(request,response,pageUser); // Load the forum Forum forum = forumFactory.getForum(forumID); // Check the session for the start value. This way, the user can return to the correct place // in the thread list: if (request.getParameter("start") == null) { try { start = Integer.parseInt((String)session.getAttribute("jive.forum."+forumID+".start")); } catch (NumberFormatException nfe) {} } else { // If we found a valid start value, put it in the session session.setAttribute("jive.forum."+forumID+".start", String.valueOf(start)); } // Pass in the forum name to the title i18n string: List titleDisplay = new ArrayList(1); titleDisplay.add(forum.getName()); String title = SkinUtils.getLocalizedString("skin.default.forum.title", locale, titleDisplay);%><%@ include file="header.jsp" %><% // Create a ResultFilter for creating thread iterators and getting thread // counts ResultFilter filter = new ResultFilter(); filter.setStartIndex(start); filter.setNumResults(range); // Set the moderation level minimum filter.setModerationRangeMin(forum.getModerationMinThreadValue()); // More forum properties int numThreads = forum.getThreadCount(filter); int numMessages = forum.getMessageCount(filter); // Iterator of threads ForumThreadIterator threads = forum.threads(filter);%><table cellpadding="0" cellspacing="0" border="0" width="100%"><tr> <td valign="top" width="99%"> <%-- Breadcrumbs --%> <font face="<%= JiveGlobals.getJiveProperty("skin.default.fontFace") %>" color="<%= JiveGlobals.getJiveProperty("skin.default.linkColor") %>"> <b> <a href="<%= JiveGlobals.getJiveProperty("skin.default.homeURL") %>" ><%= SkinUtils.getLocalizedString("skin.default.global.home",locale) %></a> » <a href="index.jsp" title="<%= SkinUtils.getLocalizedString("skin.default.global.go_back_to_forum_list",locale) %>" ><%= SkinUtils.getLocalizedString("skin.default.global.forums",locale) %></a> » <a href="forum.jsp?forum=<%= forumID %>" title="<%= SkinUtils.getLocalizedString("skin.default.global.go_back_to_topic_list",locale) %>" ><%= forum.getName() %></a> </b> </font> <br> <%-- Forum description, message & thread count summaries --%> <font size="<%= JiveGlobals.getJiveProperty("skin.default.fontSize") %>" face="<%= JiveGlobals.getJiveProperty("skin.default.fontFace") %>" color="<%= JiveGlobals.getJiveProperty("skin.default.textColor") %>"> <% // Indicate how to render the number of messages and topics. Include any // HTML markup you want in the strings below: List countDisplay = new ArrayList(2); countDisplay.add("<b>" + numMessages + "</b>"); countDisplay.add("<b>" + numThreads + "</b>"); %> <%= SkinUtils.getLocalizedString("skin.default.global.messages",locale) %><%= SkinUtils.getLocalizedString("skin.default.global.colon",locale) %> <b><%= SkinUtils.getLocalizedNumber(numMessages,locale) %></b> <%= SkinUtils.getLocalizedString("skin.default.global.topics",locale) %><%= SkinUtils.getLocalizedString("skin.default.global.colon",locale) %> <b><%= SkinUtils.getLocalizedNumber(numThreads,locale) %></b> <% if (forum.getMessageCount() > 0) { %> <%= SkinUtils.getLocalizedString("skin.default.global.last_post",locale) %><%= SkinUtils.getLocalizedString("skin.default.global.colon",locale) %> <%= SkinUtils.formatDate(request,pageUser,forum.getModifiedDate()) %> <% } %> <p> <font size="<%= JiveGlobals.getJiveProperty("skin.default.fontSize") %>" face="<%= JiveGlobals.getJiveProperty("skin.default.fontFace") %>"> <% String description = forum.getDescription(); %> <i><%= (description!=null)?description:"" %></i> </font> </td> <td valign="top" width="1%" align="center"> <%@ include file="loginbox.jsp" %> </td></tr></table><% if (isGuest) { %><p><% } %><table cellpadding="0" cellspacing="2" border="0"><tr> <td><a href="post.jsp?forum=<%= forumID %>"><img src="images/post.gif" width="17" height="17" title="<%= SkinUtils.getLocalizedString("skin.default.forum.start_new_topic",locale) %>" border="0"></a></td> <td nowrap><font size="<%= JiveGlobals.getJiveProperty("skin.default.buttonFontSize") %>" face="<%= JiveGlobals.getJiveProperty("skin.default.buttonFontFace") %>"> <a href="post.jsp?forum=<%= forumID %>" title="<%= SkinUtils.getLocalizedString("skin.default.forum.start_new_topic",locale) %>"><%= SkinUtils.getLocalizedString("skin.default.global.post_new_topic",locale) %></a> </font> </td> <td><img src="images/blank.gif" width="10" height="1" border="0"></td> <% if ("true".equals(JiveGlobals.getJiveProperty("search.enabled"))) { %> <td><a href="search.jsp?forums=<%= forumID %>"><img src="images/search.gif" width="17" height="17" title="<%= SkinUtils.getLocalizedString("skin.default.forum.search_in_forum",locale) %>" border="0"></a></td> <td nowrap><font size="<%= JiveGlobals.getJiveProperty("skin.default.buttonFontSize") %>" face="<%= JiveGlobals.getJiveProperty("skin.default.buttonFontFace") %>"> <a href="search.jsp?forums=<%= forumID %>" title="<%= SkinUtils.getLocalizedString("skin.default.forum.search_in_forum",locale) %>"><%= SkinUtils.getLocalizedString("skin.default.global.search_forum",locale) %></a> </font> </td> <td><img src="images/blank.gif" width="30" height="1" border="0"></td> <% } %> <td><a href="index.jsp"><img src="images/back_to.gif" width="12" height="12" title="<%= SkinUtils.getLocalizedString("skin.default.forum.go_back_to_forum",locale) %>" border="0"></a></td> <td nowrap><font size="<%= JiveGlobals.getJiveProperty("skin.default.buttonFontSize") %>" face="<%= JiveGlobals.getJiveProperty("skin.default.buttonFontFace") %>"> <a href="index.jsp" title="<%= SkinUtils.getLocalizedString("skin.default.forum.go_back_to_forum",locale) %>"><%= SkinUtils.getLocalizedString("skin.default.forum.forum_list",locale) %></a> </font> </td></tr></table><p><% // Number of int numPages = 0; if (numThreads != range) { numPages = (int)Math.ceil((double)numThreads/(double)range); } else { numPages = 1; }%><% Map i18n = new HashMap(); i18n.put("goFirstTopic", SkinUtils.getLocalizedString("skin.default.forum.go_to_first_topic_page",locale)); i18n.put("previousPage", SkinUtils.getLocalizedString("skin.default.global.previous_page",locale)); i18n.put("nextPage", SkinUtils.getLocalizedString("skin.default.global.next_page",locale)); String paginatorHTML = getForumPaginator(forumID, numThreads, numPages, start, range,locale);%><% if (numThreads > 0) { %><table cellpadding="3" cellspacing="0" border="0" width="100%"><tr> <td> <font size="<%= JiveGlobals.getJiveProperty("skin.default.fontSize") %>" face="<%= JiveGlobals.getJiveProperty("skin.default.fontFace") %>"> <%= SkinUtils.getLocalizedString("skin.default.forum.pages_in_forum",locale) %><%= SkinUtils.getLocalizedString("skin.default.global.colon",locale) %> <b><%= numPages %></b> <%= paginatorHTML %> </font> </td></tr></table><% } %><% if (!threads.hasNext()) { %> <center> <font size="<%= JiveGlobals.getJiveProperty("skin.default.fontSize") %>" face="<%= JiveGlobals.getJiveProperty("skin.default.fontFace") %>"> <i><%= SkinUtils.getLocalizedString("skin.default.forum.no_topics",locale) %></i> </font> </center><% } else { %><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="3" cellspacing="1" border="0" width="100%"> <tr bgcolor="<%= JiveGlobals.getJiveProperty("skin.default.tableHeaderBgColor") %>"> <td width="1%"> </td> <td width="96%"> <font size="<%= JiveGlobals.getJiveProperty("skin.default.headerFontSize") %>" color="<%= JiveGlobals.getJiveProperty("skin.default.tableHeaderTextColor") %>" face="<%= JiveGlobals.getJiveProperty("skin.default.headerFontFace") %>"> <b> <%= SkinUtils.getLocalizedString("skin.default.global.subject",locale).toUpperCase(JiveGlobals.getLocale()) %></b> </font> </td> <td width="1%" nowrap> <font size="<%= JiveGlobals.getJiveProperty("skin.default.headerFontSize") %>" color="<%= JiveGlobals.getJiveProperty("skin.default.tableHeaderTextColor") %>" face="<%= JiveGlobals.getJiveProperty("skin.default.headerFontFace") %>"> <b> <%= SkinUtils.getLocalizedString("skin.default.global.replies",locale).toUpperCase(JiveGlobals.getLocale()) %> </b> </font> </td> <td width="1%" align="center" nowrap> <font size="<%= JiveGlobals.getJiveProperty("skin.default.headerFontSize") %>" color="<%= JiveGlobals.getJiveProperty("skin.default.tableHeaderTextColor") %>" face="<%= JiveGlobals.getJiveProperty("skin.default.headerFontFace") %>"> <b> <%= SkinUtils.getLocalizedString("skin.default.global.author",locale).toUpperCase(JiveGlobals.getLocale()) %> </b> </font> </td> <td width="1%" nowrap align="center"> <font size="<%= JiveGlobals.getJiveProperty("skin.default.headerFontSize") %>" color="<%= JiveGlobals.getJiveProperty("skin.default.tableHeaderTextColor") %>" face="<%= JiveGlobals.getJiveProperty("skin.default.headerFontFace") %>"> <b><%= SkinUtils.getLocalizedString("skin.default.global.last_post",locale).toUpperCase(JiveGlobals.getLocale()) %></b> </font> </td> </tr>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?