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

📄 printthread.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.DateUtil" %>
<%@ page import="fiyucore.exception.AssertionException" %>
<%@ page import="fiyucore.filter.EnableEmotionFilter" %>
<%@ page import="fiyuforum.db.*" %>
<%@ page import="fiyuforum.fiyuForumConfig" %>
<%@ page import="fiyuforum.fiyuForumGlobal" %>
<%@ page import="fiyuforum.fiyuForumConstant" %>
<%@ page import="fiyuforum.MyUtil" %>

<%@ 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"%>
<%
ThreadBean threadBean  = (ThreadBean)request.getAttribute("ThreadBean");
Collection postBeans = (Collection)request.getAttribute("PostBeans");

int numberOfPosts = ((Integer)request.getAttribute("NumberOfPosts")).intValue();
int previousTopic = ((Integer)request.getAttribute("PreviousTopic")).intValue();
int nextTopic     = ((Integer)request.getAttribute("NextTopic")).intValue();

int memberPostsPerPage = onlineUser.getPostsPerPage();
boolean printAll = ParamUtil.getParameterBoolean(request, "printall");
if (printAll) {

}
%>
<html >
<head>
  <title><%=fiyuForumConfig.getWebName()%> - 列印此话题 - <%=threadBean.getThreadTopic()%></title>
<%@ include file="/fiyuplugin/fiyuforum/meta.jsp"%>
</head>
<link href="<%=contextPath%>/fiyuplugin/fiyuforum/css/style.css" rel="stylesheet" type="text/css">
<body leftmargin="0" topmargin="0">
<br/>
<table width="98%" border="0" cellspacing="1" cellpadding="0" align="center">
  <tr>
    <td align="left">
    <img src="<%=contextPath%>/fiyuplugin/fiyuforum/images/logo.gif" height="50" border="0" alt="fiyuForum Homepage">
    </td>
  </tr>
</table>
<br/>

<%
// current offset, use to remember offset state after we update any post
int offset1 = 0;
try {
    offset1 = ((Integer)request.getAttribute("pager.offset")).intValue();
} catch (Exception e) {
    // do nothing
}

CategoryCache categoryCache = CategoryCache.getInstance();
ForumCache forumCache = ForumCache.getInstance();
Collection forumBeans = forumCache.getBeans();

int forumID_int = threadBean.getForumID();
String forumID = String.valueOf(forumID_int);
String forumName = forumCache.getBean(forumID_int).getForumName();

int threadID_int = ParamUtil.getParameterInt(request, "thread");
if (threadID_int != threadBean.getThreadID()) {
    throw new AssertionException("2 threadID are not the same.");
}
String threadID = String.valueOf(threadID_int);
%>

<pg:pager
  url="printthread"
  items="<%= numberOfPosts %>"
  maxPageItems="<%= memberPostsPerPage %>"
  isOffset="true"
  export="offset,currentPageNumber=pageNumber"
  scope="request">
<% String rowsType = "Posts"; %>
<%-- keep track of preference --%>
<pg:param name="thread"/>

<table width="98%" cellspacing="0" cellpadding="5" align="center">
  <tr class="nav">
    <td width="100%" colspan="2" nowrap> <a class="nav" href="index"><%=fiyuForumConfig.getWebName()%></a><br/>
    &raquo;&nbsp;
    <a class="nav" href="listforums">列出所有讨论区</a><br/>
    &raquo;&nbsp;&raquo;&nbsp;
    讨论区: <a class="nav" href="listthreads?forum=<%=forumID%>"><%=forumName%></a><br/>
    &raquo;&nbsp;&raquo;&nbsp;&raquo;&nbsp;
    话题: <a class="nav" href="viewthread?thread=<%=threadID_int%>"><%=threadBean.getThreadTopic()%></a>
    </td>
  </tr>
  <tr class="messageText">
    <td valign="bottom">
      列印 <b><%=onlineUser.getGMTTimestampFormat(DateUtil.getCurrentGMTTimestamp())%></b>
    </td>
    <td align="right">
      <%@ include file="inc_pager.jsp"%>
      <a class="pager" href="printthread?thread=<%=threadID_int%>&printall=yes">在同一个网页中显示这个话题的所有文章</a>
    </td>
  </tr>
</table>
<%
Iterator iterator = postBeans.iterator();
int i = 0;
while(iterator.hasNext()) {
    PostBean postBean = (PostBean)iterator.next();
    MemberBean  memberBean = postBean.getMemberBean();
    if ( (memberBean!=null) && (postBean.getMemberID()!=memberBean.getMemberID()) ) {
        throw new AssertionException("Member info and Post info don't not match!");
    }
    i++;
    String color;
    if (postBean.getParentPostID() == 0) {
      color = "trow0";
    } else {
        if ((i%2) != 0) {
          color = "trow1";
        } else {
          color = "trow2";
        }
    }
%>
<table class="tborder" width="98%" cellspacing="1" cellpadding="5" align="center" border="0">
  <tr class="<%=color%>">
    <td>
      文章作者 <b><%=postBean.getMemberName()%></b>
      at <b><%=onlineUser.getGMTTimestampFormat(postBean.getPostCreationDate())%></b>
    </td>
  </tr>
  <tr class="<%=color%>">
    <td valign="top">
      <%if (postBean.getPostIcon().length() > 0) {
          out.print(EnableEmotionFilter.filter(postBean.getPostIcon() + "&nbsp;&nbsp;", ParamUtil.getContextPath() + fiyuForumGlobal.EMOTION_DIR));
      }%>
      <b><%=MyUtil.filter(postBean.getPostTopic(), false/*html*/, true/*emotion*/, true/*fiyuCode*/, false/*newLine*/, false/*URL*/)%></b><br/>
      <%=MyUtil.filter(postBean.getPostBody(), false/*html*/, true/*emotion*/, true/*fiyuCode*/, true/*newLine*/, true/*URL*/)%>
      <%
      Collection attachBeans = postBean.getAttachmentBeans();
      if (attachBeans != null) {
        for (Iterator attachIter = attachBeans.iterator(); attachIter.hasNext(); ) {
            AttachmentBean attachBean = (AttachmentBean)attachIter.next();
        %>
          ----------------------------------------<br/>
          <img src="<%=contextPath%>/fiyuplugin/fiyuforum/images/icon/attach.gif" border="0" alt="">
          <a class="command" href="getattachment?attach=<%=attachBean.getAttachID()%>"><%=attachBean.getAttachFilename()%></a>
          (<%=attachBean.getAttachFileSize()%> bytes)
          (下载次数: <%=attachBean.getAttachDownloadCount()%>)
          <%if (attachBean.getAttachDesc().length() > 0) {%>(<%=MyUtil.filter(attachBean.getAttachDesc(), false/*html*/, true/*emotion*/, true/*fiyuCode*/, false/*newLine*/, true/*URL*/)%>)<%}%><br/>
          <%if (attachBean.getAttachMimeType().startsWith("image/")) {%><img src="getattachment?attach=<%=attachBean.getAttachID()%>" alt="<%=attachBean.getAttachFilename()%>" border="0"><%}%>
          <br/>
        <%
        }
      }
      %>
      <%if (memberBean!=null) {
          String signature = MyUtil.filter(memberBean.getMemberSignature(), false/*html*/, true/*emotion*/, true/*fiyuCode*/, true/*newLine*/, true/*URL*/);
          if (signature.length() > 0) { %>
            ----------------------------------------<br/>
            <%=signature%>
          <%}
        }%>
    </td>
  </tr>
</table>
<br/>
<% }//while %>

<table width="98%" align="center">
  <tr>
    <td align="right">
      <%@ 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 + -