home | career | drupal | java | mac | mysql | perl | scala | uml | unix  
<td width="100%" nowrap> <a class="nav" href="index"> »  <fmt:message key="mvnforum.common.forum.homepage"/> </td> </tr> </table> <br/> <table align="center" border="0" cellpadding="0" cellspacing="0" width="95%"> <tr> <!-- Left section --> <td width="25%" valign="top"> <!-- Browse Forum Category --> <%if (onlineUser.isMember()) {%> <table class="tborder" border="0" cellspacing="1" cellpadding="4" width="100%"> <tr> <td align="center" class="theader"> <%=memberName%> </tr> <tr> <td class="trow1"> <fmt:message key="mvnforum.user.index.current_time"/>: <%=onlineUser.getGMTTimestampFormat(DateUtil.getCurrentGMTTimestamp())%>
<a href="logout" class="command"> </td> </tr> </table> <%} else { %> <table class="tborder" border="0" cellspacing="1" cellpadding="4" width="100%"> <tr> <td align="center" class="theader"> <fmt:message key="mvnforum.user.header.welcome"/> <%= ((memberName!=null) && (memberName.length()>0)) ? memberName : MVNForumConfig.getDefaultGuestName()%> </td> </tr> <%if (MVNForumConfig.getEnableLogin()) {%> <tr> <td class="trow1"> <form action="loginprocess" method="post" name="submitform"> <input type="hidden" name="FromLoginPage" value="true"> <input type="hidden" name="md5pw" value=""> <fmt:message key="mvnforum.common.member.login_name"/>
<input type="text" name="MemberName" size="15">
<fmt:message key="mvnforum.common.member.password"/>
<input type="password" name="MemberMatkhau" size="15" onKeyPress="checkEnter(event);">

<input type="button" name="submitbutton" value="
</form> <a href="iforgotpasswords" class="command"> </td> </tr> <% } %> </table> <% } %> <% //Copy code from listonlineusers.jsp Collection onlineUserActions = (Collection)request.getAttribute("OnlineUserActions"); if (MVNForumConfig.getEnableOnlineUsers()) { int guestCount = 0; int memberCount = 0; int invisibleMemberCount = 0; boolean enableInvisible = MVNForumConfig.getEnableInvisibleUsers(); for (Iterator countIterator = onlineUserActions.iterator(); countIterator.hasNext(); ) { OnlineUserAction onlineUserAction = (OnlineUserAction)countIterator.next(); boolean invisible = onlineUserAction.isInvisibleMember(); int mID = onlineUserAction.getMemberID(); if ( (mID==0) || (mID==MVNForumConstant.MEMBER_ID_OF_GUEST) ) { guestCount++; } else if (enableInvisible) { if ( invisible ) { invisibleMemberCount++; } else { memberCount++; } } else { // disable invisible feature memberCount++; } } // end of for%> <br/> <table class="tborder" border="0" cellspacing="1" cellpadding="4" width="100%"> <tr> <td align="center" class="theader"> </tr> <tr> <td class="trow1"> <fmt:message key="mvnforum.common.there_are"/> <%=onlineUserActions.size()%> (<b><%=guestCount%> <%if(guestCount>1) {%><%} else {%><%}%>, <b><%=memberCount%> <%if(memberCount>1){%><%} else {%><%}%> <%if (enableInvisible) {%> ,<%-- last comma if folling exists --%> <b><%=invisibleMemberCount%> <%if(invisibleMemberCount>1){%><%} else {%><%}%> <%}%> )<br/> <%-- second bracket --%>: <%boolean canAdmin = permission.canAdminSystem(); for (Iterator iterator = onlineUserActions.iterator(); iterator.hasNext(); ) { OnlineUserAction onlineUserAction = (OnlineUserAction)iterator.next(); boolean userInvisible = onlineUserAction.isInvisibleMember(); int mID = onlineUserAction.getMemberID(); String mName = onlineUserAction.getMemberName(); if ( (mID!=0) && (mID!=MVNForumConstant.MEMBER_ID_OF_GUEST) ) { %> <%if ( enableInvisible && userInvisible && !canAdmin) { %> <span class="memberName"> <%} else {%> <a href="viewmember?memberid=<%=mID%>" class="memberName"><%=mName%> <%if (enableInvisible && userInvisible && canAdmin) { %>()<%}%> <%}%> <%if (onlineUserAction.getSessionCount() > 1) { %> (<%=onlineUserAction.getSessionCount()%> ) <%}%> <% } /*if (not guest)*/%> <%} /*for*/%> <br/> <a href="listonlineusers" class="command"> </td> </tr> </table> <br/> <%}// end if enable online user%> <%if (MVNForumConfig.getEnableMostActiveThreads()) { Collection mostActiveThreads = (Collection)request.getAttribute("MostActiveThreads"); %> <table class="tborder" border="0" cellspacing="1" cellpadding="3" width="100%"> <tr> <td align="center" nowrap class="theader"> </tr> <% int index = 0; for (Iterator iter = mostActiveThreads.iterator(); iter.hasNext(); ) { ActiveThread thread = (ActiveThread)iter.next(); int postCount = thread.getLastPostCount(); %> <tr class="trow<%=index++%2 + 1%>"> <td class="messageText"> <% String typeImage = ""; switch (thread.getThreadType()) { case ThreadBean.THREAD_TYPE_STICKY: typeImage = "sticky.gif"; break; case ThreadBean.THREAD_TYPE_FORUM_ANNOUNCEMENT: typeImage = "announce.gif"; break; case ThreadBean.THREAD_TYPE_GLOBAL_ANNOUNCEMENT: typeImage = "global_announce.gif"; break; default:break; } %> <% if ( thread.getThreadType() != ThreadBean.THREAD_TYPE_DEFAULT) { %> <img src="<%=contextPath%>/mvnplugin/mvnforum/images/icon/<%=typeImage%>"/> <% }%> <% if ( thread.getAttachCount() > 0) {%> <img src="<%=contextPath%>/mvnplugin/mvnforum/images/icon/attach.gif" title="<%=thread.getAttachCount()%> <% if (thread.getAttachCount() == 1) {%><% } else {%><%}%>"/> <% } %> <a href="viewthread?thread=<%=thread.getThreadID()%>" class="command"><%=thread.getThreadTopic()%> (<b><%=postCount%> <% if (postCount == 1) {%><% } else { %><% } %>) </td> </tr> <% } //for %> <% if (mostActiveThreads.size() == 0) { %> <tr class="trow1"> <td align="center"> </tr> <% }// if no active threads %> </table> <br/> <%} // end enable most active threads %> <%if (MVNForumConfig.getEnableMostActiveMembers() ) {%> <table class="tborder" border="0" cellspacing="1" cellpadding="3" width="100%"> <tr> <td align="center" nowrap class="theader"> </tr> <%Collection mostActiveMembers = (Collection)request.getAttribute("MostActiveMembers"); int index = 0; for (Iterator iter = mostActiveMembers.iterator(); iter.hasNext(); ) { ActiveMember member = (ActiveMember)iter.next(); int postCount = member.getLastPostCount(); %> <tr class="trow<%=index++%2 + 1%>"> <td class="messageText"> <a href="viewmember?memberid=<%=member.getMemberID()%>" class="command"><%=member.getMemberName()%> (<%=postCount%> <% if (postCount == 1) {%><% } else { %><% } %>) </td> </tr> <% } %> <% if (mostActiveMembers.size() == 0) { %> <tr class="trow1"> <td align="center"> </tr> <% }// if no active members %> </table> <br/> <%} // end if enable most active members%> <% CategoryCache categoryCache = CategoryCache.getInstance(); ForumCache forumCache = ForumCache.getInstance(); Collection categoryBeans = categoryCache.getBeans(); Collection forumBeans = forumCache.getBeans(); if (MVNForumConfig.getEnableSiteStatisticsOverview()) { int numberOfThreads = MyUtil.getViewableThreads(forumBeans, permission); int numberOfPosts = MyUtil.getViewablePosts(forumBeans, permission); MemberBean lastMember = (MemberBean)request.getAttribute("MemberBean"); long numberOfMembers = ((Integer)request.getAttribute("NumberOfMembers")).intValue(); %> <table class="tborder" border="0" cellspacing="1" cellpadding="3" width="100%"> <tr> <td align="center" class="theader"> </tr> <tr> <td class="trow1"> <fmt:message key="mvnforum.common.totalcategories"/>: <%=MyUtil.getViewableCategories(categoryBeans, permission)%>
<fmt:message key="mvnforum.common.totalforum"/>: <%=MyUtil.getViewableForums(forumBeans, permission)%>
<fmt:message key="mvnforum.common.totaltopic"/>: <%=numberOfThreads%>
<fmt:message key="mvnforum.common.totalpost"/>: <%=numberOfPosts%>
<fmt:message key="mvnforum.common.totalmember"/>: <%=numberOfMembers%>
<fmt:message key="mvnforum.common.latestmember"/>: <%=lastMember.getMemberName()%>
</td> </tr> </table> <br/> <%} // end if enable show forum statistics%> <table class="tborder" border="0" cellspacing="1" cellpadding="3" width="100%"> <tr> <td align="center" class="theader"> </tr> <% int categoryCount = 0; for (Iterator categoryIterator = categoryBeans.iterator(); categoryIterator.hasNext(); ) { CategoryBean categoryBean = (CategoryBean)categoryIterator.next(); if (MyUtil.canViewAnyForumInCategory(categoryBean.getCategoryID(), permission) == false) continue; categoryCount++; %> <tr> <td align="center" class="tcat"> <b><%=categoryBean.getCategoryName()%> <a onclick="showhide('category_<%=categoryBean.getCategoryID()%>');return false" href="javascript:void(0)"> <img align="middle" border="0" height="13" width="14" src="<%=contextPath%>/mvnplugin/mvnforum/images/icon/arrow-subnav-down.gif"> </td> </tr> <tbody id="category_<%=categoryBean.getCategoryID()%>"> <% int i = 0; for (Iterator forumIterator = forumBeans.iterator(); forumIterator.hasNext(); ) { ForumBean forumBean = (ForumBean)forumIterator.next(); if (forumBean.getCategoryID() == categoryBean.getCategoryID()) { if (permission.canReadPost(forumBean.getForumID()) && (forumBean.getForumStatus() != ForumBean.FORUM_STATUS_DISABLED) ) { %> <tr> <td align="center" class="trow<%=(i++%2)+1%>"><%=forumBean.getForumName()%> </tr> <%} } }//for %> </tbody> <% }// end loop on category if ( categoryCount == 0 ) {%> <tr> <td align="center" class="trow1"> <fmt:message key="mvnforum.user.listforums.table.no_category"/> </td> </tr> <% } %> </table> </td> <!-- End of left section --> <td style="width: 5px;">   <!-- Center section --> <% Collection coLastPosts = (Collection)request.getAttribute("LastPosts"); %> <td width="80%" valign="top"> <table class="tborder" border="0" cellpadding="4" cellspacing="1" width="100%"> <tr> <td class="theader"> </tr> </table> <% int i = 0; for (Iterator postIterator = coLastPosts.iterator(); postIterator.hasNext(); ) { List infoList = (List)postIterator.next(); PostBean postBean = (PostBean)infoList.get(0); ThreadBean threadBean = (ThreadBean)infoList.get(1); ForumBean forumBean = forumCache.getBean(threadBean.getForumID()); if (permission.canReadPost(postBean.getForumID()) && (forumBean.getForumStatus() != ForumBean.FORUM_STATUS_DISABLED) ) { i++; %> <table class="tborder" border="0" cellpadding="4" cellspacing="1" width="100%"> <tr> <td class="trow<%=(i%2)+1%>"> <fmt:message key="mvnforum.common.forum"/>: <%=forumBean.getForumName()%> » <fmt:message key="mvnforum.common.thread"/>: <%=threadBean.getThreadTopic()%> </td> </tr> <tr> <td class="trow<%=(i%2)+1%>"> <fmt:message key="mvnforum.common.post.post_by"/> <%=postBean.getMemberName()%> <fmt:message key="mvnforum.common.at"/> <%=onlineUser.getGMTTimestampFormat(postBean.getPostCreationDate())%> </td> </tr> <tr> <td class="trow<%=(i%2)+1%>"> <b><%=MyUtil.filter(postBean.getPostTopic(), false/*html*/, true/*emotion*/, true/*mvnCode*/, false/*newLine*/, false/*URL*/)%>
<%=MyUtil.filter(StringUtil.getShorterString(postBean.getPostBody(), MVNForumConfig.getMaxCharsInLongSummary()), false/*html*/, true/*emotion*/, true/*mvnCode*/, true/*newLine*/, true/*URL*/)%> </td> </tr> <tr> <td class="trow<%=(i%2)+1%>"> <fmt:message key="mvnforum.common.reply_count"/>: <%=threadBean.getThreadReplyCount()%> :: <% if (MVNForumConfig.getEnableNewPost() && (onlineUser.isGuest()||permission.canAddPost(forumBean.getForumID())) && (threadBean.getThreadStatus()==ThreadBean.THREAD_STATUS_DEFAULT) && (forumBean.getForumStatus()==ForumBean.FORUM_STATUS_DEFAULT) ) { %> <a href="addpost?parent=<%=postBean.getPostID()%>" class="command"> <% }//if can new post%> </td> </tr> </table> <br/> <% } }%> <% if ( i == 0 ) { %> <table class="tborder" border="0" cellpadding="4" cellspacing="1" width="100%"> <tr> <td align="center" class="trow1"> </tr> </table> <%}%> </td> <!-- End of Center section --> <%-- [minhnn]: I comment out this as a default for most site, if you need a right column for logo advertisement, please uncomment it. <td style="width: 5px;">   <!-- Right section --> <td width="30%" valign="top"> <table class="tborder" border="0" cellspacing="1" cellpadding="4" width="100%"> <tr> <td align="center" class="theader">Advertisement </tr> <tr> <td class="trow1"> <a href="http://www.mvnforum.com">mvnForum </td> </tr> <tr> <td class="trow2"> <a href="http://www.mvnforum.com">mvnForum </td> </tr> </table> </td> <!-- End of Right section --> --%> </tr> </table> <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/index.jsp,v 1.75 2005/01/30 18:43:41 minhnn Exp $
 - $Author: minhnn $
 - $Revision: 1.75 $
 - $Date: 2005/01/30 18:43:41 $
 -
 - ====================================================================
 -
 - 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
 --%>
<%@ page contentType="text/html;charset=utf-8" %>
<%@ page errorPage="fatalerror.jsp"%>
<%@ page import="java.util.*" %>
<%@ page import="com.mvnforum.db.*" %>
<%@ page import="com.mvnforum.common.*" %>
<%@ page import="com.mvnforum.MyUtil" %>
<%@ page import="com.mvnforum.auth.OnlineUserAction" %>
<%@ page import="com.mvnforum.MVNForumConstant" %>

<%@ page import="net.myvietnam.mvncore.util.DateUtil" %>
<%@ page import="net.myvietnam.mvncore.util.StringUtil" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<%@ include file="inc_common.jsp"%>
<fmt:bundle basename="mvnForum_i18n">
<html 
<head>
  <title> - 
<%@ include file="/mvnplugin/mvnforum/meta.jsp"%>
<link href="<%=onlineUser.getCssPath()%>" rel="stylesheet" type="text/css">
</head>
<body leftmargin="0" topmargin="0">
<script language="JavaScript" src="<%=contextPath%>/mvnplugin/mvnforum/js/md5.js">
<%@ include file="header.jsp"%>
<script type="text/javascript">
function checkEnter(event) {
  var agt=navigator.userAgent.toLowerCase();

  // Maybe, Opera make an onClick event when user press enter key
  // on the text field of the form
  if (agt.indexOf('opera') >= 0) return;

  // enter key is pressed
  if (getKeyCode(event) == 13) // myvietnam.js
    SubmitForm();
}

function SubmitForm() {
  if (ValidateForm() == true) {
    pw2md5(document.submitform.MemberMatkhau, document.submitform.md5pw);
    document.submitform.submitbutton.disabled=true;
    document.submitform.submit();
  }
}

function ValidateForm() {
  if (isBlank(document.submitform.MemberName, "<fmt:message key="mvnforum.common.member.login_name"/>")) return false;
  if (isBlank(document.submitform.MemberMatkhau, "<fmt:message key="mvnforum.common.member.password"/>")) return false;
  //Check Password's length
  if (document.submitform.MemberMatkhau.value.length < 3) {
    alert("<fmt:message key="mvnforum.common.js.prompt.invalidlongpassword"/>");
    document.submitform.MemberMatkhau.focus();
    return false;
  }
  return true;
}
</script>
<br/>

<table width="95%" align="center">
  <tr class="nav">
    <td>


my book on functional programming

 

new blog posts

 

Copyright 1998-2019 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.