📄 searchresult.jsp
字号:
<%--
- $Header: /cvsroot/mvnforum/mvnforum/srcweb/mvnplugin/mvnforum/user/searchresult.jsp,v 1.5 2003/06/03 17:10:49 minhnn Exp $
- $Author: minhnn $
- $Revision: 1.5 $
- $Date: 2003/06/03 17:10:49 $
-
- ====================================================================
-
- Copyright (C) 2002, 2003 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.Collection" %>
<%@ page import="java.util.Iterator" %>
<%@ page import="net.myvietnam.mvncore.util.ParamUtil" %>
<%@ page import="net.myvietnam.mvncore.util.StringUtil" %>
<%@ page import="net.myvietnam.mvncore.filter.EnableEmotionFilter" %>
<%@ page import="net.myvietnam.mvnplugin.mvnforum.db.*" %>
<%@ page import="net.myvietnam.mvnplugin.mvnforum.MyUtil" %>
<%@ page import="net.myvietnam.mvnplugin.mvnforum.MVNForumGlobal" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<%@ include file="inc_common.jsp"%>
<html>
<head>
<title>mvnForum - Rezultati pretraživanja</title>
<%@ include file="/mvnplugin/mvnforum/meta.jsp"%>
</head>
<link href="<%=contextPath%>/mvnplugin/mvnforum/css/style.css" rel=stylesheet type=text/css>
<body leftmargin=0 topmargin=0>
<%@ include file="header.jsp"%>
<p>
<table width="95%" align="center">
<tr class="nav">
<td><img src="<%=contextPath%>/mvnplugin/mvnforum/images/nav.gif"></td>
<td width="100%" nowrap>
<a class="navLink" href="index">mvnForum</a> »
<a class="navLink" href="search">Forma za pretraživanje</a> »
Rezultati pretraživanja
</td>
</tr>
</table>
<p>
<%
int totalPosts = ((Integer)request.getAttribute("TotalPosts")).intValue();
Collection postBeans = (Collection) request.getAttribute("PostBeans");
CategoryCache categoryCache = CategoryCache.getInstance();
ForumCache forumCache = ForumCache.getInstance();
%>
<table width="95%" align="center">
<tr>
<td class="hightlight">Ukupan broj poruka koje odgovaraju Vašem kriterijumu za pretraživanje : <%=totalPosts%></td>
</tr>
</table>
<table width="95%" border="0" cellspacing="1" cellpadding="3" align="center" bgcolor="#999999">
<tr bgcolor="#666699" class="header">
<td colspan="2">Poruka</td>
<td>Forum</td>
<td align="center">Datum poruke</td>
</tr>
<%
int odd = 0;
Iterator iterator = postBeans.iterator();
while(iterator.hasNext()) {
odd = (odd + 1)%2;
PostBean postBean = (PostBean)iterator.next();
%>
<%if (odd == 0) {%>
<tr bgColor=#f5f5f5>
<%} else {%>
<tr bgcolor="White">
<%}%>
<td width="16"><%=EnableEmotionFilter.filter(postBean.getPostIcon(), ParamUtil.getContextPath() + MVNForumGlobal.EMOTION_DIR)%></td>
<td>
<a class="messageTopic" href="viewthread?thread=<%=postBean.getThreadID()%>">
<%=MyUtil.filter(postBean.getPostTopic(), false/*html*/, true/*emotion*/, false/*mvnCode*/, false/*newLine*/, false/*URL*/)%>
</a><br>
<div class="messageText">
<%=MyUtil.filter(StringUtil.getShorterString(postBean.getPostBody()), false/*html*/, true/*emotion*/, false/*mvnCode*/, false/*newLine*/, false/*URL*/)%>
</div>
</td>
<td><a class="messageTopic" href="listthreads?forum=<%=postBean.getForumID()%>"><%=forumCache.getBean(postBean.getForumID()).getForumName()%></a></td>
<td align="center" class="messageText">
<%=onlineUser.getGMTTimestampFormat(postBean.getPostCreationDate())%><br>od
<a href="viewmember?member=<%=postBean.getMemberName()%>" class="messageTextBoldBlue">
<%=postBean.getMemberName()%>
</a>
</td>
</tr>
<%
}//while
if (totalPosts == 0) {
%>
<tr><td colspan="4" align="center" bgcolor="#f5f5f5" class="messageText">Nema poruka koje odgovaraju postavljenim kriterijumima. Pokušajte ponovo</td></tr>
<%}%>
</table>
<%if (totalPosts > 0) {%>
<p align="center" class="messageText">Strana:
<%
int offset = ((Integer)request.getAttribute("offset")).intValue();
int rowsToReturn = ((Integer)request.getAttribute("rowsToReturn")).intValue();
int forumID = ((Integer)request.getAttribute("ForumID")).intValue();
String searchText = (String)request.getAttribute("SearchText");
String searchMemberName = (String)request.getAttribute("MemberName");
int limit = 10* rowsToReturn;
int leftLimit = offset - limit;
if (leftLimit < 0) leftLimit = 0;
int rightLimit = offset + limit;
if (rightLimit > (totalPosts-1)) rightLimit = totalPosts-1;
int previousOffset = offset - rowsToReturn;
int nextOffset = offset + rowsToReturn;
if (previousOffset >= leftLimit) {%>
<a href="<%=getSearchLink(previousOffset, totalPosts, rowsToReturn, searchText, searchMemberName, forumID)%>"><img src="<%=contextPath%>/mvnplugin/mvnforum/images/icon/left.gif" border="0" alt="Prethodna strana"></a>
<% }
for (int i = leftLimit; i <= rightLimit; i += rowsToReturn) {
int pageIndex = i/rowsToReturn + 1;
if (offset == i) {
out.print("" + pageIndex + " ");
} else {
%>
<a href="<%=getSearchLink(i, totalPosts, rowsToReturn, searchText, searchMemberName, forumID)%>"><%=pageIndex%></a>
<%
}//else
}//for
if (nextOffset <= rightLimit) {%>
<a href="<%=getSearchLink(nextOffset, totalPosts, rowsToReturn, searchText, searchMemberName, forumID)%>"><img src="<%=contextPath%>/mvnplugin/mvnforum/images/icon/right.gif" border="0" alt="Sledeća strana"></a>
<% }
%>
</p>
<%}%>
<%!
String getSearchLink(int offset, int totalPosts, int rowsToReturn, String searchText, String memberName, int forumID) {
return "searchprocess?offset=" + offset + "&SearchText=" + searchText + "&MemberName=" + memberName + "&ForumID=" + forumID + "&rowsToReturn=" + rowsToReturn;
}
%>
<p>
<%@ include file="footer.jsp"%>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -