⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 listthreads.jsp

📁 飞鱼论坛 (java)
💻 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" %>

<%@ 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>fiyuForum - 列出所有话题</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/>

<%
int forumID_int     = ParamUtil.getParameterInt(request, "forum");
String forumID      = String.valueOf(forumID_int);
int totalThreads    = ((Integer)request.getAttribute("TotalThreads")).intValue();
int totalPosts      = ((Integer)request.getAttribute("TotalPosts")).intValue();
Collection threadRows = (Collection) request.getAttribute("ThreadBeans");
int memberPostsPerPage = onlineUser.getPostsPerPage();

CategoryCache categoryCache = CategoryCache.getInstance();
ForumCache forumCache = ForumCache.getInstance();
%>

<table width="95%" align="center">
  <tr class="nav">
    <td><img src="<%=contextPath%>/fiyuplugin/fiyuforum/images/nav.gif"></td>
    <td width="100%" nowrap> <%=fiyuForumConfig.getWebName()%>&nbsp;&raquo;&nbsp; <a class="nav" href="listforums">列出所有讨论区</a>&nbsp;&raquo;&nbsp; 
      讨论区: 
      <%=forumCache.getBean(forumID_int).getForumName()%>
    </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="listthreads">
      <input type="hidden" name="forum" value="<%=forumID%>">
      排序方式
      <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>

<pg:pager
  url="listthreads"
  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"/>
<pg:param name="forum"/>

<table width="95%" align="center">
  <tr>
    <td class="hightlight">
      此讨论区中所有话题 (<%=totalPosts%> 文章 在 <%=totalThreads%> 话题)
      <%if (fiyuForumConfig.getEnableRSS()) {%>
      <a href="rss?forum=<%=forumID%>"><img src="<%=request.getContextPath()%>/fiyuplugin/fiyuforum/images/icon/xml.gif" alt="RSS Forum-Specific Content Feed" border="0" align="bottom"></a>
      <% } %>
    </td>
    <td align="right"><a class="command" href="addpost?forum=<%=forumID%>">发表新话题</a></td>
  </tr>
</table>

<table class="tborder" width="95%" cellspacing="1" cellpadding="3" align="center">
  <tr class="theader">
    <td colspan="3">话题</td>
    <td width="87" align="center">作者</td>
    <td width="32" align="center">回应</td>
    <td width="35" align="center">观看</td>
    <td width="198" align="center">最后发表时间&nbsp;<font color="#FFFFFF">|</font> 
      作者 </td>
  </tr>
<%
boolean odd = false;
    Iterator iterator = threadRows.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="490">
      <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 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())%>
      &nbsp;<font color="#FF0000">|</font> 
      <% if ((threadBean.getLastPostMemberName()!=null) && (threadBean.getLastPostMemberName().length()>0)) { %>
      <a href="viewmember?member=<%=threadBean.getLastPostMemberName()%>" class="memberName"> 
      <%=threadBean.getLastPostMemberName()%>
      </a>&nbsp; 
      <% } %>
    </td>
  </tr>
</pg:item>
<%
    }//while
if (threadRows.size() == 0) { %>
  <tr class="trow1"><td colspan="7" align="center"><b>此讨论区中没有任何话题</b></td></tr>
<% }//if %>
</table>

<table width="95%" align="center">
  <tr>
    <td align="left">
      <%@ include file="inc_pager.jsp"%>
    </td>
    <td align="right"><a class="command" href="addpost?forum=<%=forumID%>">发表新话题</a></td>
  </tr>
</table>
<table width="95%" align="center">
  <tr class="messageText"><td>
  <form>
        <div align="right">快速连接 &raquo; 
          <select name="FastGoForum" onChange="gotoPage(this.options[this.selectedIndex].value)">
            <%
Collection forumBeans = forumCache.getBeans();
Iterator forumIterator = forumBeans.iterator();
int lastCategoryID = -1;
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()%>" <%if (row.getForumID() == forumID_int) {%>selected<%}%>>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <%=row.getForumName()%>
            </option>
            <% }//while %>
          </select>
        </div>
      </form>
  </td></tr>
</table>
</pg:pager>

<br/>
<%@ include file="footer.jsp"%>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -