?? index.jsp
字號:
<%
/**
* $RCSfile: index.jsp,v $
* $Revision: 1.4 $
* $Date: 2000/12/27 22:39:45 $
*/
%>
<%@ page
import="java.util.*,
java.text.*,
com.coolservlets.forum.*,
com.coolservlets.forum.util.*"
errorPage="/mainctrl/bbs/error"
%>
<% // get parameters
boolean logout = ParamUtils.getBooleanParameter(request, "logout");
int forumID = ParamUtils.getIntParameter(request, "forum", -1);
long lastVisited = SkinUtils.getLastVisited(request, response);
%>
<% // logout if requested:
if (logout) {
SkinUtils.removeUserAuthorization(request, response);
response.sendRedirect("/mainctrl/bbs/index");
return;
}
%>
<% ////////////////////////
// Authorization check
// check for the existence of an authorization token
Authorization authToken = SkinUtils.getUserAuthorization(request,response);
// if the token was null, they're not authorized. Since this skin will
// allow guests to view forums, we'll set a "guest" authentication
// token
if( authToken == null ) {
authToken = AuthorizationFactory.getAnonymousAuthorization();
}
%>
<% // get a forum factory and forum iterator
ForumFactory forumFactory = ForumFactory.getInstance(authToken);
Iterator forumIterator = forumFactory.forums();
%>
<% /////////////////
// header include
String title = "BBS論壇";
%>
<%@ include file="/skins/bay/header.jsp" %>
<table cellpadding="0" bgcolor=#666666 cellspacing="0" border="0" width="100%">
<tr>
<td>
<font class="strongw"><a href="/mainctrl/home/index"><font color="#FFFFFF">首頁</font></a>>><a href="/mainctrl/communication/main"><font color="#FFFFFF">通信</font></a>>><a href="/mainctrl/bbs/index"><font color="#FFFFFF">論壇主頁</font></a>>>鐵通BBS論壇</font> </td>
</tr>
</table>
<table cellpadding="0" bgcolor=#fafafa cellspacing="0" border="0" width="100%">
<tr >
<td width="1%"><img src="/skins/bay/images/blank.gif" width=30 height=1 border=0></td>
<td width="98%" valign="top">
<%-- begin main content --%>
<br>
<p>
<% // check to see if there are no forums
if( !forumIterator.hasNext() ) {
%>
<ul>
系統(tǒng)沒有設(shè)置論壇,或者您沒有權(quán)限訪問任何論壇。
</ul>
<% } else { %>
<table border="0" cellpadding="3" cellspacing="0">
<% while( forumIterator.hasNext() ) {
Forum forum = (Forum)forumIterator.next();
int id = forum.getID();
String name = forum.getName();
String description = forum.getDescription();
int numThreads = forum.getThreadCount();
int numMessages = forum.getMessageCount();
long lastModified= forum.getModifiedDate().getTime();
%>
<tr>
<td width="1%" nowrap>
<% if (lastModified > lastVisited) { %>
<img src="/skins/bay/images/new.gif">
<% } else { %>
•
<% } %>
</td>
<td width="99%">
<font face="verdana" >
<font class="strong"><a href="/mainctrl/bbs/viewForum?forum=<%= id %>" class="normal">
<%= name %>
</a></font>
(<%= description %>)
</font>
<br>
<font face="verdana" >
(<%= numThreads %>主題,
<%= numMessages %>帖子)
</font>
</td>
</tr>
<% } %>
</table>
<% } %>
<%-- end main content --%>
</td>
<%-- recent dicussions --%>
<td valign="top" width="1%">
<table bgcolor="#999999" cellpadding="1" cellspacing="0" border="0" width="220">
<td>
<jsp:include page="/skins/bay/recentMessages.jsp" flush="true"/>
</td>
</table>
</td>
<%-- end recent dicussions --%>
</tr>
</table>
<p>
<%@ include file="/skins/bay/footer.jsp" %>
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -