alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  
<td width="100%" nowrap> <a class="nav" href="index"> »  <a class="nav" href="search"> »  <fmt:message key="mvnforum.user.searchresult.title"/> </td> </tr> </table> <br/> <form action="searchprocess" name="submitform"> <input type="hidden" name="offset" value="0"> <table class="tborder" width="95%" cellspacing="1" cellpadding="3" align="center"> <tr class="theader"> <td colspan="2">: </tr> <tr class="trow1"> <td> <td> </tr> <tr class="trow2"> <td> <td> </tr> <tr class="trow1"> <td> <td> <select name="scopeinpost" class="noborder"> <option id="scope3" value="3"> <option id="scope1" value="1"> <option id="scope2" value="2"> </select> </td> </tr> <tr class="trow2"> <td> <td> <select name="forum"> <option value="0" selected> <% CategoryCache categoryCache = CategoryCache.getInstance(); ForumCache forumCache = ForumCache.getInstance(); Collection categoryBeans = categoryCache.getBeans(); Collection forumBeans = forumCache.getBeans(); for (Iterator catIter = categoryBeans.iterator(); catIter.hasNext(); ) { CategoryBean categoryBean = (CategoryBean)catIter.next(); int categoryID = categoryBean.getCategoryID(); if (MyUtil.canViewAnyForumInCategory(categoryID, permission) == false) continue; %> <option value=""> <option id="forum-<%=categoryID%>" value="-<%=categoryID%>"><%=categoryBean.getCategoryName()%> <option value="">--------------------------------- <% for (Iterator forumIter = forumBeans.iterator(); forumIter.hasNext(); ) { ForumBean forumBean = (ForumBean)forumIter.next(); if (forumBean.getCategoryID() != categoryID) continue; if (permission.canReadPost(forumBean.getForumID()) && (forumBean.getForumStatus() != ForumBean.FORUM_STATUS_DISABLED) ) { %> <option id="forum<%=forumBean.getForumID()%>" value="<%=forumBean.getForumID()%>">     <%=forumBean.getForumName()%> <% } //if } // for forum }// for category %> </select> </td> </tr> <tr class="trow1"> <td> <td> <select name="date"> <option id="date0" value="0"> <option id="date1" value="1"> <option id="date7" value="7"> <option id="date14" value="14"> <option id="date30" value="30"> <option id="date90" value="90"> <option id="date180" value="180"> <option id="date365" value="365"> </select> <select name="beforeafter"> <option id="beforeafter1" value="1"> <option id="beforeafter2" value="2"> </select> </td> </tr> <tr class="trow2"> <td> <td> <fmt:message key="mvnforum.user.search.attachment.has_at_least"/>   <select name="minattach" class="noborder"> <option id="attach0" value="0">0 <option id="attach1" value="1">1 <option id="attach2" value="2">2 <option id="attach3" value="3">3 <option id="attach4" value="4">4 <option id="attach5" value="5">5 <option id="attach6" value="6">6 <option id="attach7" value="7">7 <option id="attach8" value="8">8 <option id="attach9" value="9">9 </select>   <fmt:message key="mvnforum.common.attachments"/> </td> </tr> <tr class="trow1"> <td> <td> <select name="rows" size="1"> <option value="10">10 <option value="20" selected>20 <option value="30">30 <option value="50">50 <option value="100">100 </select> </td> </tr> <%if (currentLocale.equals("vi")) {/*vietnamese here*/%> <tr class="trow2"> <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="button" name="submitbutton" value=" <input type="reset" value=" </td> </tr> </table> </form> <br/> <% int resultPerPage = ((Integer)request.getAttribute("rows")).intValue(); int totalPosts = ((Integer)request.getAttribute("TotalPosts")).intValue(); Collection postBeans = (Collection) request.getAttribute("PostBeans"); //ForumCache forumCache = ForumCache.getInstance(); %> <pg:pager url="searchprocess" items="<%= totalPosts %>" maxPageItems="<%= resultPerPage %>" 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="key"/> <pg:param name="member"/> <pg:param name="forum"/> <pg:param name="date"/> <pg:param name="beforeafter"/> <pg:param name="minattach"/> <pg:param name="rows"/> <table width="95%" align="center"> <tr> <td> <%@ include file="inc_pager.jsp"%> </td> </tr> </table> <table class="tborder" width="95%" cellspacing="1" cellpadding="3" align="center"> <tr class="theader"> <td colspan="2"> <td> <td align="center"> </tr> <% int rowIndex = 0; for (Iterator iterator = postBeans.iterator(); iterator.hasNext(); ) { PostBean postBean = (PostBean)iterator.next(); %> <pg:item> <tr class="trow<%=(rowIndex++)%2 + 1%>"> <td width="16"><%=EnableEmotionFilter.filter(postBean.getPostIcon(), ParamUtil.getContextPath() + MVNForumGlobal.EMOTION_DIR)%> <td> <% if ( postBean.getPostAttachCount() > 0) { %> <img src="<%=contextPath%>/mvnplugin/mvnforum/images/icon/attach.gif"/> <% } %> <a class="messageTopic" href="viewthread?thread=<%=postBean.getThreadID()%>#<%=postBean.getPostID()%>"> <%=MyUtil.filter(postBean.getPostTopic(), false/*html*/, true/*emotion*/, false/*mvnCode*/, false/*newLine*/, false/*URL*/)%> <br/> <%=MyUtil.filter(StringUtil.getShorterString(postBean.getPostBody(), MVNForumConfig.getMaxCharsInShortSummary()), false/*html*/, true/*emotion*/, false/*mvnCode*/, false/*newLine*/, false/*URL*/)%> </td> <td><%=forumCache.getBean(postBean.getForumID()).getForumName()%> <td align="center"> <%=onlineUser.getGMTTimestampFormat(postBean.getPostCreationDate())%>
<a href="viewmember?member=<%=Encoder.encodeURL(postBean.getMemberName())%>" class="memberName"><%=postBean.getMemberName()%> </td> </tr> </pg:item> <% }//for if (totalPosts == 0) { %> <tr class="trow1">
<%}%> </table> <table width="95%" align="center"> <tr> <td> <%@ include file="inc_pager.jsp"%> </td> </tr> </table> </pg:pager> <br/> </fmt:bundle> <%@ include file="footer.jsp"%> <script language="JavaScript" type="text/javascript"> <!-- InitParam(); //--> </script> </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/searchresult.jsp,v 1.40.2.1 2005/05/20 08:52:57 minhnn Exp $
 - $Author: minhnn $
 - $Revision: 1.40.2.1 $
 - $Date: 2005/05/20 08:52:57 $
 -
 - ====================================================================
 -
 - 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.util.ParamUtil" %>
<%@ page import="net.myvietnam.mvncore.util.StringUtil" %>
<%@ page import="net.myvietnam.mvncore.filter.DisableHtmlTagFilter" %>
<%@ page import="net.myvietnam.mvncore.filter.EnableEmotionFilter" %>
<%@ page import="net.myvietnam.mvncore.security.Encoder" %>
<%@ page import="com.mvnforum.db.*" %>
<%@ page import="com.mvnforum.MyUtil" %>
<%@ page import="com.mvnforum.MVNForumGlobal" %>
<%@ 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">
<html 
<%
    String key = ParamUtil.getParameter(request, "key");
    key = DisableHtmlTagFilter.filter(key);// always disable HTML
    String member = ParamUtil.getParameter(request, "member");
    member = DisableHtmlTagFilter.filter(member);// always disable HTML
    
    // below parameters are checked in the Handler
    String scopeInPost = ParamUtil.getParameter(request, "scopeinpost");
    String forum = ParamUtil.getParameter(request, "forum");
    String date = ParamUtil.getParameter(request, "date");
    String beforeafter = ParamUtil.getParameter(request, "beforeafter");
    String minattach = ParamUtil.getParameter(request, "minattach");
%>
<script language="JavaScript1.2" src="<%=contextPath%>/mvnplugin/mvnforum/js/vietuni.js" type="text/javascript">

<head>
  <title> - 
<%@ include file="/mvnplugin/mvnforum/meta.jsp"%>
<link href="<%=onlineUser.getCssPath()%>" rel="stylesheet" type="text/css">
</head>
<body leftmargin="0" topmargin="0">

<script type="text/javascript">
function SubmitForm() {
  if (ValidateForm() == true ) {
    document.submitform.submitbutton.disabled=true;
    document.submitform.submit();
  }
}
function ValidateForm() {
  if (document.submitform.key.value == '' && document.submitform.member.value == '' && document.submitform.minattach.options[document.submitform.minattach.selectedIndex].value == "0") {
    alert("<fmt:message key="mvnforum.user.search.js.prompt.at_least_one_item"/> (, , )");
    return false;
  }
  return true;
}

function InitParam() {
  var date =        document.submitform.date;
  var beforeafter = document.submitform.beforeafter;
  var minattach =   document.submitform.minattach;
  <% if ( scopeInPost.length() > 0 ) {%> 
    var id = document.getElementById("scope<%=scopeInPost%>");
    if (id !=null) id.selected = true;
  <% }%>
  <% if ( date.length() > 0 ) {%> 
    var id = document.getElementById("date<%=date%>");
    if (id !=null) id.selected = true;
  <% }%>
  <% if ( forum.length() > 0 ) {%>
    var id = document.getElementById("forum<%=forum%>");
    if (id !=null) id.selected = true;
  <% }%>
  
  <% if ( beforeafter.length() > 0 ) {%> 
    var id = document.getElementById("beforeafter<%=beforeafter%>");
    if (id !=null) id.selected = true;
  <% }%>  
  <% if ( minattach.length() > 0 ) {%> 
    var id = document.getElementById("minattach<%=minattach%>");
    if (id !=null) id.selected = true;
  <% }%>  
}
</script>

<%@ include file="header.jsp"%>
<br/>

<table width="95%" align="center">
  <tr class="nav">
    <td>
... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

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