alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  
<td width="100%" nowrap> <a class="nav" href="index"> »  <a class="nav" href="listforums"> »  <fmt:message key="mvnforum.common.forum"/>: <%=forumName%> »  <fmt:message key="mvnforum.common.thread"/>: <%=threadBean.getThreadTopic()%> </td> </tr> </table> <br/> <table width="95%" align="center"> <tr class="messageText"> </table> <table width="95%" align="center"> <tr> <td valign="bottom"> <span class="messageText">: "><%=MyUtil.getThreadStatusName(onlineUser.getLocale(), threadBean.getThreadStatus())%>
<%if(threadBean.getThreadType()!=ThreadBean.THREAD_TYPE_DEFAULT) {%> <span class="messageText">: <%=MyUtil.getThreadTypeName(onlineUser.getLocale(), threadBean.getThreadType())%>
<% } %> <%if(currentForumBean.getForumStatus()!=ForumBean.FORUM_STATUS_DEFAULT) {%> <span class="messageText">: <%=MyUtil.getForumStatusName(onlineUser.getLocale(), currentForumBean.getForumStatus())%>
<% } %> <span class="highlight">: <%=numberOfPosts%> <%@ 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"/> (<%=pendingPostCount%>)] </a> <%}%> <a class="command" href="editthreadstatus?thread=<%=threadID%>">[] <a class="command" href="editthreadtype?thread=<%=threadID%>">[] <%}%> <%if ( permission.canDeletePost(forumID) && (currentForumBean.getForumStatus()!=ForumBean.FORUM_STATUS_LOCKED) ) {%> <%-- @todo: Isn't there canDeleteThread() ? --%> <a class="command" href="deletethread?thread=<%=threadID%>">[] <a class="command" href="movethread?thread=<%=threadID%>">[]
<%}%> <a class="command" href="addfavoritethreadprocess?thread=<%=threadID%>">[] <a class="command" href="addwatchprocess?thread=<%=threadID%>&WatchSelector=3">[] <% if (MVNForumConfig.getEnableNewPost() && (onlineUser.isGuest()||permission.canAddThread(forumID)) && (currentForumBean.getForumStatus()==ForumBean.FORUM_STATUS_DEFAULT) ) { %> <a class="command" href="addpost?forum=<%=forumID%>">[] <% }//if can new post%> <%if (MVNForumConfig.getEnableCompany()) {%> <a class="command" href="addmessage?Topic=Discuss thread=<%=threadID%>">[] <%}%> </td> </tr> </table> <table class="tborder" width="95%" cellspacing="1" cellpadding="5" align="center"> <tr class="theader"> <td width="155" align="center" nowrap> <td align="center"> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td nowrap> <%if (previousTopic != 0) {%> <a href="viewthread?thread=<%=previousTopic%>"><fmt:message key=" title=""> <%}%> </td> <td class="theader" width="100%" align="center"> <fmt:message key="mvnforum.user.viewthread.has_been_viewed"/> <%=threadBean.getThreadViewCount()+1%> <%=numberOfPosts-1%> <%if (numberOfPosts-1 == 1) {%><%} else {%><%}%> </td> <td nowrap> <%if (nextTopic != 0) {%> <a href="viewthread?thread=<%=nextTopic%>"><fmt:message key=" title=""> <%}%> </td> </tr> </table> </td> </tr> </table> <% int i = 0; boolean enableInvisible = MVNForumConfig.getEnableInvisibleUsers(); for (Iterator iterator = postBeans.iterator(); 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 match!"); } i++; String color; if (postBean.getParentPostID() == 0) { color = "trow0"; } else { if ((i%2) != 0) { color = "trow1"; } else { color = "trow2"; } } %> <pg:item> <a name="<%=postBean.getPostID()%>"> <table class="tborder" width="95%" cellspacing="1" cellpadding="5" align="center"> <tr class="<%=color%>"> <td width="155" rowspan="2" valign="top" nowrap> <%if ( (memberBean!=null) && (memberBean.getMemberID()!=0) && (memberBean.getMemberID()!=MVNForumConstant.MEMBER_ID_OF_GUEST) ) {%> <%if (memberBean.getMemberGender()==1) {%> <img src="<%=contextPath%>/mvnplugin/mvnforum/images/icon/male.gif" border="0" alt="" title=""> <%} else {%> <img src="<%=contextPath%>/mvnplugin/mvnforum/images/icon/female.gif" border="0" alt="" title=""> <%}%> <a href="viewmember?memberid=<%=memberBean.getMemberID()%>" class="memberName"><%=memberBean.getMemberName()%> <br/> <%=(memberBean.getMemberTitle().length() > 0) ? EnableMVNCodeFilter.filter(memberBean.getMemberTitle()) : MyUtil.getMemberTitle(memberBean.getMemberPostCount())%> <br/> <% if ((memberBean.getMemberAvatar().length() > 0) && MVNForumConfig.getEnableAvatar() ) { %> <div align="center"><fmt:message key=" title=""> <% } else { %> <p> <% } %> <br/> <%=memberBean.getMemberCountry()%>
<fmt:message key="mvnforum.user.viewthread.joined"/>: <%=onlineUser.getGMTDateFormat(memberBean.getMemberCreationDate())%>
<fmt:message key="mvnforum.common.post_count"/>: <%=memberBean.getMemberPostCount()%>
<fmt:message key="mvnforum.common.member.online_status"/>: <%boolean invisible = memberBean.isInvisible(); boolean online = onlineUserManager.isUserOnline(memberBean.getMemberName()); if ( online && (!enableInvisible || !invisible) ) {%> <%-- (S)he is online now, the "online" text show only when the Invisible feature is disabled or his status is visible (not invisable). Otherwise, show "offline" text --%> <font color="#008000"> <%} else if (online && permission.canAdminSystem()) {%> <font color="#008000"> <%} else {%> <fmt:message key="mvnforum.common.member.offline"/> <%}%> <%} else {%> <%-- @todo: replace alt string in next <img src="<%=contextPath%>/mvnplugin/mvnforum/images/icon/nogender.gif" border="0" alt="" title=""> <%if (memberBean==null) {%> <%=MVNForumConfig.getDefaultGuestName()%> <%} else {%> <span class="memberName"><%=memberBean.getMemberName()%> <br/> <%if (memberBean.getMemberTitle()!=null) {%><%=EnableMVNCodeFilter.filter(memberBean.getMemberTitle())%><%}%> <br/> <%if ((memberBean.getMemberAvatar().length() > 0) && MVNForumConfig.getEnableAvatar() ) { %> <div align="center"><fmt:message key=" title=""> <%}%> <%}%> <%}%> </td> <td valign="top"> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="100%" rowspan="2" valign="top" class="messageTextBold"> <%if ( ( (permission.canEditPost(forumID)) || ((memberBean!=null) && (memberBean.getMemberID()==memberID)) ) && (threadBean.getThreadStatus()!=ThreadBean.THREAD_STATUS_LOCKED) && (currentForumBean.getForumStatus()!=ForumBean.FORUM_STATUS_LOCKED) ) {%> <% if ( MVNForumConfig.getEnableAttachment() && permission.canAddAttachment(forumID) ) { %> <a href="addattachment?post=<%=postBean.getPostID()%>&offset=<%=offset%>"><fmt:message key=" title="">  <%}%> <a href="editpost?post=<%=postBean.getPostID()%>&offset=<%=offset%>"><fmt:message key=" title="">   <%}%> <%if (postBean.getPostIcon().length() > 0) { out.print(EnableEmotionFilter.filter(postBean.getPostIcon() + "  ", ParamUtil.getContextPath() + MVNForumGlobal.EMOTION_DIR)); }%> <%=MyUtil.filter(postBean.getPostTopic(), false/*html*/, true/*emotion*/, true/*mvnCode*/, false/*newLine*/, false/*URL*/)%> </td> <td align="right" valign="top" nowrap> <% if (MVNForumConfig.getEnableNewPost() && (onlineUser.isGuest()||permission.canAddPost(forumID)) && (threadBean.getThreadStatus()==ThreadBean.THREAD_STATUS_DEFAULT) && (currentForumBean.getForumStatus()==ForumBean.FORUM_STATUS_DEFAULT) ) { %> <a class="command" href="addpost?parent=<%=postBean.getPostID()%>">
<a class="command" href="addpost?parent=<%=postBean.getPostID()%>"e=yes">
<% }//if can new post%> <%if (MVNForumConfig.getEnableCompany()) {%> <a class="command" href="addmessage?Topic=Discuss thread=<%=threadID%>"> <%}%> </td> </tr> <%if ( (permission.canDeletePost(forumID) || ((memberBean!=null) && (memberBean.getMemberID()==memberID))) && (currentForumBean.getForumStatus()!=ForumBean.FORUM_STATUS_LOCKED) ) {%> <tr> <td align="right" valign="top" nowrap> <%if (postBean.getParentPostID() == 0) {%> <a class="command" href="deletethread?thread=<%=threadID%>">[] <%} else {%> <a class="command" href="deletepost?post=<%=postBean.getPostID()%>">[] <%}%> </td> </tr> <%}%> </table> <hr size="1" noshade> <%=MyUtil.filter(postBean.getPostBody(), false/*html*/, true/*emotion*/, true/*mvnCode*/, true/*newLine*/, true/*URL*/)%> <% Collection attachBeans = postBean.getAttachmentBeans(); if (attachBeans != null) { for (Iterator attachIter = attachBeans.iterator(); attachIter.hasNext(); ) { AttachmentBean attachBean = (AttachmentBean)attachIter.next(); %> ----------------------------------------<br/> <%if ( permission.canDeletePost(forumID) ) {%> <%-- @todo: or it should be canEditPost(forumID) ? --%> <a class="command" href="deleteattachment?attach=<%=attachBean.getAttachID()%>&offset=<%=offset%>">[]  <a class="command" href="editattachment?attach=<%=attachBean.getAttachID()%>&offset=<%=offset%>">[]  <%}%> <img src="<%=contextPath%>/mvnplugin/mvnforum/images/icon/attach.gif" border="0" alt=""> <a class="command" href="getattachment?attach=<%=attachBean.getAttachID()%>"><%=attachBean.getAttachFilename()%> (<%=attachBean.getAttachFileSize()%> bytes) (<fmt:message key="mvnforum.user.viewthread.download_count"/>: <%=attachBean.getAttachDownloadCount()%>) <%if (attachBean.getAttachDesc().length() > 0) {%>(<%=MyUtil.filter(attachBean.getAttachDesc(), false/*html*/, true/*emotion*/, true/*mvnCode*/, false/*newLine*/, true/*URL*/)%>)<%}%>
<%if (attachBean.getAttachMimeType().startsWith("image/") && (permission.canGetAttachment(forumID) || MVNForumConfig.getEnableGuestViewImageAttachment()) ) {%><%=attachBean.getAttachFilename()%><%}%> <br/> <% } } %> <%if (memberBean!=null) { String signature = MyUtil.filter(memberBean.getMemberSignature(), false/*html*/, true/*emotion*/, true/*mvnCode*/, true/*newLine*/, true/*URL*/); if (signature.length() > 0) { %> ----------------------------------------<br/> <%=signature%> <%} }%> <%if(postBean.getPostEditCount() > 0) {%> ----------------------------------------<br/> [<fmt:message key="mvnforum.user.viewthread.edit"/> <%=postBean.getPostEditCount()%> , <fmt:message key="mvnforum.user.viewthread.last_edit_by"/> <%=postBean.getLastEditMemberName()%> <%=onlineUser.getGMTTimestampFormat(postBean.getPostLastEditDate())%>] <%}%> </td> </tr> <tr class="<%=color%>"> <td> <table class="<%=color%>" width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td nowrap> [<%=onlineUser.getGMTTimestampFormat(postBean.getPostCreationDate())%>] <%if ( permission.canAdminSystem() ) {%> <%if(postBean.getPostEditCount() > 0) { /* has edited*/%> [<fmt:message key="mvnforum.common.member.first_ip"/>: <%=postBean.getPostCreationIP()%> - : <%=postBean.getPostLastEditIP()%>] <%} else {/* never been edited*/%> [<font color="red"><%=postBean.getPostCreationIP()%>] <%}%> <%}%> <a href="printpost?post=<%=postBean.getPostID()%>"><fmt:message key=" title=""> </td> <td width="100%"> <%if (memberBean!=null) {%>    <a href="viewmember?memberid=<%=memberBean.getMemberID()%>"> <% if (MVNForumConfig.getEnablePrivateMessage()) { %>   <fmt:message key=" title=""><%}%> <%if (memberBean.getMemberEmailVisible() == 1) { if (onlineUser.isGuest()) {%>    <img src="<%=contextPath%>/mvnplugin/mvnforum/images/icon/button_email.gif" border="0" alt="" title=""> <%} else { %>    <a href="mailto:<%=memberBean.getMemberEmail()%>"><%=memberBean.getMemberEmail()%> <%} } %> <%if ((memberBean.getMemberHomepage().length() > 0) && (memberBean.getMemberHomepage().equals("http://")==false)) {%>   <%=memberBean.getMemberHomepage()%><%}%> <%if (memberBean.getMemberYahoo().length() > 0) {%>   <%=memberBean.getMemberYahoo()%><%}%> <%if (memberBean.getMemberAol().length() > 0) {%>   <%=memberBean.getMemberAol()%><%}%> <%if (memberBean.getMemberIcq().length() > 0) {%>   <%=memberBean.getMemberIcq()%><%}%> <%} else { /*guest*/%>   <%}%> </td> <td nowrap> <a href="#<%=postBean.getPostID()%>">[] <%if (onlineUser.isGuest()) {%> <img src="<%=contextPath%>/mvnplugin/mvnforum/images/icon/threat.gif" border="0" alt="" title=""> <%} else {%> <a href="mailto:<%=MVNForumConfig.getWebMasterEmail()%>?subject=Report threaten message (threadid = <%=postBean.getThreadID()%> and postid = <%=postBean.getPostID()%>)"><fmt:message key=" title=""> <%}%>  <a href="#"><fmt:message key=" title="">  </td> </tr> </table> </td> </tr> </table> </pg:item> <% }//for %> <table width="95%" align="center"> <tr> <td> <%@ include file="inc_pager.jsp"%> </td> <td align="right"> <a class="command" href="printthread?thread=<%=threadID%>">[] <% if (MVNForumConfig.getEnableNewPost() && (onlineUser.isGuest()||permission.canAddThread(forumID)) && (currentForumBean.getForumStatus()==ForumBean.FORUM_STATUS_DEFAULT) ) { %> <a class="command" href="addpost?forum=<%=forumID%>">[] <% }//if can new post%> </td> </tr> </table> </pg:pager> <br/> </fmt:bundle> <%@ include file="footer.jsp"%> </body> </html>

What this is

This file is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Other links

The source code

<%--
 - $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 
<head>
  <title> -  - <%=threadBean.getThreadTopic()%>
<%@ 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>
<form> <fmt:message key="mvnforum.common.quick_go"/> »
... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2024 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.