<% /** * $RCSfile: index.jsp,v $ * $Revision: 1.8 $ * $Date: 2001/10/10 06:31:16 $ */ %> <%@ page import="java.util.*, com.jivesoftware.forum.*, com.jivesoftware.forum.util.*" errorPage="error.jsp" %> <% // global.jsp is a collection of utility methods and global variables. // Page authorization and the creation of the authToken and forumFactory // variables is handled there. %> <%@ include file="global.jsp" %> <% // The title of this page. The header page assumes the "title" variable. String title = "Forums - Welcome"; request.setAttribute("jive_page_title", title); %>
<%-- breadcrumbs --%> " color="<%= JiveGlobals.getJiveProperty("skin.default.linkColor") %>"> " >Home » Forums

<%-- text describing your community --%> " color="<%= JiveGlobals.getJiveProperty("skin.default.textColor") %>"> <%= JiveGlobals.getJiveProperty("skin.default.communityDescription") %>

<%@ include file="loginbox.jsp" %>

<%-- forum listing cell --%> " cellpadding="0" cellspacing="0" border="0" width="100%">
" cellpadding="4" cellspacing="1" border="0" width="100%"> "> <% Iterator forums = forumFactory.forums(); while (forums.hasNext()) { Forum forum = (Forum)forums.next(); String description = forum.getDescription(); boolean isNew = (forum.getModifiedDate().getTime() > lastVisited.getTime()); %> "> <% } %>
" face="<%= JiveGlobals.getJiveProperty("skin.default.headerFontFace") %>">FORUM NAME " face="<%= JiveGlobals.getJiveProperty("skin.default.headerFontFace") %>">TOPICS / MESSAGES " face="<%= JiveGlobals.getJiveProperty("skin.default.headerFontFace") %>">LAST POST
<% if (isNew) { %> <% } else { %> <% } %> " color="<%= JiveGlobals.getJiveProperty("skin.default.textColor") %>"> <%= forum.getName() %>
<%= (description!=null)?description:"" %>
" color="<%= JiveGlobals.getJiveProperty("skin.default.textColor") %>"> <%= forum.getThreadCount() %> / <%= forum.getMessageCount() %> " color="<%= JiveGlobals.getJiveProperty("skin.default.textColor") %>"> <%= SkinUtils.formatDate(request,response,pageUser,forum.getModifiedDate()) %>

" color="<%= JiveGlobals.getJiveProperty("skin.default.textColor") %>"> Denotes new messages since your last visit.
<%-- end forum listing cell --%>

<%-- popular discussions / search box cell --%> " cellpadding="1" cellspacing="0" border="0" width="200">
" cellpadding="4" cellspacing="0" border="0" width="100%">
" face="<%= JiveGlobals.getJiveProperty("skin.default.headerFontFace") %>" >SEARCH
" cellpadding="3" cellspacing="0" border="0" width="100%">
">

<% // Get an iterator of popular discussions Iterator popularDiscussions = forumFactory.popularThreads(); // only show the popular discussions box if there *are* popular discussions: if (popularDiscussions.hasNext()) { %> " cellpadding="1" cellspacing="0" border="0" width="200">
" cellpadding="4" cellspacing="0" border="0" width="100%">
" face="<%= JiveGlobals.getJiveProperty("skin.default.headerFontFace") %>" >POPULAR DISCUSSIONS
" cellpadding="3" cellspacing="0" border="0" width="100%"> <% while (popularDiscussions.hasNext()) { ForumThread thread = (ForumThread)popularDiscussions.next(); String subject = thread.getName(); // Clip the length of the subject if it's over a certain length. // This prevents long subjects from screwing up the layout of // the page. if (subject.length() > 25) { subject = StringUtils.chopAtWord(subject, 50) + ".."; } // Get the forum associated with this thread Forum forum = thread.getForum(); // Number of replies to the thread int numReplies = thread.getMessageCount()-1; %> <% } // end while %>
"> <%= subject %>
<%= numReplies %> <%= (numReplies==1)?"reply":"replies" %> (<%= forum.getName() %>)

<% } // end if popularDiscussions.hasNext() %> <%-- end popular discussions / search box cell --%>