📄 viewthread.jsp
字号:
<%--
- $Header: /cvsroot/mvnforum/mvnforum/srcweb/mvnplugin/mvnforum/user/viewthread.jsp,v 1.101 2004/04/06 19:38:05 minhnn Exp $
- $Author: minhnn $
- $Revision: 1.101 $
- $Date: 2004/04/06 19:38:05 $
-
- ====================================================================
-
- Copyright (C) 2002-2004 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="com.mvnforum.db.*" %>
<%@ page import="com.mvnforum.MVNForumConfig" %>
<%@ page import="com.mvnforum.MVNForumGlobal" %>
<%@ page import="com.mvnforum.MVNForumConstant" %>
<%@ page import="com.mvnforum.MyUtil" %>
<%@ taglib uri="http://jsptags.com/tags/navigation/pager" prefix="pg" %>
<%!
String getThreadStatusName(int threadStatus) {
String result = null;
switch (threadStatus) {
case ThreadBean.THREAD_STATUS_DEFAULT:
result = "[mvnforum.common.thread.status.normal]";
break;
case ThreadBean.THREAD_STATUS_DISABLED:
result = "[mvnforum.common.thread.status.disabled]";
break;
case ThreadBean.THREAD_STATUS_LOCKED:
result = "[mvnforum.common.thread.status.locked]";
break;
case ThreadBean.THREAD_STATUS_CLOSED:
result = "[mvnforum.common.thread.status.closed]";
break;
default:
//throw new AssertionException("Cannot find matching thread status.");
}
return result;
}
String getForumStatusName(int forumStatus) {
String result = null;
switch (forumStatus) {
case ForumBean.FORUM_STATUS_DEFAULT:
result = "[mvnforum.common.forum.status.normal]";
break;
case ForumBean.FORUM_STATUS_DISABLED:
result = "[mvnforum.common.forum.status.disabled]";
break;
case ForumBean.FORUM_STATUS_LOCKED:
result = "[mvnforum.common.forum.status.locked]";
break;
case ForumBean.FORUM_STATUS_CLOSED:
result = "[mvnforum.common.forum.status.closed]";
break;
default:
//throw new AssertionException("Cannot find matching forum status.");
}
return result;
}
%>
<!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 pendingPostCount = ((Integer)request.getAttribute("PendingPostCount")).intValue();
int memberPostsPerPage = onlineUser.getPostsPerPage();
%>
<html [mvnforum.common.i18n.html_dir]>
<head>
<title>[mvnforum.common.forum.title_name] - [mvnforum.user.viewthread.title] - <%=threadBean.getThreadTopic()%></title>
<%@ include file="/mvnplugin/mvnforum/meta.jsp"%>
<link href="<%=contextPath%>/mvnplugin/mvnforum/css/style.css" rel="stylesheet" type="text/css">
</head>
<script language="JavaScript" src="<%=contextPath%>/mvnplugin/mvnforum/js/mvnnav.js"></script>
<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 = "[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 catBeans = 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">[mvnforum.common.nav.index]</a> »
<a class="nav" href="listforums">[mvnforum.user.listforums.title]</a> »
[mvnforum.common.forum]: <a class="nav" href="listthreads?forum=<%=forumID%>"><%=forumName%></a> »
[mvnforum.common.thread]: <%=threadBean.getThreadTopic()%>
</td>
</tr>
</table>
<br/>
<table width="95%" align="center">
<tr class="messageText"><td>
<form>
[mvnforum.common.quick_go] » <select name="FastGoForum" onChange="gotoPage(this.options[this.selectedIndex].value)">
<%
for (Iterator catIter = catBeans.iterator(); catIter.hasNext(); ) {
CategoryBean catBean = (CategoryBean)catIter.next();
int catID = catBean.getCategoryID();
int forumsInCurrentCat = forumCache.getNumberOfBeans(catID);
if (forumsInCurrentCat == 0) continue; %>
<option value=""></option>
<option value="listforums"><%=catBean.getCategoryName()%></option>
<option value="">---------------------------------</option>
<%
for (Iterator forumIter = forumBeans.iterator(); forumIter.hasNext(); ) {
ForumBean forumBean = (ForumBean)forumIter.next();
if (forumBean.getCategoryID() != catID) 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">[mvnforum.common.thread.status]: <span class="<%=(threadBean.getThreadStatus()==ThreadBean.THREAD_STATUS_DEFAULT)?"":"warning"%>"><%=getThreadStatusName(threadBean.getThreadStatus())%></span></span><br/>
<%if(currentForumBean.getForumStatus()!=ForumBean.FORUM_STATUS_DEFAULT) {%>
<span class="messageText">[mvnforum.common.forum.status]: <span class="warning"><%=getForumStatusName(currentForumBean.getForumStatus())%></span></span><br/>
<% } %>
<span class="hightlight">[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%>">
[[mvnforum.user.viewthread.link.moderate_pending_posts] <span class="pendingyes">(<%=pendingPostCount%>)</span>]
</a>
<%}%>
<a class="command" href="editthreadstatus?thread=<%=threadID%>">[[mvnforum.user.viewthread.link.edit_thread_status]]</a>
<%}%>
<%if ( permission.canDeletePost(forumID) && (currentForumBean.getForumStatus()!=ForumBean.FORUM_STATUS_LOCKED) ) {%>
<%-- @todo: Isn't there canDeleteThread() ? --%>
<a class="command" href="deletethread?thread=<%=threadID%>">[[mvnforum.user.viewthread.link.delete_thread]]</a>
<a class="command" href="movethread?thread=<%=threadID%>">[[mvnforum.user.viewthread.link.move_thread]]</a><br/>
<%}%>
<a class="command" href="addfavoritethreadprocess?thread=<%=threadID%>">[[mvnforum.user.viewthread.link.add_favorite_thread]]</a>
<a class="command" href="addwatchprocess?thread=<%=threadID%>&WatchSelector=3">[[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%>">[[mvnforum.user.viewthread.link.new_thread]]</a>
<% }//if can new post%>
</td>
</tr>
</table>
<table class="tborder" width="95%" cellspacing="1" cellpadding="5" align="center">
<tr class="theader">
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -