?? searchcontent.jsp
字號:
<%@ page language="java" import="java.util.List" pageEncoding="gbk"%>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
<%@ page import="com.elan.forum.model.Forummodule"%>
<%@ page import="com.elan.forum.model.Forumpiece"%>
<%@ page import="com.elan.forum.model.ForumTopic"%>
<%
Integer pieceId = null;
Integer moduleId = null;
Integer topicId = null;
Integer hotReal = null;
String pieceIdStr = (String)request.getParameter("pieceIdStr");
String moduleIdStr = (String)request.getParameter("moduleIdStr");
String topicIdStr = (String)request.getParameter("topicIdStr");
pieceId = pieceIdStr != null && !"".equals(pieceIdStr.trim()) ? Integer.valueOf(pieceIdStr) : -1;
moduleId = moduleIdStr != null && !"".equals(moduleIdStr.trim()) ? Integer.valueOf(moduleIdStr) : -1;
topicId = topicIdStr != null && !"".equals(topicIdStr.trim()) ? Integer.valueOf(topicIdStr) : -1;
pieceId = request.getAttribute("pieceId") != null ? (Integer)request.getAttribute("pieceId") : -1;
moduleId = request.getAttribute("moduleId") != null ? (Integer)request.getAttribute("moduleId") : -1;
topicId = request.getAttribute("topicId") != null ? (Integer)request.getAttribute("topicId") : -1;
hotReal = request.getAttribute("hotReal") != null ? (Integer)request.getAttribute("hotReal") : -1;
%>
<script language="javascript">
var nowDate = new Date();
function getYear(yearStart) {
var strYear = "";
for(var i = yearStart + 1; i <= nowDate.getYear() ; i++) {
strYear += "<option value=\"" + i +"\">" + i + "年</option>";
}
return strYear;
}
function getMonth(monthStart) {
var strMonth = "<option value=\"1\">請選擇</option>";
for(var i = monthStart; i <= 12; i++) {
strMonth += "<option value=\"" + i + "\">" + i + "月</option>";
}
return strMonth;
}
function getDay(startDay) {
var strDay = "<option value=\"1\">請選擇</option>";
for(var i = startDay; i <= 31; i++) {
strDay += "<option value=\"" + i + "\">" + i + "日</option>";
}
return strDay;
}
// check search form
function checkSearchForm() {
//if(checkEmptyModule() && checkEmptyPiece() && checkEmptyTopicName() && checkEmptyTopicId()) {
// alert("sss");
//}
}
function checkEmptyModule() {
var objModule = getObject("module");
if(-1 == objModule[0].value) {
return true;
}
return false;
}
function checkEmptyPiece() {
var objPiece = getObject("piece");
if(-1 == objPiece) {
return true;
}
return false;
}
function checkEmptyTopicName() {
var objTopicName = getObject("topicName");
alert(objTopicName.value);
if("" == objTopicName.value) {
alert(objTopicName.value);
return true;
}
return false;
}
function checkEmptyAuthor() {
var objAuthor = getObject("author");
if("" == objAuthor) {
return true;
}
return false;
}
function checkEmptyTopicId() {
var objTopicId = getObject("topicId");
if("" == objTopicName.value) {
}
}
function getObject(objId) {
return document.getElementById(objId);
}
//隱藏搜索
function displaySearchForm() {
var objSearchForm = getObject("searchForm");
var objSearchHead = getObject("searchHead");
if(objSearchForm.style.display == 'none') {
objSearchForm.style.display = "";
objSearchHead.style.display = "none";
} else {
objSearchForm.style.display = "none";
objSearchHead.style.display = "";
}
return true;
}
</script>
<%
List<Forummodule> listModule = (List<Forummodule>) request
.getAttribute("listModule");
List<Forumpiece> listPiece = (List<Forumpiece>) request
.getAttribute("listPiece");
List<ForumTopic> listTopic = (List<ForumTopic>) request
.getAttribute("listTopic");
%>
<center>
<font color="red"><html:errors />
</font>
</center>
<form
action="<%=request.getContextPath()%>/forum/topic.do?action=search"
method="post">
<input type="hidden" name="isSearch" value="true">
<div id="searchHead" style="display: none">
<table width="100%" border="0" cellspacing="2" cellpadding="0"
class='forum_quote_content' style="BORDER: #91a9bd 2px solid;">
<thead>
<tr>
<th bgcolor="#a1a9bd" width="50">
<strong><font size="-1" id="fontText"><span
onclick="displaySearchForm()" style="cursor: pointer">+顯示</span>
</font>
</strong>
</th>
<th colspan="3" bgcolor="#a1a9bd">
<strong><font size="-1">論壇搜索</font>
</strong>
</th>
</tr>
</thead>
</table>
</div>
<div id="searchForm" style="display: ">
<table width="100%" border="0" cellspacing="2" cellpadding="0"
class='forum_quote_content' style="BORDER: #91a9bd 2px solid;">
<thead>
<tr>
<th bgcolor="#a1a9bd" width="50">
<strong><font size="-1" id="fontText"><span
onclick="displaySearchForm()" style="cursor: pointer">-隱藏</span>
</font>
</strong>
</th>
</tr>
</thead>
<tr>
<td height="25">
板塊類別:
<select name="moduleId" id="module">
<option value="-1">
全部
</option>
<%
for (int i = 0; listModule != null && i < listModule.size(); i++) {
Forummodule fm = listModule.get(i);
%>
<option value="<%=fm.getId()%>"
<%=(moduleId != null && moduleId.intValue() == fm
.getId()) ? "selected" : ""%>><%=fm.getName()%></option>
<%
}
%>
</select>
</td>
</tr>
<tr>
<td height="25">
文章類別:
<select name="pieceId">
<option value="-1">
全部
</option>
<%
for (int i = 0; listPiece != null && i < listPiece.size(); i++) {
Forumpiece fp = listPiece.get(i);
%>
<option value="<%=fp.getId()%>"
<%=(pieceId != null && pieceId.intValue() == fp
.getId()) ? "selected" : ""%>><%=fp.getName()%></option>
<%
}
%>
</select>
</td>
</tr>
<tr>
<td height="25">
熱門程度:
<select name="hotReal">
<option value="-1">
全部
</option>
<option value="1"
<%=hotReal != null && hotReal == 1 ? "selected" : ""%>>
熱門
</option>
<option value="2"
<%=hotReal != null && hotReal == 2 ? "selected" : ""%>>
精華
</option>
</select>
</td>
</tr>
<tr>
<td height="25">
帖子ID:
<input type="text" name="topic">
(如選了這項,則返回對應的一條記錄)
</td>
</tr>
<tr>
<td height="30" align="left">
帖子名:
<input type="text" name="topicName">
精確
<input type="radio" name="precision" value="1" />
模糊
<input type="radio" name="precision" value="2" checked />
</td>
</tr>
<tr>
<td height="30" align="left">
作者名:
<input type="text" name="author">
(正確的作者名)
</td>
<td height="30" align="left">
</td>
</tr>
<tr>
<td height="30" align="left">
開始時間: 年份:
<select name="startYear">
<option value="2000">
請選擇
</option>
<script language="javascript">
document.write(getYear(2000));
</script>
</select>
月份:
<select name="startMonth">
<script language="javascript">
document.write(getMonth(1));
</script>
</select>
日期:
<select name="startDay">
<script language="javascript">
document.write(getDay(1));
</script>
</select>
(默認2000年1月1日開始)
</td>
</tr>
<tr>
<td height="30" align="left">
結束時間: 年份:
<select name="endYear">
<option value="2010">
請選擇
</option>
<script language="javascript">
document.write(getYear(2000));
</script>
</select>
月份:
<select name="endMonth">
<script language="javascript">
document.write(getMonth(1));
</script>
</select>
日期:
<select name="endDay">
<script language="javascript">
document.write(getDay(1));
</script>
</select>
(默認2010年1月1日結束)
</td>
</tr>
<tr>
<td align="center">
<input type="submit" value="搜索"
onclick="javascript:checkSearchForm();">
</td>
</tr>
</table>
</div>
</form>
<hr>
<div class="bodywidth">
<table width='100%' border='0' cellspacing='0' cellpadding='0'
class='topic_list_tb'>
<tr>
<td align="center" colspan="5">
<font color="red">[搜索結果]</font>
</td>
</tr>
<tr>
<td align="center" colspan="5">
<font color="red">條數(shù):<%=request.getAttribute("topicCount")%></font>
</td>
</tr>
<tr class='topic_list_mt'>
<td class='topic_list_mt_status'></td>
<td class='topic_list_mt_title'>
標題
</td>
<td class='topic_list_mt_author'>
作者
</td>
<td class='topic_list_mt_reply'>
回復/查看
</td>
</tr>
<tr class='topic_list_commontitle'>
<td colspan='5'>
版塊帖子列表
</td>
</tr>
<%
for (int i = 0; listTopic != null && i < listTopic.size(); i++) {
ForumTopic fa = (ForumTopic) listTopic.get(i);
%>
<tr class='topic_list_tr'
onmouseover="this.className='topic_list_over'"
onmouseout="this.className='topic_list_tr'">
<td class='topic_list_icon'>
<img src="/ElanNet/forum/view/skin/default/folder_new.gif"
alt="論壇帖子" border="0">
</td>
<td class='topic_list_title'>
<a
href='/ElanNet/forum/topic.do?action=showTopic&topicId=<%=fa.getId()%>'><%=fa.getTitle()%></a>
<td class='topic_list_author'>
<cite><a href='/User/ShowUser.asp?UserID=1'><%=fa.getAuthor()%></a>
</cite><em><%=fa.getCreateTime()%></em>
</td>
<td class='topic_list_reply_hits'>
<strong class='topic_list_reply'><%=fa.getReply()%></strong>/
<strong class='topic_list_hits'><%=fa.getClick()%></strong>
</td>
</tr>
<%
}
%>
</table>
<table width="100%" border="0" cellspacing="2" cellpadding="0">
<tr>
<td height="30" colspan="2" align="right">
</td>
</tr>
</table>
</div>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -