?? index.jsp
字號:
<%@ page contentType="text/html;charset=ISO8859_1" %>
<%
/**
* $RCSfile: index.jsp,v $
* $Revision: 1.3 $
* $Date: 2002/09/30 14:56: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 = JiveGlobals.getJiveProperty("websiteconf.name");
%>
<%@ include file="header.jsp" %>
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<td valign="top" width="98%">
<%-- breadcrumbs --%>
<font face="<%= JiveGlobals.getJiveProperty("skin.default.fontFace") %>"
color="<%= JiveGlobals.getJiveProperty("skin.default.linkColor") %>">
<b>
<a href="<%= JiveGlobals.getJiveProperty("websiteconf.url") %>"
>首頁</a>
»
<a href="index.jsp" title="返回論壇列表"
>論壇</a>
</b>
</font>
<p>
<%-- text describing your community --%>
<font size="-1" face="<%= JiveGlobals.getJiveProperty("skin.default.fontFace") %>"
color="<%= JiveGlobals.getJiveProperty("skin.default.textColor") %>">
<%= JiveGlobals.getJiveProperty("skin.default.communityDescription") %>
</font>
</td>
<td width="1%"><img src="images/blank.gif" width="10" height="1" border="0"></td>
<td valign="top" width="1%" align="center">
<%@ include file="loginbox.jsp" %>
</td>
</tr>
</table>
<p>
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr><td width="98%" valign="top">
<%-- forum listing cell --%>
<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.tableHeaderBgColor") %>">
<td width="1%"><img src="images/blank.gif" width="1" height="1" border="0"></td>
<td width="97%"><font class="p4" color="<%= JiveGlobals.getJiveProperty("skin.default.tableHeaderTextColor") %>" face="<%= JiveGlobals.getJiveProperty("skin.default.headerFontFace") %>"><b>論壇名稱</b></font></td>
<td width="1%" nowrap><font class="p4" color="<%= JiveGlobals.getJiveProperty("skin.default.tableHeaderTextColor") %>" face="<%= JiveGlobals.getJiveProperty("skin.default.headerFontFace") %>"><b>主題 / 消息</b></font></td>
<td width="1%" nowrap align="center"><font class="p4" color="<%= JiveGlobals.getJiveProperty("skin.default.tableHeaderTextColor") %>" face="<%= JiveGlobals.getJiveProperty("skin.default.headerFontFace") %>"><b>最后更新</b></font></td>
</tr>
<% Iterator forums = myEnv.getForumFactory().forums();
while (forums.hasNext()) {
Forum forum = (Forum)forums.next();
String description = forum.getDescription();
boolean isNew = (forum.getModifiedDate().getTime() > lastVisited.getTime());
ForumMessage lastPost = myEnv.du.getLastPost(forum);
%>
<tr bgcolor="<%= JiveGlobals.getJiveProperty("skin.default.tableRowColor1") %>">
<td width="1%" align="center" valign="top">
<font size="-2" color="#ff0000">
<% if (isNew) { %>
<img src="images/forum_new.gif" width="12" height="12" vspace="2" border="0">
<% } else { %>
<img src="images/forum_old.gif" width="12" height="12" vspace="2" border="0">
<% } %>
</font>
</td>
<td width="97%">
<font size="-1" face="<%= JiveGlobals.getJiveProperty("skin.default.fontFace") %>"
color="<%= JiveGlobals.getJiveProperty("skin.default.textColor") %>">
<a href="forum.jsp?forum=<%= forum.getID() %>"><%= forum.getName() %></a>
<br>
<i><%= (description!=null)?description:"" %></i>
</font>
</td>
<td width="1%" nowrap align="center" valign="top">
<font size="-1" face="<%= JiveGlobals.getJiveProperty("skin.default.fontFace") %>"
color="<%= JiveGlobals.getJiveProperty("skin.default.textColor") %>">
<%= forum.getThreadCount() %> / <%= forum.getMessageCount() %>
</font>
</td>
<td width="1%" nowrap valign="top">
<font size="-1" face="<%= JiveGlobals.getJiveProperty("skin.default.fontFace") %>"
color="<%= JiveGlobals.getJiveProperty("skin.default.textColor") %>">
<%= SkinUtils.formatDate(request,response,pageUser,forum.getModifiedDate()) %>
</font>
<% if (lastPost != null) {
User lastPostAuthor = lastPost.getUser();
%>
<br>
<font size="-2" face="verdana">
<% if (lastPostAuthor == null) { %>
by: <i>Guest</i>
<% } else { %>
by: <a href="thread.jsp?forum=<%= lastPost.getForumThread().getForum().getID() %>&thread=<%= lastPost.getForumThread().getID() %>&message=<%= lastPost.getID() %>#<%= lastPost.getID() %>"
title="Jump to Message"
><%= lastPostAuthor.getUsername() %> »</a>
<% } %>
</font>
<% } %>
</td>
</tr>
<% } %>
</table>
</td></tr>
</table>
<p>
<table cellpadding="3" cellspacing="0" border="0">
<tr><td>
<img src="images/forum_new.gif" width="12" height="12" border="0">
</td><td>
<font class=p2 face="<%= JiveGlobals.getJiveProperty("skin.default.fontFace") %>"
color="<%= JiveGlobals.getJiveProperty("skin.default.textColor") %>">
<i>表示在你最后一次訪問有新消息發(fā)布!</i>
</font>
</td></tr>
</table>
<%-- end forum listing cell --%>
</td>
<td width="1%"><img src="images/blank.gif" width="10" height="1" border="0"></td>
<td width="1%" nowrap valign="top">
<% // Get an iterator of popular discussions
Iterator popularDiscussions = myEnv.getForumFactory().popularThreads();
// only show the popular discussions box if there *are* popular discussions:
if (popularDiscussions.hasNext()) {
%>
<table bgcolor="<%= JiveGlobals.getJiveProperty("skin.default.tableBorderColor") %>"
cellpadding="1" cellspacing="0" border="0" width="200">
<tr><td>
<table bgcolor="<%= JiveGlobals.getJiveProperty("skin.default.sidebarHeaderBgColor") %>"
cellpadding="4" cellspacing="0" border="0" width="100%">
<tr>
<td align="center"><font class=p2 color="<%= JiveGlobals.getJiveProperty("skin.default.sidebarHeaderTextColor") %>" face="<%= JiveGlobals.getJiveProperty("skin.default.headerFontFace") %>"
><b>熱點討論</b></font></td>
</tr>
</table>
</td></tr>
<tr><td>
<table bgcolor="<%= JiveGlobals.getJiveProperty("skin.default.sidebarBgColor") %>"
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;
%>
<tr>
<td valign="top" width="1%">
<font size="-1" face="arial"><b>•</b></font>
</td>
<td width="99%">
<font class=p1 face="<%= JiveGlobals.getJiveProperty("skin.default.fontFace") %>">
<a href="thread.jsp?forum=<%= forum.getID() %>&thread=<%= thread.getID() %>"><%= subject %></a><br>
<%= numReplies %> <%= (numReplies==1)?"回復":"回復" %>
(<%= forum.getName() %>)
</font>
</td></tr>
<% } // end while %>
</table>
<p>
<%-- popular discussions / search box cell --%>
<table bgcolor="<%= JiveGlobals.getJiveProperty("skin.default.tableBorderColor") %>"
cellpadding="1" cellspacing="0" border="0" width="200">
<tr><td>
<table bgcolor="<%= JiveGlobals.getJiveProperty("skin.default.sidebarHeaderBgColor") %>"
cellpadding="4" cellspacing="0" border="0" width="100%">
<tr>
<td align="center"><font class=p4 color="<%= JiveGlobals.getJiveProperty("skin.default.sidebarHeaderTextColor") %>" face="<%= JiveGlobals.getJiveProperty("skin.default.headerFontFace") %>"
><b>搜 索</b></font></td>
</tr>
</table>
</td></tr>
<tr><td>
<table bgcolor="<%= JiveGlobals.getJiveProperty("skin.default.sidebarBgColor") %>"
cellpadding="3" cellspacing="0" border="0" width="100%">
<form action="search.jsp" method="post" >
<input type="hidden" name="search" value="true">
<tr>
<td width="99%"><input type="text" name="q" style="width:100%;"></td>
<td width="1%"><input type="image" src="images/go.gif" width="17" height="17" border="0" alt="單擊進行搜索"></td>
</tr>
<tr>
<td colspan="2">
<font class=p2 face="<%= JiveGlobals.getJiveProperty("skin.default.fontFace") %>">
<select size="3" style="width:100%;" multiple name="forums">
<option value="-1" selected> 所有論壇 (默認)
<% // get the iterator of forums again
for (Iterator iter=myEnv.getForumFactory().forums(); iter.hasNext();) {
Forum forum = (Forum)iter.next();
// Trim the forum name
String forumName = forum.getName();
if (forumName.length() > 18) {
forumName = forumName.substring(0,18) + "..";
}
%>
<option value="<%= forum.getID() %>">
• <%= forumName %>
<% } %>
</select>
</font>
</td>
</tr>
</form>
</table>
</td></tr>
</table>
</td></tr>
</table>
<p>
<% } // end if popularDiscussions.hasNext() %>
<%-- end popular discussions / search box cell --%>
</td>
</tr></table>
<p>
<%@ include file="footer.jsp" %>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -