📄 viewthread.jsp
字号:
<%--
- $Header: /cvsroot/mvnforum/mvnforum/srcweb/mvnplugin/mvnforum/user/viewthread.jsp,v 1.128 2005/02/21 18:34:09 minhnn Exp $
- $Author: minhnn $
- $Revision: 1.128 $
- $Date: 2005/02/21 18:34:09 $
-
- ====================================================================
-
- Copyright (C) 2002-2005 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
- @author: Igor Manic imanic@users.sourceforge.net
--%>
<%@ page contentType="text/html;charset=utf-8" %>
<%@ page errorPage="fatalerror.jsp"%>
<%@ page import="java.util.*" %>
<%@ 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.mvncore.filter.EnableMVNCodeFilter" %>
<%@ page import="net.myvietnam.mvncore.security.Encoder" %>
<%@ page import="com.mvnforum.db.*" %>
<%@ page import="com.mvnforum.MVNForumGlobal" %>
<%@ page import="com.mvnforum.MVNForumConstant" %>
<%@ page import="com.mvnforum.MyUtil" %>
<%@ page import="com.mvnforum.MVNForumResourceBundle" %>
<%@ 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"%>
<fmt:bundle basename="mvnForum_i18n">
<%
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 pendingPostCount = ((Integer)request.getAttribute("PendingPostCount")).intValue();
int memberPostsPerPage = onlineUser.getPostsPerPage();
%>
<html <fmt:message key="mvnforum.common.i18n.html_dir"/>>
<head>
<title><fmt:message key="mvnforum.common.forum.title_name"/> - <fmt:message key="mvnforum.user.viewthread.title"/> - <%=threadBean.getThreadTopic()%></title>
<%@ include file="/mvnplugin/mvnforum/meta.jsp"%>
<link href="<%=onlineUser.getCssPath()%>" rel="stylesheet" type="text/css">
</head>
<body leftmargin="0" topmargin="0">
<%@ include file="header.jsp"%>
<br/>
<pg:pager
url="viewthread"
items="<%= numberOfPosts %>"
maxPageItems="<%= memberPostsPerPage %>"
isOffset="true"
export="offset,currentPageNumber=pageNumber"
scope="request">
<% String rowsType = MVNForumResourceBundle.getString(onlineUser.getLocale(), "mvnforum.common.numberof.posts"); %>
<%-- keep track of preference --%>
<pg:param name="thread"/>
<%
// current offset, use to remember offset state after we update any post
//int offset = 0;
try {
//offset = ((Integer)request.getAttribute("offset")).intValue();
offset = new Integer((String)request.getAttribute("offset"));
} catch (Exception e) {
// do nothing
}
CategoryCache categoryCache = CategoryCache.getInstance();
ForumCache forumCache = ForumCache.getInstance();
Collection categoryBeans = categoryCache.getBeans();
Collection forumBeans = forumCache.getBeans();
int forumID = threadBean.getForumID();
ForumBean currentForumBean = forumCache.getBean(forumID);
String forumName = currentForumBean.getForumName();
int threadID = ParamUtil.getParameterInt(request, "thread");
if (threadID != threadBean.getThreadID()) {
throw new AssertionException("2 threadID are not the same.");
}
%>
<table width="95%" align="center">
<tr class="nav">
<td><img src="<%=contextPath%>/mvnplugin/mvnforum/images/nav.gif"></td>
<td width="100%" nowrap>
<a class="nav" href="index"><fmt:message key="mvnforum.common.nav.index"/></a> »
<a class="nav" href="listforums"><fmt:message key="mvnforum.user.listforums.title"/></a> »
<fmt:message key="mvnforum.common.forum"/>: <a class="nav" href="listthreads?forum=<%=forumID%>"><%=forumName%></a> »
<fmt:message key="mvnforum.common.thread"/>: <%=threadBean.getThreadTopic()%>
</td>
</tr>
</table>
<br/>
<table width="95%" align="center">
<tr class="messageText"><td>
<form>
<fmt:message key="mvnforum.common.quick_go"/> » <select name="FastGoForum" onChange="gotoPage(this.options[this.selectedIndex].value)">
<%
for (Iterator catIter = categoryBeans.iterator(); catIter.hasNext(); ) {
CategoryBean categoryBean = (CategoryBean)catIter.next();
int categoryID = categoryBean.getCategoryID();
if (MyUtil.canViewAnyForumInCategory(categoryID, permission) == false) continue; %>
%>
<option value=""></option>
<option value="listforums"><%=categoryBean.getCategoryName()%></option>
<option value="">---------------------------------</option>
<%
for (Iterator forumIter = forumBeans.iterator(); forumIter.hasNext(); ) {
ForumBean forumBean = (ForumBean)forumIter.next();
if (forumBean.getCategoryID() != categoryID) continue;
if (permission.canReadPost(forumBean.getForumID()) && (forumBean.getForumStatus() != ForumBean.FORUM_STATUS_DISABLED) ) { %>
<option value="listthreads?forum=<%=forumBean.getForumID()%>" <%if (forumBean.getForumID() == forumID) {%>selected<%}%>> <%=forumBean.getForumName()%></option>
<% } //if
} // for forum
}// for category %>
</select>
</form>
</td></tr>
</table>
<table width="95%" align="center">
<tr>
<td valign="bottom">
<span class="messageText"><fmt:message key="mvnforum.common.thread.status"/>: <span class="<%=(threadBean.getThreadStatus()==ThreadBean.THREAD_STATUS_DEFAULT)?"":"warning"%>"><%=MyUtil.getThreadStatusName(onlineUser.getLocale(), threadBean.getThreadStatus())%></span></span><br/>
<%if(threadBean.getThreadType()!=ThreadBean.THREAD_TYPE_DEFAULT) {%>
<span class="messageText"><fmt:message key="mvnforum.common.thread.type"/>: <%=MyUtil.getThreadTypeName(onlineUser.getLocale(), threadBean.getThreadType())%></span><br/>
<% } %>
<%if(currentForumBean.getForumStatus()!=ForumBean.FORUM_STATUS_DEFAULT) {%>
<span class="messageText"><fmt:message key="mvnforum.common.forum.status"/>: <span class="warning"><%=MyUtil.getForumStatusName(onlineUser.getLocale(), currentForumBean.getForumStatus())%></span></span><br/>
<% } %>
<span class="highlight"><fmt:message key="mvnforum.user.viewthread.total_posts"/>: <%=numberOfPosts%></span>
<%@ include file="inc_pager.jsp"%>
</td>
<td valign="bottom" align="right">
<%if ( permission.canModerateThread(forumID) && (currentForumBean.getForumStatus()!=ForumBean.FORUM_STATUS_LOCKED) ) {%>
<%if (pendingPostCount > 0) {%>
<a class="command" href="moderatependingposts?thread=<%=threadID%>">
[<fmt:message key="mvnforum.user.viewthread.link.moderate_pending_posts"/> <span class="pendingyes">(<%=pendingPostCount%>)</span>]
</a>
<%}%>
<a class="command" href="editthreadstatus?thread=<%=threadID%>">[<fmt:message key="mvnforum.user.viewthread.link.edit_thread_status"/>]</a>
<a class="command" href="editthreadtype?thread=<%=threadID%>">[<fmt:message key="mvnforum.user.viewthread.link.edit_thread_type"/>]</a>
<%}%>
<%if ( permission.canDeletePost(forumID) && (currentForumBean.getForumStatus()!=ForumBean.FORUM_STATUS_LOCKED) ) {%>
<%-- @todo: Isn't there canDeleteThread() ? --%>
<a class="command" href="deletethread?thread=<%=threadID%>">[<fmt:message key="mvnforum.user.viewthread.link.delete_thread"/>]</a>
<a class="command" href="movethread?thread=<%=threadID%>">[<fmt:message key="mvnforum.user.viewthread.link.move_thread"/>]</a><br/>
<%}%>
<a class="command" href="addfavoritethreadprocess?thread=<%=threadID%>">[<fmt:message key="mvnforum.user.viewthread.link.add_favorite_thread"/>]</a>
<a class="command" href="addwatchprocess?thread=<%=threadID%>&WatchSelector=3">[<fmt:message key="mvnforum.user.viewthread.link.watch_this_thread"/>]</a>
<% if (MVNForumConfig.getEnableNewPost() && (onlineUser.isGuest()||permission.canAddThread(forumID)) && (currentForumBean.getForumStatus()==ForumBean.FORUM_STATUS_DEFAULT) ) { %>
<a class="command" href="addpost?forum=<%=forumID%>">[<fmt:message key="mvnforum.user.viewthread.link.new_thread"/>]</a>
<% }//if can new post%>
<%if (MVNForumConfig.getEnableCompany()) {%>
<a class="command" href="addmessage?Topic=Discuss thread=<%=threadID%>">[<fmt:message key="mvnforum.user.company.discuss_thread_with_tutor"/>]</a>
<%}%>
</td>
</tr>
</table>
<table class="tborder" width="95%" cellspacing="1" cellpadding="5" align="center">
<tr class="theader">
<td width="155" align="center" nowrap><fmt:message key="mvnforum.common.post.author"/></td>
<td align="center">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td nowrap>
<%if (previousTopic != 0) {%>
<a href="viewthread?thread=<%=previousTopic%>"><img src="<%=contextPath%>/mvnplugin/mvnforum/images/icon/left.gif" border="0" alt="<fmt:message key="mvnforum.user.viewthread.link.previous_thread"/>" title="<fmt:message key="mvnforum.user.viewthread.link.previous_thread"/>"></a>
<%}%>
</td>
<td class="theader" width="100%" align="center">
<fmt:message key="mvnforum.user.viewthread.has_been_viewed"/> <font color="Aqua"><%=threadBean.getThreadViewCount()+1%></font> <fmt:message key="mvnforum.user.viewthread.times"/> <fmt:message key="mvnforum.user.viewthread.has"/> <font color="Yellow"><%=numberOfPosts-1%></font>
<%if (numberOfPosts-1 == 1) {%><fmt:message key="mvnforum.user.viewthread.reply"/><%} else {%><fmt:message key="mvnforum.user.viewthread.replies"/><%}%>
</td>
<td nowrap>
<%if (nextTopic != 0) {%>
<a href="viewthread?thread=<%=nextTopic%>"><img src="<%=contextPath%>/mvnplugin/mvnforum/images/icon/right.gif" border="0" alt="<fmt:message key="mvnforum.user.viewthread.link.next_thread"/>" title="<fmt:message key="mvnforum.user.viewthread.link.next_thread"/>"></a>
<%}%>
</td>
</tr>
</table>
</td>
</tr>
</table>
<%
int i = 0;
boolean enableInvisible = MVNForumConfig.getEnableInvisibleUsers();
for (Iterator iterator = postBeans.iterator(); iterator.hasNext(); ) {
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -