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%> »  <%=mode%> <% if (action.equals("addnew")) { if (parentPostID != 0) { out.print(" : " + replyTopic); } } else if (action.equals("update")) { out.print(" : " + postTopic); } %> </td> </tr> </table> <br/> <table width="95%" align="center"> <tr class="messageText"> </table> <br/> <%if (isPreviewing) { MemberBean memberBean = (MemberBean)request.getAttribute("MemberBean");%> <table class="tborder" width="95%" cellspacing="1" cellpadding="5" align="center"> <tr class="trow1"> <td width="155" rowspan="2" valign="top" nowrap> <%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) { %> <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()%> </td> <td valign="top"> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="100%" rowspan="2" valign="top" class="messageTextBold"> <%if (postIcon.length() > 0) { out.print(EnableEmotionFilter.filter(postIcon + "  ", ParamUtil.getContextPath() + MVNForumGlobal.EMOTION_DIR)); } %> <%=MyUtil.filter(postTopic, false/*html*/, true/*emotion*/, false/*mvnCode*/, false/*newLine*/, false/*URL*/)%> </td> </tr> </table> <hr size="1" noshade> <%=MyUtil.filter(postBody, false/*html*/, true/*emotion*/, true/*mvnCode*/, true/*newLine*/, true/*URL*/)%> <% String signature = MyUtil.filter(memberBean.getMemberSignature(), false/*html*/, true/*emotion*/, true/*mvnCode*/, true/*newLine*/, true/*URL*/); if (signature.length() > 0) { %> ----------------------------------------<br> <%=signature%> <%}%> </td> </tr> <tr class="trow1"> <td> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="100%">    <a href="viewmember?memberid=<%=memberBean.getMemberID()%>"> <% if (MVNForumConfig.getEnablePrivateMessage()) { %>   <fmt:message key=" title=""><%}%> <%if (memberBean.getMemberEmailVisible() == 1) {%>    <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()%><%}%> </td> <td nowrap> <img src="<%=contextPath%>/mvnplugin/mvnforum/images/icon/threat.gif" border="0" alt="" title="">  <a href="#"><fmt:message key=" title="">  </td> </tr> </table> </td> </tr> </table> <br/> <%} // isPreviewing%> <%if (action.equals("addnew")) {%> <form action="addpostprocess" method="post" name="mvnform"> <input type="hidden" name="forum" value="<%=ParamUtil.getParameter(request, "forum")%>"> <input type="hidden" name="parent" value="<%=parentPostID%>"> <%} else {//update%> <form action="updatepost" method="post" name="mvnform"> <input type="hidden" name="post" value="<%=postToEdit.getPostID()%>"> <input type="hidden" name="parent" value="<%=parentPostID%>"> <input type="hidden" name="offset" value="<%=ParamUtil.getParameter(request, "offset")%>"> <%}%> <table class="tborder" width="95%" cellspacing="1" cellpadding="3" align="center"> <tr class="theader"> <td colspan="2"><%=fullmode%> </tr> <tr class="trow1"> <td width="170" nowrap> * <td> </tr> <tr class="trow2"> <td valign="top" nowrap> <fmt:message key="mvnforum.user.addpost.format"/>
<input onmouseover="stat('norm')" title="
<input onmouseover="stat('enha')" title=" </td> <td> <table cellspacing="0" cellpadding="0" border="0"> <tr> <td nowrap> <input class="liteoption" style="font-weight: bold;" onmouseover="stat('b')" title=" onclick="mvncode(this.form,'b','')" type=button value=" "> <input class="liteoption" style="font-style: italic;" onmouseover="stat('i')" title=" onclick="mvncode(this.form,'i','')" type=button value=" "> <input class="liteoption" style="text-decoration: underline;" onmouseover="stat('u')" title=" onclick="mvncode(this.form,'u','')" type=button value=" "> <input class="liteoption" style="text-decoration: line-through;" onmouseover="stat('s')" title=" onclick="mvncode(this.form,'s','')" type=button value=" ">  <select id="sizeselect" onmouseover="stat('size')" onchange="fontformat(this.form,this.options[this.selectedIndex].value,this.options[this.selectedIndex].text,'size')"> <option value="0" selected> <option value="1"> <option value="3"> <option value="4"> </select> <select id="fontselect" onchange="fontformat(this.form,this.options[this.selectedIndex].value,this.options[this.selectedIndex].text,'font')" onMouseOver="stat('font')"> <option value="0" selected> <option value="arial">Arial <option value="times new roman">Times <option value="courier new">Courier <option value="century gothic">Century </select> <select id="colorselect" onmouseover="stat('color')" onchange="fontformat(this.form,this.options[this.selectedIndex].value,this.options[this.selectedIndex].text,'color')"> <option value="0" selected> <option style="COLOR: skyblue" value="skyblue"> <option style="COLOR: royalblue" value="royalblue"> <option style="COLOR: blue" value="blue"> <option style="COLOR: darkblue" value="darkblue"> <option style="COLOR: orange" value="orange"> <option style="COLOR: orangered" value="orangered"> <option style="COLOR: crimson" value="crimson"> <option style="COLOR: red" value="red"> <option style="COLOR: firebrick" value="firebrick"> <option style="COLOR: darkred" value="darkred"> <option style="COLOR: green" value="green"> <option style="COLOR: limegreen" value="limegreen"> <option style="COLOR: seagreen" value="seagreen"> <option style="COLOR: deeppink" value="deeppink"> <option style="COLOR: tomato" value="tomato"> <option style="COLOR: coral" value="coral"> <option style="COLOR: purple" value="purple"> <option style="COLOR: indigo" value="indigo"> <option style="COLOR: burlywood" value="burlywood"> <option style="COLOR: sandybrown" value="sandybrown"> <option style="COLOR: sienna" value="sienna"> <option style="COLOR: chocolate" value="chocolate"> <option style="COLOR: teal" value="teal"> <option style="COLOR: silver" value="silver"> </select> <br/> <input class="liteoption" onmouseover="stat('url')" title=""> <input class="liteoption" onmouseover="stat('email')" title=""> <input class="liteoption" onmouseover="stat('img')" title="">   <input class="liteoption" onmouseover="stat('code')" title=""> <input class="liteoption" onmouseover="stat('list')" title=""> <input class="liteoption" onmouseover="stat('quote')" title=""> <br> <input type="text" name="status" value=" </td> <td>  <td class="messageText"> <input class="liteoption" onmouseover="stat('closecurrent')" title=" onclick=closetag(this.form) type=button value=" x ">
<input class="liteoption" onmouseover="stat('closeall')" title=" onclick=closeall(this.form) type=button value=" x "> </td> </tr> </table> </td> </tr> <tr class="trow1"> <td valign="top" nowrap> <fmt:message key="mvnforum.common.post.body"/> * <% if (MVNForumConfig.getEnableEmoticon()) { %> <table border="0" cellspacing="1" cellpadding="3" align="center" class="smilieTable"> <tr> <td colspan="3" align="center" bgcolor="#F5F5F5" style="BORDER-RIGHT: 1px inset; BORDER-TOP: 1px inset; BORDER-LEFT: 1px inset; BORDER-BOTTOM: 1px inset"> <span class="messageTextBold"> </td> </tr> <tr align="middle"> <td>smile  <td>sad  <td>big grin  </tr> <tr align="middle"> <td>laughing  <td>crying  <td>wink  </tr> <tr align="middle"> <td>blushing  <td>tongue  <td>cool  </tr> <tr align="middle"> <td>love struck  <td>confused  <td>devilish  </tr> <tr> <td colspan="3" align="center" bgcolor="#F5F5F5" style="BORDER-RIGHT: 1px inset; BORDER-TOP: 1px inset; BORDER-LEFT: 1px inset; BORDER-BOTTOM: 1px inset"> <span class="messageText"> <table> <tr id="showlink"> <td align="center"> </tr> <tr id="hidelink" style="display: none;"> <td align="center"> </tr> </table> </td> </tr> </table> <% }//enable emoticon %> </td> <td valign="top"> </tr> <% if (MVNForumConfig.getEnableEmoticon()) { %> <tr class="trow1" id="MoreEmotion" style="display: none;"> <td colspan="2"> <table width="100%"> <tr> <td width="60%"> <table border="0" cellspacing="1" cellpadding="3" align="center" bgcolor="#FFFFFF" class="smilieTable"> <tr> <td colspan="9" align="center" bgcolor="#F5F5F5" style="BORDER-RIGHT: 1px inset; BORDER-TOP: 1px inset; BORDER-LEFT: 1px inset; BORDER-BOTTOM: 1px inset"> <span class="messageTextBold"> </td> </tr> <tr align="middle"> <td>smile  <td>sad  <td>wink  <td>big grin  <td>batting eyelashes  <td>confused  <td>love struck  <td>blushing  <td>tongue  </tr> <tr align="middle"> <td>kiss  <td>shock  <td>angry  <td>smug  <td>cool  <td>worried  <td>devilish  <td>crying  <td>laughing  </tr> <tr align="middle"> <td>straight face  <td>raised eyebrow  <td>angel  <td>nerd  <td>talk to the hand  <td>sleep  <td>rolling eyes  <td>sick  <td>shhh  </tr> <tr align="middle"> <td>not talking  <td>clown  <td>silly  <td>tired  <td>drooling  <td>thinking  <td>d oh  <td>applause  <td>hugs  </tr> </table> </td> <td> <table border="0" cellspacing="1" cellpadding="3" align="center" bgcolor="#FFFFFF" class="smilieTable"> <tr> <td colspan="6" align="center" bgcolor="#F5F5F5" style="BORDER-RIGHT: 1px inset; BORDER-TOP: 1px inset; BORDER-LEFT: 1px inset; BORDER-BOTTOM: 1px inset"> <span class="messageTextBold"> </td> </tr> <tr align="middle"> <td>pig  <td>cow  <td>monkey  <td>chicken  <td>rose  <td>good luck  </tr> <tr align="middle"> <td>flag  <td>pumpkin  <td>coffee  <td>idea  <td>skull  <td>alien 1  </tr> <tr align="middle"> <td>alien 2  <td>frustrated  <td>cowboy  <td>praying  <td>hypnotized  <td>money eyes  </tr> <tr align="middle"> <td>whistling  <td>liar  <td>beat up  <td>peace  <td>shame on you  <td>dancing  </tr> </table> </td> </tr> </table> </td> </tr> <% }//enable emoticon %> <% if (MVNForumConfig.getEnableEmoticon()) { %> <tr class="trow2"> <td valign="top" nowrap> <td> <input type="radio" name="PostIcon" id="PostIcon1" value="[:)]" class="noborder"> smile    <input type="radio" name="PostIcon" id="PostIcon2" value="[:(]" class="noborder"> sad       <input type="radio" name="PostIcon" id="PostIcon3" value="[:D]" class="noborder"> big grin    <input type="radio" name="PostIcon" id="PostIcon4" value="[=D>]" class="noborder"> applause    <input type="radio" name="PostIcon" id="PostIcon5" value="[B-)]" class="noborder"> cool    <input type="radio" name="PostIcon" id="PostIcon6" value="[@};-]" class="noborder"> rose    <br/> <input type="radio" name="PostIcon" id="PostIcon7" value="[:-/]" class="noborder"> confused    <input type="radio" name="PostIcon" id="PostIcon8" value="[:x]" class="noborder"> love struck    <input type="radio" name="PostIcon" id="PostIcon9" value="[:p]" class="noborder"> tongue    <input type="radio" name="PostIcon" id="PostIcon10" value="[:O]" class="noborder"> shock    <input type="radio" name="PostIcon" id="PostIcon11" value="[X-(]" class="noborder"> angry    <input type="radio" name="PostIcon" id="PostIcon12" value="[>:)]" class="noborder"> devilish   
<input type="radio" name="PostIcon" value="" checked class="noborder"> [ ] <script language="JavaScript"> checkPostIcon(); </script> </td> </tr> <% }//enable emoticon %> <% //@todo: put MVNForumConfig.getEnableFavoriteThread() instead of true-s in next TR if ( (MVNForumConfig.getEnableAttachment() && permission.canAddAttachment(forumID)) || ( onlineUser.isMember() && (MVNForumConfig.getEnableWatch() || true) ) ) { /* can add attachment, and/or watch and/or favorite-thread*/ %> <tr class="trow1"> <td valign="top"> <td valign="top"> <% if (MVNForumConfig.getEnableAttachment() && permission.canAddAttachment(forumID)) { %> <input type="checkbox" name="AttachMore" value="yes" class="noborder" <%if(attachMore){%>checked<%}%> >
<% } %> <% if (true) { %> <input type="checkbox" name="AddFavoriteParentThread" value="yes" class="noborder" <%if(addFavoriteThread){%>checked<%}%> > <%-- if (!permission.isActivated()) { @todo: add a comment that user must activate his email first a class="command" href="sendactivationcode" <fmt:message key="mvnforum.user.myprofile.link.activate"/> /a } --%> <br/> <% } %> <% if (MVNForumConfig.getEnableWatch() && permission.isActivated()) { %> <input type="checkbox" name="AddWatchParentThread" value="yes" class="noborder" <%if(addWatchThread){%>checked<%}%> > <% } %> </td> </tr> <% } %> <%int one = 0; int threadType = ParamUtil.getParameterInt(request, "ThreadType", ThreadBean.THREAD_TYPE_DEFAULT); if (action.equals("addnew") && parentPostID == 0 && permission.canModerateThread(forumID)) {/*choose thread type*/ one = 1;%> <tr class="trow2"> <td valign="top" nowrap> <td> <input type="radio" name="ThreadType" <%if (threadType == 0) {%> checked <%}%> id="0" value="0" class="noborder">
<input type="radio" name="ThreadType" <%if (threadType == 1) {%> checked <%}%> id="1" value="1" class="noborder">
<input type="radio" name="ThreadType" <%if (threadType == 2) {%> checked <%}%> id="2" value="2" class="noborder"> <%if (permission.canAdminSystem()) {%> <br/> checked <%}%> id="3" value="3" class="noborder"> <%}%> </td> </tr> <%}// end of choose thread type%> <%if (currentLocale.equals("vi")) {/*vietnamese here*/%> <tr class="trow<%=2-one%>"> <td valign="top" nowrap>Kiểu gõ tiếng Việt: <td> <input type="radio" name="vnselector" id="TELEX" value="TELEX" onClick="setTypingMode(1);" class="noborder"> Telex     <input type="radio" name="vnselector" id="VNI" value="VNI" onClick="setTypingMode(2);" class="noborder"> VNI     <input type="radio" name="vnselector" id="VIQR" value="VIQR" onClick="setTypingMode(3);" class="noborder"> VIQR
<input type="radio" name="vnselector" id="NOVN" value="NOVN" onClick="setTypingMode(0);" class="noborder"> Không sử dụng
<script language="JavaScript">initVNTyperMode(); </td> </tr> <%}// end if vietnamese%> <tr class="trowfinal"> <td colspan="2" align="center"> <input type="hidden" name="preview" value=""> <input type="button" name="previewbutton" value=" <input type="button" name="submitbutton" value="<%=mode%>" onclick="javascript:SubmitForm()" class="mainoption"> <input type="reset" value=" </td> </tr> </table> </form> <br/> <% if (action.equals("addnew") && (parentPostID != 0) ) { %> <table class="tborder" width="95%" cellspacing="1" cellpadding="3" align="center"> <tr class="theader"> <td colspan="2"><%=fullmode%> </tr> <tr class="trow1"> <td width="20%" valign="top"> <a href="viewmember?memberid=<%=parentPostBean.getMemberID()%>" class="memberName"><%=parentPostBean.getMemberName()%>
<fmt:message key="mvnforum.user.addpost.post_on"/>: <%=onlineUser.getGMTTimestampFormat(parentPostBean.getPostCreationDate())%> </td> <td> <b><%=MyUtil.filter(parentPostBean.getPostTopic(), false/*html*/, true/*emotion*/, false/*mvnCode*/, false/*newLine*/, false/*URL*/)%> <br> <%=MyUtil.filter(parentPostBean.getPostBody(), false/*html*/, true/*emotion*/, true/*mvnCode*/, true/*newLine*/, true/*URL*/)%> </td> </tr> </table> <br/> <table class="tborder" width="95%" cellspacing="1" cellpadding="3" align="center"> <tr class="theader"> <td colspan="2" align="center"> </tr> <% Collection postBeans = (Collection)request.getAttribute("PostBeans"); int rowIndex = 0; for (Iterator iterator = postBeans.iterator(); iterator.hasNext(); ) { PostBean postBean = (PostBean)iterator.next(); %> <tr class="trow<%=(rowIndex++)%2 + 1%>"> <td width="20%" valign="top"> <a href="viewmember?memberid=<%=postBean.getMemberID()%>" class="memberName"><%=postBean.getMemberName()%>
<fmt:message key="mvnforum.user.addpost.post_on"/>: <%=onlineUser.getGMTTimestampFormat(postBean.getPostCreationDate())%> </td> <td> <b> <%=MyUtil.filter(postBean.getPostTopic(), false/*html*/, true/*emotion*/, false/*mvnCode*/, false/*newLine*/, false/*URL*/)%> </b>
<%=MyUtil.filter(postBean.getPostBody(), false/*html*/, true/*emotion*/, true/*mvnCode*/, true/*newLine*/, true/*URL*/)%> </td> </tr> <% }//for %> </table> <% }// if reply to a topic, not new thread %> <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/addpost.jsp,v 1.97 2005/02/21 18:32:34 minhnn Exp $
 - $Author: minhnn $
 - $Revision: 1.97 $
 - $Date: 2005/02/21 18:32:34 $
 -
 - ====================================================================
 -
 - 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="net.myvietnam.mvncore.exception.BadInputException" %>
<%@ page import="net.myvietnam.mvncore.util.ParamUtil" %>
<%@ page import="net.myvietnam.mvncore.filter.EnableEmotionFilter" %>
<%@ page import="net.myvietnam.mvncore.filter.DisableHtmlTagFilter" %>
<%@ page import="net.myvietnam.mvncore.filter.EnableHtmlTagFilter" %>
<%@ page import="net.myvietnam.mvncore.filter.EnableMVNCodeFilter" %>
<%@ page import="net.myvietnam.mvncore.security.Encoder" %>
<%@ page import="com.mvnforum.MVNForumResourceBundle" %>
<%@ page import="com.mvnforum.MVNForumGlobal" %>
<%@ page import="com.mvnforum.MyUtil" %>
<%@ page import="com.mvnforum.db.*" %>
<%
/**
 * This page is used to do 2 actions
 * 1. add new post ( action=addnew ), either new thread or reply to a thread
 * 2. edit a post  ( action=update )
 */
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<%@ include file="inc_common.jsp"%>
<fmt:bundle basename="mvnForum_i18n">
<%
int parentPostID = 0;
try {
    parentPostID = ParamUtil.getParameterInt(request, "parent");
} catch (BadInputException e) {
    // do nothing
}
boolean isQuote = ParamUtil.getParameterBoolean(request, "quote");
boolean isPreviewing = ParamUtil.getParameterBoolean(request, "preview");
boolean attachMore = ParamUtil.getParameterBoolean(request, "AttachMore");
boolean addFavoriteThread = ParamUtil.getParameterBoolean(request, "AddFavoriteParentThread");
boolean addWatchThread = ParamUtil.getParameterBoolean(request, "AddWatchParentThread");
String action = (String)request.getAttribute("action");
if (action == null) action = "";

String mode;
String fullmode;
String replyTopic = "";
String postTopic = "";
String postBody = "";
String postIcon = "";
String previewUrl = "";

PostBean postToEdit  = null;// use when edit a post
PostBean parentPostBean = null;//use when reply to a post

if (action.equals("addnew")) {
    previewUrl = "addpost";
    if (parentPostID == 0) {
        mode = MVNForumResourceBundle.getString(onlineUser.getLocale(), "mvnforum.user.addpost.mode.addnew");
        fullmode = mode;
        replyTopic = "";
    } else {
        mode = MVNForumResourceBundle.getString(onlineUser.getLocale(), "mvnforum.user.addpost.mode.reply");
        // this is the parent of the reply
        parentPostBean = (PostBean)request.getAttribute("ParentPostBean");

        String REPLY_PREFIX = "Re: ";
        String parentPostTopic = parentPostBean.getPostTopic();
        if (parentPostTopic.startsWith(REPLY_PREFIX)) {
            postTopic = parentPostTopic;
        } else {
            postTopic = REPLY_PREFIX + parentPostTopic;
        }
        if (isQuote) {
            postBody = "[quote]" + parentPostBean.getPostBody() + "[/quote]\n";
        }
        replyTopic = parentPostBean.getPostTopic();
        fullmode = mode + " : " + replyTopic;
    }
} else if (action.equals("update")) {
    previewUrl = "editpost";
    mode = MVNForumResourceBundle.getString(onlineUser.getLocale(), "mvnforum.user.addpost.mode.update");
    postToEdit = (PostBean)request.getAttribute("PostToEdit");
    postTopic = postToEdit.getPostTopic();
    postBody = postToEdit.getPostBody();
    postIcon = postToEdit.getPostIcon();
    fullmode = mode + " : " + postTopic;
} else {
    throw new BadInputException("Cannot find the action!");
}

if (isPreviewing) {
    postTopic = ParamUtil.getParameter(request, "PostTopic", true);
    postTopic = DisableHtmlTagFilter.filter(postTopic);// always disable HTML

    postBody  = ParamUtil.getParameter(request, "message", true);// use message instead of MessageBody
    postBody = DisableHtmlTagFilter.filter(postBody);// always disable HTML

    postIcon = ParamUtil.getParameter(request, "PostIcon");
    postIcon = DisableHtmlTagFilter.filter(postIcon);// always disable HTML
}
%>
<html 
<head>
  <title> - <%=fullmode%>
<%@ include file="/mvnplugin/mvnforum/meta.jsp"%>
<link href="<%=onlineUser.getCssPath()%>" rel="stylesheet" type="text/css">
</head>
<script language="JavaScript" src="<%=contextPath%>/mvnplugin/mvnforum/js/mvncode.js">
<script language="JavaScript1.2" src="<%=contextPath%>/mvnplugin/mvnforum/js/vietuni.js" type="text/javascript">

<script type="text/javascript">
function SubmitForm() {
  if (ValidateForm() == true ) {
    document.mvnform.submitbutton.disabled=true;
    document.mvnform.previewbutton.disabled=true;
    document.mvnform.submit();
  }
}

function PreviewForm() {
  if (ValidateForm() == true ) {
    document.mvnform.preview.value='true';
    document.mvnform.action='<%=previewUrl%>';
    document.mvnform.submitbutton.disabled=true;
    document.mvnform.previewbutton.disabled=true;
    document.mvnform.submit();
  }
}

function ValidateForm() {
  if (isBlank(document.mvnform.PostTopic, "<fmt:message key="mvnforum.common.post.topic"/>")) return false;
  if (isBlank(document.mvnform.message, "<fmt:message key="mvnforum.common.post.body"/>")) return false;
  return true;
}
</script>
<!-- Language specific string constants used in mvncode.js -->
<script language="JavaScript">
// DO NOT ADD LINE-BREAKS BETWEEN THE "...." QUOTES!

// MINI-HELP MESSAGES
b_text = "<fmt:message key="mvnforum.user.addpost.js.message.boldtext"/>";
i_text = "<fmt:message key="mvnforum.user.addpost.js.message.italictext"/>";
u_text = "<fmt:message key="mvnforum.user.addpost.js.message.ulinetext"/>";
s_text = "<fmt:message key="mvnforum.user.addpost.js.message.stricetext"/>";

size_text = "<fmt:message key="mvnforum.user.addpost.js.message.sizetext"/>";
font_text = "<fmt:message key="mvnforum.user.addpost.js.message.fonttext"/>";
color_text = "<fmt:message key="mvnforum.user.addpost.js.message.colortext"/>";

url_text = "<fmt:message key="mvnforum.user.addpost.js.message.urltext"/>";
email_text = "<fmt:message key="mvnforum.user.addpost.js.message.emailtext"/>";
img_text = "<fmt:message key="mvnforum.user.addpost.js.message.imgtext"/>";

code_text = "<fmt:message key="mvnforum.user.addpost.js.message.codetext"/>";
php_text = "<fmt:message key="mvnforum.user.addpost.js.message.phptext"/>";
list_text = "<fmt:message key="mvnforum.user.addpost.js.message.listtext"/>";
quote_text = "<fmt:message key="mvnforum.user.addpost.js.message.quotetext"/>";

norm_text = "<fmt:message key="mvnforum.user.addpost.js.message.normaltext"/>";
enha_text = "<fmt:message key="mvnforum.user.addpost.js.message.enhancedtext"/>";

closecurrent_text = "<fmt:message key="mvnforum.user.addpost.js.message.tagclose"/>";
closeall_text = "<fmt:message key="mvnforum.user.addpost.js.message.tagcloseall"/>";

// ERROR MESSAGES
enhanced_only_text = "<fmt:message key="mvnforum.user.addpost.js.message.enhanconlytext"/>";
no_tags_text = "<fmt:message key="mvnforum.user.addpost.js.message.notagstext"/>";
already_open_text = "<fmt:message key="mvnforum.user.addpost.js.message.alreadyopentext"/>";

// TEXT FOR POP-UP PROMPTS
tag_prompt = "<fmt:message key="mvnforum.user.addpost.js.prompt.taginput"/>";
font_formatter_prompt = "<fmt:message key="mvnforum.user.addpost.js.prompt.fontformat"/>";

link_text_prompt = "<fmt:message key="mvnforum.user.addpost.js.prompt.linktext"/>";
link_url_prompt = "<fmt:message key="mvnforum.user.addpost.js.prompt.linkurl"/>";
link_email_prompt = "<fmt:message key="mvnforum.user.addpost.js.prompt.email"/>";

list_type_prompt = "<fmt:message key="mvnforum.user.addpost.js.prompt.listtype"/>";
list_item_prompt = "<fmt:message key="mvnforum.user.addpost.js.prompt.listitem"/>";
</script>

<script language="JavaScript">
function showMoreEmotion() {
    document.getElementById("MoreEmotion").style.display = '';
    document.getElementById("showlink").style.display = 'none';
    document.getElementById("hidelink").style.display = '';
}
function hideMoreEmotion() {
    document.getElementById("MoreEmotion").style.display = 'none';
    document.getElementById("showlink").style.display = '';
    document.getElementById("hidelink").style.display = 'none';
}
function checkPostIcon() {
    var iconToCheck = "<%=EnableHtmlTagFilter.filter(postIcon)%>";//we must enable html in javascript string
    var currentIcon;
    for (i = 1; i <= 12; i++) {
        currentIcon = document.getElementById("PostIcon" + i);
        if (currentIcon.value == iconToCheck) {
            currentIcon.checked = true;
            break;
        }
    }
}
</script>

<body leftmargin="0" topmargin="0">
<%@ include file="header.jsp"%>
<br/>

<%
CategoryCache categoryCache = CategoryCache.getInstance();
ForumCache forumCache = ForumCache.getInstance();
Collection categoryBeans = categoryCache.getBeans();
Collection forumBeans = forumCache.getBeans();

int forumID;
if (action.equals("addnew")) {
    if (parentPostID == 0) {// new thread
        forumID = ParamUtil.getParameterInt(request, "forum");
    } else {//reply to a post
        forumID = parentPostBean.getForumID();
    }
} else {//edit mode
    forumID = postToEdit.getForumID();
}
String forumName = forumCache.getBean(forumID).getForumName();
%>

<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.