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

📄 viewthread.jsp

📁 用java 写的论坛
💻 JSP
📖 第 1 页 / 共 2 页
字号:
<%--
 - $Header: /cvsroot/mvnforum/mvnforum/srcweb/mvnplugin/mvnforum/user/viewthread.jsp,v 1.33 2003/06/09 19:52:31 minhnn Exp $
 - $Author: minhnn $
 - $Revision: 1.33 $
 - $Date: 2003/06/09 19:52:31 $
 -
 - ====================================================================
 -
 - Copyright (C) 2002, 2003 by MyVietnam.net
 -
 - This program is free software; you can redistribute it and/or
 - modify it under the terms of the GNU General Public License
 - as published by the Free Software Foundation; either version 2
 - of the License, or any later version.
 -
 - All copyright notices regarding mvnForum MUST remain intact
 - in the scripts and in the outputted HTML.
 - The "powered by" text/logo with a link back to
 - http://www.mvnForum.com and http://www.MyVietnam.net in the
 - footer of the pages MUST remain visible when the pages
 - are viewed on the internet or intranet.
 -
 - This program is distributed in the hope that it will be useful,
 - but WITHOUT ANY WARRANTY; without even the implied warranty of
 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 - GNU General Public License for more details.
 -
 - You should have received a copy of the GNU General Public License
 - along with this program; if not, write to the Free Software
 - Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 -
 - Support can be obtained from support forums at:
 - http://www.mvnForum.com/mvnforum/index
 -
 - Correspondence and Marketing Questions can be sent to:
 - info@MyVietnam.net
 -
 - @author: Minh Nguyen  minhnn@MyVietnam.net
 - @author: Mai  Nguyen  mai.nh@MyVietnam.net
 --%>
<%@ page contentType="text/html;charset=utf-8" %>
<%@ page errorPage="fatalerror.jsp"%>
<%@ page import="java.util.Collection" %>
<%@ page import="java.util.Iterator" %>
<%@ page import="net.myvietnam.mvncore.util.ParamUtil" %>
<%@ page import="net.myvietnam.mvncore.exception.AssertionException" %>
<%@ page import="net.myvietnam.mvncore.filter.EnableEmotionFilter" %>
<%@ page import="net.myvietnam.mvnplugin.mvnforum.db.*" %>
<%@ page import="net.myvietnam.mvnplugin.mvnforum.MVNForumConfig" %>
<%@ page import="net.myvietnam.mvnplugin.mvnforum.MVNForumGlobal" %>
<%@ page import="net.myvietnam.mvnplugin.mvnforum.MyUtil" %>
<!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();
%>
<html>
<head>
    <title>mvnForum - 觀看話題 - <%=threadBean.getThreadTopic()%></title>
<%@ include file="/mvnplugin/mvnforum/meta.jsp"%>
</head>
<link href="<%=contextPath%>/mvnplugin/mvnforum/css/style.css" rel=stylesheet type=text/css>
<script language="JavaScript" src="<%=contextPath%>/mvnplugin/mvnforum/js/mvnnav.js"></script>
<body leftmargin=0 topmargin=0>

<%@ include file="header.jsp"%>

<%
// current offset, use to remember offset state after we update any post
int offset = 0;
try {
    offset = ((Integer)request.getAttribute("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);
%>

<p>
<table width="95%" align="center">
<tr class="nav">
    <td><img src="<%=contextPath%>/mvnplugin/mvnforum/images/nav.gif"></td>
    <td width="100%" nowrap>
    <a class="navLink" href="index">mvnForum</a>&nbsp;&raquo;&nbsp;
    <a class="navLink" href="listforums">列出所有討論區</a>&nbsp;&raquo;&nbsp;
    討論區: <a class="navLink" href="listthreads?forum=<%=forumID%>"><%=forumName%></a>&nbsp;&raquo;&nbsp;
    話題: <%=threadBean.getThreadTopic()%>
    </td>
</tr>
</table>
<p>

<table width="95%" align="center">
<tr class="messageText"><td>
<form>
快速連結 &raquo; <select name="FastGoForum" onChange="gotoPage(this.options[this.selectedIndex].value)">
<%
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>
</form>
</td></tr>
</table>

<table width="95%" align="center">
<tr>
    <td class="hightlight">此話題中所有文章數: <%=numberOfPosts%> </td>
    <td align="right">
<%if ( permission.canDeletePost(forumID_int) ) {%>
    <a class="messageTextBold" href="deletethread?thread=<%=threadID%>">&#91;刪除此話題]</a>
<%}%>
    <a class="messageTextBoldBlue" href="addpost?forum=<%=forumID%>">發表新話題</a>
    </td>
</tr>
</table>

<table width="95%" border="0" cellspacing="1" cellpadding="5" align="center" bgcolor="#999999">
  <tr bgcolor="#666699" class="header">
    <td width="155" align="center" nowrap>作者</td>
    <td align="center">
        <table width="100%" border="0" cellpadding="0" cellspacing="0">
        <tr>
            <td nowrap><%if (previousTopic != 0) {%><a href="viewthread?thread=<%=previousTopic%>" class="header"><img src="<%=contextPath%>/mvnplugin/mvnforum/images/icon/left.gif" border="0" alt="上一話題"></a><%}%></td>
            <td width="100%" align="center" class="header">此文章已經觀看 <font color="Aqua"><%=threadBean.getThreadViewCount()+1%></font> 次 而且有 <font color="Yellow"><%=numberOfPosts-1%></font>
            <%if (numberOfPosts-1 == 1) {%>篇回覆<%} else {%>篇回覆<%}%>
            </td>
            <td nowrap><%if (nextTopic != 0) {%><a href="viewthread?thread=<%=nextTopic%>" class="header"><img src="<%=contextPath%>/mvnplugin/mvnforum/images/icon/right.gif" border="0" alt="下一話題"></a><%}%></td>
        </tr>
        </table>
    </td>
  </tr>
</table>

<%
Iterator iterator = postBeans.iterator();
int i = 0;
while(iterator.hasNext()) {
    PostBean postBean = (PostBean)iterator.next();
    MemberBean  memberBean = postBean.getMemberBean();
    if ( postBean.getMemberID() != memberBean.getMemberID() ) {
        throw new AssertionException("Member info and Post info dont not match!");
    }
    i++;

⌨️ 快捷键说明

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