<%@ page import="java.util.*, java.text.*, com.Yasna.forum.*, com.Yasna.forum.util.*" %> <%@ include file="../authenticate_i.jsp" %> <% ///////////// // Header // The header file looks for the following variables. String pageTitle = "Boulder Biodiesel Forum"; %> <%@ include file="../header_i.jsp" %> <%! ////////////////////////////////// // customize the look of this page // Colors of the table that displays a list of forums final static String threadTableBgcolor = "#006600"; final static String threadTableFgcolor = "#99ff66"; final static String threadTableHeaderFgcolor = "#66dd33"; final static String threadTableHiLiteColor = "#00ff00"; final static String threadPagingRowColor = "#99ee66"; %> <%! /////////////////// // global variables // number of threads to display per page: private final int[] threadRange = { 15,25,50,100 }; // default starting index and number of threads to display // per page (for paging) private final int DEFAULT_RANGE = 15; private final int START_INDEX = 0; %> <% ////////////////////// // get parameters int range = ParamUtils.getIntParameter(request,"range",DEFAULT_RANGE); int start = ParamUtils.getIntParameter(request,"start",0); int forumID = ParamUtils.getIntParameter(request,"forum",1); %> <% //////////////////// // Load up the forum // If the forum is not found, a ForumNotFoundException will be thrown // and the user will be redirected to the error page Forum forum = forumFactory.getForum(forumID); // Get some properties of the forum String forumName = forum.getName(); int numThreads = forum.getThreadCount(); int numMessages = forum.getMessageCount(); %> <% boolean canPost = false; try { canPost = forum.hasPermission(ForumPermissions.CREATE_THREAD); } catch (Exception ignore) {} %> <% ///////////// // Toolbar // The toolbar file looks for the following variables. To make a particular // "button" not appear, set a variable to null. boolean showToolbar = true; String viewLink = null; String postLink = (canPost) ? "../forum/post.jsp?forum=" + forumID : null; String replyLink = null; String searchLink = null; // we can show a link to a user account if the user is logged in (handled // in the toolbar jsp) String accountLink = "../forum/userAccount.jsp"; %> <%@ include file="../toolbar_i.jsp" %> <% //////////////////// // Breadcrumb bar // The breadcrumb file looks for the variable "breadcrumbs" which // represents a navigational path, ie "Home > My Forum > Hello World" String[][] breadcrumbs = { { "Home", "../" }, { "Forums", "./" }, { forumName, "" } }; %> <%@ include file="../breadcrumb_i.jsp" %> <%@ include file="../forum/search_i.jsp" %> <%-- table for list of threads --%>

Topics: <%= numThreads %>, Messages: <%= numMessages %>

<%-- paging row --%> <%-- /paging row --%> <% ///////////////////// // get an iterator of threads Iterator threadIterator = forum.threads(start,range); if( !threadIterator.hasNext() ) { %> <% } while( threadIterator.hasNext() ) { ForumThread thread = (ForumThread)threadIterator.next(); int threadID = thread.getID(); ForumMessage rootMessage = thread.getRootMessage(); String threadName = rootMessage.getSubject(); if( threadName == null ) { threadName = "no subject"; } boolean rootMsgIsAnonymous = rootMessage.isAnonymous(); User rootMessageUser = rootMessage.getUser(); String username = rootMessageUser.getUsername(); String name = rootMessageUser.getName(); String email = rootMessageUser.getEmail(); Date lastModified = thread.getModifiedDate(); boolean wasModified = (userLastVisitedTime < lastModified.getTime()); %> <% } %> <%-- paging row --%> <%-- /paging row --%>
<%-- table for paging --%> <%-- // --%>
<% if (start > 0 && range > 0) { %> Previous <% if (range > 1) { %><%= range %> threads<% } else { %>thread<% } %> <% } %>   <% if (canPost) { %> // Post a new topic // <% } else { %> <% } %>    <% if( numThreads > (start+range) ) { int numRemaining = (numThreads-(start+range)); int nextNum = (numRemaining>range) ? range : numRemaining; %> Next <% if (nextNum > 1) { %><%= nextNum %> threads<% } else { %>thread<% } %> <% } %>
<%-- /table for paging --%>
new subject replies posted by date posted

No topics in this forum. Try adding your own.

.gif" width="8" height="8" border="0"> <%= threadName %> <%= (thread.getMessageCount()-1) %> <% if( rootMsgIsAnonymous ) { String savedName = rootMessage.getProperty("name"); String savedEmail = rootMessage.getProperty("email"); String displayName = "Anonymous"; if( savedName != null ) { displayName = "" + savedName + ""; } if( savedEmail != null ) { displayName = "" + displayName + ""; } %> <%= displayName %> <% } else { boolean emailReadable = rootMessageUser.isEmailVisible(); String displayName = username; if( emailReadable ) { displayName = "" + displayName + ""; } %> <%= displayName %> <% } %> <%= SkinUtils.dateToText( rootMessage.getCreationDate() ) %>
<%-- table for paging --%>
<% if( start > 0 ) { %> Previous <% if (range > 1) { %><%= range %> threads<% } else { %>thread<% } %> <% } %>       <% if( numThreads > (start+range) ) { int numRemaining = (numThreads-(start+range)); int nextNum = (numRemaining>range) ? range : numRemaining; %> Next <% if (nextNum > 1) { %><%= nextNum %> threads<% } else { %>thread<% } %> <% } %>
<%-- /table for paging --%>

<%-- range options --%>

Show me messages per page.
<%-- /range options --%> <% ///////////////////// // page footer %> <%@ include file="../footer_i.jsp" %>