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

📄 viewthread.jsp

📁 免费的java企业级论坛可执行程序
💻 JSP
📖 第 1 页 / 共 5 页
字号:
<%--
 - $Header: /cvsroot/mvnforum/mvnforum/srcweb/mvnplugin/mvnforum/user/viewthread.jsp,v 1.290 2007/11/26 11:37:02 minhnn Exp $
 - $Author: minhnn $
 - $Revision: 1.290 $
 - $Date: 2007/11/26 11:37:02 $
 -
 - ====================================================================
 -
 - Copyright (C) 2002-2007 by MyVietnam.net
 -
 - 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 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.
 -
 - 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 at MyVietnam net
 -
 - @author: Minh Nguyen  
 - @author: Mai  Nguyen  
 - @author: Igor Manic   
 --%>
<%@ page contentType="text/html;charset=utf-8" %>
<%@ page errorPage="fatalerror.jsp"%>
<%@ page import="java.sql.Timestamp"%>
<%@ page import="java.util.*" %>
<%@ page import="java.text.DecimalFormat"%>
<%@ page import="net.myvietnam.mvncore.util.AssertionUtil" %>
<%@ page import="net.myvietnam.mvncore.util.ParamUtil" %>
<%@ 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.common.*" %>
<%@ page import="com.mvnforum.MVNForumGlobal" %>
<%@ page import="com.mvnforum.MVNForumConstant" %>
<%@ page import="com.mvnforum.MVNForumResourceBundle" %>
<%@ page import="com.mvnforum.auth.OnlineUserAction" %>
<%@page import="com.mvnforum.user.UserModuleConfig"%>

<%@ taglib uri="http://jsptags.com/tags/navigation/pager" prefix="pg" %>

<%@ include file="inc_common.jsp"%>
<%@ include file="inc_doctype.jsp"%>
<fmt:bundle basename="mvnForum_i18n">
<%
PollBean pollBean = null;
Collection pollAnswerBeans = null;
int totalVotes = 0;
Map resultMap = null;
DecimalFormat format = null;
int ONE_HUNDRES_PERCENT_IN_PIXEL = 300;
int NUMBER_COLORS = 6;
boolean canChangeVote = false;
boolean onlyCanViewLimit = false;
boolean onlyCanViewLimitAndVote = false;
Collection yourAnswer = null;
boolean isInEdittingStatus = false;
boolean hasPoll = false;
boolean hasExpired = false;
if ((request.getAttribute("HasPollInThisThread") != null) && MVNForumConfig.getEnablePoll()) {
  hasPoll = ((Boolean)request.getAttribute("HasPollInThisThread")).booleanValue();
}
if (hasPoll) {
  //This thread has a poll
  pollBean = (PollBean) request.getAttribute("PollBean");
  Timestamp endDate = pollBean.getPollEndDate();
  Timestamp startDate = pollBean.getPollStartDate();
  Timestamp now = DateUtil.getCurrentGMTTimestamp();
  if ((endDate.compareTo(startDate) > 0) && (endDate.compareTo(now) <= 0)) {
    hasExpired = true;
  }
  if (request.getAttribute("PollIsInEdittingStatus") != null) {
    isInEdittingStatus = true;
  } else if (request.getAttribute("ViewPollResult") != null) {
      if (request.getAttribute("CanChangeVote") != null) {
          canChangeVote = true;
      }
      //only show poll result
      format = new DecimalFormat("##.##");
      pollAnswerBeans = (Collection) request.getAttribute("PollAnswerBeans");
      totalVotes = ((Integer) request.getAttribute("TotalVotes")).intValue();
      resultMap = (HashMap) request.getAttribute("ResultMap");
  } else {
      if (request.getAttribute("OnlyCanViewLimit") != null) {
          onlyCanViewLimit = true;
      }
      if (request.getAttribute("OnlyCanViewLimitAndVote") != null) {
          onlyCanViewLimitAndVote = true;
          yourAnswer = (ArrayList)request.getAttribute("YourAnswer");
      }
      pollAnswerBeans = (Collection) request.getAttribute("PollAnswerBeans");
  }
} 

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();

PostBean lastPostBean = (PostBean)request.getAttribute("lastpostBean");
String replyTopic = "";
String postTopic = "";
String postBody = "";

String lastPostTopic = lastPostBean.getPostTopic();
if (lastPostTopic.indexOf("Re: ") == -1) {
    lastPostTopic = "Re: " + lastPostTopic;
}

boolean watched = false;
if (MVNForumConfig.getEnableEasyWatching()) {
  watched = ((Boolean) request.getAttribute("isWatched")).booleanValue();
}
%>

<mvn:html locale="${currentLocale}">
<mvn:head>
  <mvn:title><fmt:message key="mvnforum.common.forum.title_name"/> - <fmt:message key="mvnforum.user.viewthread.title"/> - <%=threadBean.getThreadTopic()%></mvn:title>
<script type="text/javascript" src="<%=contextPath%>/mvnplugin/mvnforum/js/domLib.js"> </script>
<script type="text/javascript" src="<%=contextPath%>/mvnplugin/mvnforum/js/domMenu.js"> </script>
<script type="text/javascript" src="<%=contextPath%>/mvnplugin/mvnforum/js/prettify.js"> </script>
<%@ include file="/mvnplugin/mvnforum/meta.jsp"%>
<link href="<%=onlineUser.getCssPath()%>" rel="stylesheet" type="text/css"/>
<link href="<%=contextPath%>/mvnplugin/mvnforum/css/menu.css" rel="stylesheet" type="text/css"/>
<link href="<%=contextPath%>/mvnplugin/mvnforum/css/prettify.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript">
//<![CDATA[
function SubmitForm() {
  if (ValidateForm() == true) {
    <mvn:servlet>
    document.mvnform.submitbutton.disabled=true;
    document.mvnform.previewbutton.disabled=true;
    </mvn:servlet>
    document.mvnform.submit();
  }
}

function ValidateForm() {
  document.mvnform.message.value = document.mvnform.input.value;
  if (isBlank(document.mvnform.input, "<fmt:message key="mvnforum.common.post.body"/>")) return false;
  return true;
}

function PreviewForm() {
  if (ValidateForm() == true) {
    document.mvnform.preview.value='true';
    document.mvnform.action='<%=urlResolver.encodeURL(request, response, "addpost", URLResolverService.ACTION_URL)%>';
    <mvn:servlet>
    document.mvnform.submitbutton.disabled=true;
    document.mvnform.previewbutton.disabled=true;
    </mvn:servlet>
    document.mvnform.submit();
  }
}

function QuickReply(parentId, topic) {

  if (document.getElementById('input')) {
    document.getElementById('input').focus();
    document.getElementById('quickreplymessage').innerHTML = '<fmt:message key="mvnforum.user.viewthread.link.quickreply_post_to"/> ' + parentId + ' <fmt:message key="mvnforum.user.viewthread.link.quickreply_post_to_topic"/> ' + topic;
  }

  if (topic.indexOf("Re: ") == -1) {
    topic = "Re: " + topic;
  }
  document.mvnform.parent.value=parentId;
  document.mvnform.PostTopic.value=topic;
}

<%if (MVNForumConfig.getEnablePoll()) {%>
//handle vote poll form
function SubmitPollVoteForm() {
  if (ValidatePollVoteForm() == true) {
    <mvn:servlet>
      document.pollvoteform.pollvotebutton.disabled=true;
    </mvn:servlet>  
    document.pollvoteform.submit();
  }
}

⌨️ 快捷键说明

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