📄 listrecentthreads.jsp
字号:
<%--
- $Author: 飞鱼
- $Revision: 1.22 $
- $Date: 2003/02/01 09:41:34 $
- http://www.hnedu.net/fiyu
--%>
<%@ page contentType="text/html;charset=utf-8" %>
<%@ page errorPage="fatalerror.jsp"%>
<%@ page import="java.util.Collection" %>
<%@ page import="java.util.Iterator" %>
<%@ page import="fiyucore.util.ParamUtil" %>
<%@ page import="fiyucore.util.StringUtil" %>
<%@ page import="fiyucore.filter.EnableEmotionFilter" %>
<%@ page import="fiyuforum.db.*" %>
<%@ page import="fiyuforum.MyUtil" %>
<%@ page import="fiyuforum.fiyuForumConstant" %>
<%@ page import="fiyuforum.fiyuForumGlobal" %>
<%@ page import="fiyuforum.fiyuForumConfig" %>
<%@ taglib uri="http://jsptags.com/tags/navigation/pager" prefix="pg" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<%@ include file="inc_common.jsp"%>
<html >
<head>
<title><%=fiyuForumConfig.getWebName()%> - 所有讨论区中最新话题</title>
<%@ include file="/fiyuplugin/fiyuforum/meta.jsp"%>
</head>
<link href="<%=contextPath%>/fiyuplugin/fiyuforum/css/style.css" rel="stylesheet" type="text/css">
<script language="JavaScript" src="<%=contextPath%>/fiyuplugin/fiyuforum/js/fiyunav.js"></script>
<body leftmargin="0" topmargin="0">
<%@ include file="header.jsp"%>
<br/>
<table width="95%" align="center">
<tr class="nav">
<td><img src="<%=contextPath%>/fiyuplugin/fiyuforum/images/nav.gif"></td>
<td width="100%" nowrap> <a class="nav" href="index"><%=fiyuForumConfig.getWebName()%></a> »
所有讨论区中最新话题 </td>
</tr>
</table>
<br/>
<%
CategoryCache categoryCache = CategoryCache.getInstance();
ForumCache forumCache = ForumCache.getInstance();
Collection forumBeans = forumCache.getBeans();
Iterator forumIterator = forumBeans.iterator();
int lastCategoryID = -1;
%>
<table width="95%" align="center">
<tr class="messageText"><td>
<form>
快速连接 » <select name="FastGoForum" onChange="gotoPage(this.options[this.selectedIndex].value)">
<%
while(forumIterator.hasNext()) {
ForumBean row = (ForumBean)forumIterator.next();
if (row.getCategoryID() != lastCategoryID) {// to print the category
lastCategoryID = row.getCategoryID();
CategoryBean categoryBean = categoryCache.getBean(lastCategoryID);
%>
<option value=""></option>
<option value="listforums"><%=categoryBean.getCategoryName()%></option>
<option value="">---------------------------------</option>
<%
}//if
%>
<option value="listthreads?forum=<%=row.getForumID()%>"> <%=row.getForumName()%></option>
<%
}//while
%>
</select>
</form>
</td></tr>
</table>
<%
String sort = ParamUtil.getParameter(request, "sort");
String order = ParamUtil.getParameter(request, "order");
if (sort.length() == 0) sort = "ThreadLastPostDate";
if (order.length() == 0) order = "DESC";
%>
<table width="95%" align="center">
<tr>
<td nowrap class="messageText">
<form action="listrecentthreads">
排序方式
<select name="sort">
<option value="ThreadLastPostDate" <%if (sort.equals("ThreadLastPostDate")) {%>selected<%}%>>最後发表日期</option>
<option value="ThreadCreationDate" <%if (sort.equals("ThreadCreationDate")) {%>selected<%}%>>第一次发表日期</option>
<option value="MemberName" <%if (sort.equals("MemberName")) {%>selected<%}%>>作者</option>
<option value="ThreadReplyCount" <%if (sort.equals("ThreadReplyCount")) {%>selected<%}%>>回应</option>
<option value="ThreadViewCount" <%if (sort.equals("ThreadViewCount")) {%>selected<%}%>>观看</option>
</select>
顺序
<select name="order">
<option value="ASC" <%if (order.equals("ASC")) {%>selected<%}%>>递增</option>
<option value="DESC" <%if (order.equals("DESC")) {%>selected<%}%>>递减</option>
</select>
<input type="button" value="Go" onclick="disabled=true; submit();" class="liteoption">
</form>
</td>
</tr>
</table>
<%
Collection threadBeans = (Collection) request.getAttribute("ThreadBeans");
int totalThreads = ((Integer)request.getAttribute("TotalThreads")).intValue();
int memberPostsPerPage = onlineUser.getPostsPerPage();
%>
<pg:pager
url="listrecentthreads"
items="<%= totalThreads %>"
maxPageItems="<%= memberPostsPerPage %>"
isOffset="true"
export="offset,currentPageNumber=pageNumber"
scope="request">
<% String rowsType = "Threads"; %>
<%-- keep track of preference --%>
<pg:param name="sort"/> <pg:param name="order"/>
<table width="95%" align="center">
<tr>
<td>
<%@ include file="inc_pager.jsp"%>
</td>
</tr>
</table>
<table class="tborder" width="95%" cellspacing="1" cellpadding="3" align="center">
<tr class="theader">
<td colspan="3">话题</td>
<td width="80">讨论区</td>
<td width="61" align="center">作者</td>
<td width="39" align="center">回应</td>
<td width="44" align="center">观看</td>
<td width="199" align="center">最后发表时间|作者</td>
</tr>
<%
boolean odd = false;
Iterator iterator = threadBeans.iterator();
while(iterator.hasNext()) {
odd = !odd;
ThreadBean threadBean = (ThreadBean)iterator.next();
%>
<pg:item>
<%if (odd) {%>
<tr class="trow1">
<%} else {%>
<tr class="trow2">
<%}%>
<td width="32"><img src="<%=contextPath%>/fiyuplugin/fiyuforum/images/icon/<%=MyUtil.getThreadIconName(onlineUser.getLastLogonTimestamp().getTime(), threadBean.getThreadLastPostDate().getTime(), threadBean.getThreadReplyCount()+1)%>" border="0"></td>
<td width="17">
<%=EnableEmotionFilter.filter(threadBean.getThreadIcon(), ParamUtil.getContextPath() + fiyuForumGlobal.EMOTION_DIR)%>
</td>
<td width="428"> <a href="viewthread?thread=<%=threadBean.getThreadID()%>" class="messageTopic">
<%=MyUtil.filter(threadBean.getThreadTopic(), false/*html*/, true/*emotion*/, false/*fiyuCode*/, false/*newLine*/, false/*URL*/)%>
</a> </td>
<td> <a href="listthreads?forum=<%=threadBean.getForumID()%>" class="messageTopic">
<%=forumCache.getBean(threadBean.getForumID()).getForumName()%>
</a> </td>
<td align="center">
<% if ((threadBean.getMemberName()!=null) && (threadBean.getMemberName().length()>0)) { %>
<a href="viewmember?member=<%=threadBean.getMemberName()%>" class="memberName">
<%=threadBean.getMemberName()%>
</a>
<% } %>
</td>
<td align="center"><b>
<%=threadBean.getThreadReplyCount()%>
</b></td>
<td align="center"><b>
<%=threadBean.getThreadViewCount()%>
</b></td>
<td align="center">
<%=onlineUser.getGMTTimestampFormat(threadBean.getThreadLastPostDate())%>
<% if ((threadBean.getLastPostMemberName()!=null) && (threadBean.getLastPostMemberName().length()>0)) { %>
§ <a href="viewmember?member=<%=threadBean.getLastPostMemberName()%>" class="memberName">
<%=threadBean.getLastPostMemberName()%>
</a>
<% } %>
</td>
</tr>
</pg:item>
<%
}//while
if (threadBeans.size() == 0) {%>
<tr class="trow1">
<td colspan="8" align="center"><b>没有最新话题</b></td>
</tr>
<%}%>
</table>
<table width="95%" align="center">
<tr>
<td>
<%@ include file="inc_pager.jsp"%>
</td>
</tr>
</table>
</pg:pager> <br/>
<%@ include file="footer.jsp"%>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -