📄 search.jsp
字号:
<%
/*##################################################################**
**# LyBBS ver 1.2.b2 (1.2.beta-2版) / 凌云论坛 ver 1.2.b2 #**
**# #**
**# 版权所有: 凌云工作室 (原流星电脑工作室) #**
**# #**
**# 制作人 : 星语凌 『teddy (Yongshan Ye)』 #**
**# #**
**# 主页地址: http://www.unix-now.com/lybbs 凌云论坛主页 #**
**# http://www.ierp.info/lybbs 凌云论坛镜像站 #**
**# http://horseye@sina.com/ 凌云论坛支持信箱 #**
**# #**
**##################################################################*/
%>
<%@ include file="include/config.jsp"%>
<%@ page contentType="text/html;charset=gb2312" %>
<%@ include file="include/connect.jsp"%>
<%
int db=0;
String tempSTR="",submit="",action="";
//用户cookie变量声明
int id=0,styleid=0,membergone=0;
String cookieid="",cookiename="",usermode="",cookiemode="";
//日期定义
int now_year=0,now_month=0,now_day=0,now_hour=0,now_minute=0,now_second=0;
String now_date="",now_time="";
//定义boardprepare.jsp中的变量
String onlineview="",dispview="",boardtitle="",boardname="",title="",version="",copyright="",support="",programmer="",programemail="",homename="",homeurl="",togb="1",status="",maintainreason="",announcement="1",boardurl="",showfastlogin="",dispborn="",styleQuery="";
//定义本页变量
int number=0;
String friendname="",friendemail="",friendicq="",friendqq="",friendhomepage="",friendonline="",errorinfo="",searchopen="";
ResultSet rs2;
boolean updateok=false;
%>
<%@ include file="include/boardprepare.jsp"%>
<%@ include file="include/style.jsp"%>
<%
tempSTR=request.getParameter("action");
if(tempSTR!=null && !tempSTR.equals(""))
action=tempSTR;
tempSTR=request.getParameter("submit");
if(tempSTR!=null && !tempSTR.equals(""))
submit=togb.equals("1")?connect.toGB(tempSTR):tempSTR;
%>
<!--//html from here-->
<%@ include file="include/head.jsp"%>
<script language="JavaScript">
function changePages(){
var URL = document.changepages.pages.options[document.changepages.pages.selectedIndex].value;
location.href = URL; target = '_self';
}
</script>
<body <%=lbbody%>>
<%@ include file="include/userheader.jsp"%>
<br>
<table cellpadding=0 cellspacing=0 border=0 width=<%=tablewidth%> align=center>
<tr>
<td width=30% rowspan=2 valign=top>
<%@ include file="include/viceadbanner.jsp"%>
</td>
<td valign=top align=left>
<font face="宋体" color=<%=fontcolormisc%>>
<img src="images/closedfold.gif" border=0> <a href="index.jsp"><%=boardname%></a><br>
<img src="images/bar.gif" border=0><img src="images/openfold.gif" border=0> 帖子搜索
</font>
</td>
</tr>
</table>
<br>
<%
if(action.equals("")) {
%>
<table width=<%=tablewidth%> align=center cellspacing=0 cellpadding=1 border=0 bgcolor=<%=tablebordercolor%>>
<tr>
<td>
<table cellpadding=8 cellspacing=1 border=0 width=100%>
<form action="search.jsp" method="post">
<input type=hidden name="action" value="startsearch">
<tr>
<td bgcolor="<%=miscbacktwo%>" valign=middle colspan=2 align="center">
<font face="宋体" color=<%=fontcolormisc%>><b>请输入要搜索的关键字</b></font>
</td>
</tr>
<tr>
<td bgcolor=<%=miscbackone%> width colspan=2 align="center" valign="middle">
<font face="宋体" color=<%=fontcolormisc%>>
<b>请输入要搜索的关键字</b>
(多个关键字之间使用百分号"%"分隔)
</font><br><br>
<input type=text size=40 name="SEARCH_STRING">
</td>
</tr>
<tr>
<td bgcolor="<%=miscbacktwo%>" valign=middle colspan=2 align=center>
<font face="宋体" color=<%=fontcolormisc%>><b>搜索选项</b></font>
</td>
</tr>
<tr>
<td bgcolor="<%=miscbackone%>" align="right" valign="middle">
<font face="宋体" color=<%=fontcolormisc%>>
<b>作者搜索</b></font>
<input name="TYPE_OF_SEARCH" type="radio" value="username_search">
</font>
</td>
<td bgcolor="<%=miscbackone%>" align="left" valign="middle">
<select name="NAME_SEARCH">
<option value="topictitle_search">搜索主题作者
<option value="post_search">搜索回复作者
<option value="both_search">两者都搜索
</select>
</td>
</tr>
<tr>
<td bgcolor="<%=miscbackone%>" align="right" valign="middle">
<font face="宋体" color=<%=fontcolormisc%>>
<b>关键字搜索</b>
</font>
<input name="TYPE_OF_SEARCH" type="radio" value="keyword_search" checked>
</td>
<td bgcolor="<%=miscbackone%>" align="left" valign="middle">
<select name="POST_SEARCH">
<option value="topictitle_search">在主题中搜索关键字
<option value="post_search">在贴子内容中搜索关键字
<option value="both_search">两者都搜索
</select>
</td>
</tr>
<tr>
<td bgcolor="<%=miscbacktwo%>" valign="middle" colspan=2 align=center>
<font face="宋体" color=<%=fontcolormisc%>><b>请选择要搜索的论坛 (不要选那些用 >> 和 << 括起来的,那只是类别名,不是论坛)</b></font>
</td>
</tr>
<tr>
<td bgcolor="<%=miscbackone%>" colspan="2" valign="middle" align="center">
<font face="宋体" color=<%=fontcolormisc%>>
<b>搜索论坛:</b>
<select name="FORUMS_TO_SEARCH">
<option value="0">所有论坛</option>
<%
rs=connect.executeQuery("select id,forumname from forum order by id");
while(rs.next()) {
out.println("<option value='' style=background-color:"+titlecolor+">>> "+rs.getString(2)+" <<</option>");
rs2=connect.executeQuery2("select id,dbname from db where forum="+rs.getInt(1)+" order by id");
while(rs2.next()) {
if(db!=rs2.getInt(1))
out.println("<option value="+rs2.getInt(1)+"> "+rs2.getString(2)+" </option>");
else
out.println("<option value="+rs2.getInt(1)+" selected> "+rs2.getString(2)+" </option>");
}
}
%>
</select>
</font>
</td>
</tr>
<tr>
<td bgcolor="<%=miscbacktwo%>" valign=middle colspan=2 align=center><BR>
<input type=submit value="开始搜索">
</td>
</tr>
</form>
</table>
</td>
</tr>
</table>
<%
}
else if(action.equals("startsearch")) {
int topic=0;
String dbname="",postat="",searchtitle="";
String SEARCH_STRING="",TYPE_OF_SEARCH="",NAME_SEARCH="",POST_SEARCH="",FORUMS_TO_SEARCH="",query="",querycount="",searchitem="";
tempSTR=request.getParameter("SEARCH_STRING");
if(tempSTR!=null && !tempSTR.equals("")) {
SEARCH_STRING=togb.equals("1")?connect.toGB(tempSTR):tempSTR;
SEARCH_STRING=connect.Replace(SEARCH_STRING,"\'","\\\'");
SEARCH_STRING=connect.Replace(SEARCH_STRING,"\"","\\\"");
}
tempSTR=request.getParameter("TYPE_OF_SEARCH");
if(tempSTR!=null && !tempSTR.equals(""))
TYPE_OF_SEARCH=tempSTR;
tempSTR=request.getParameter("NAME_SEARCH");
if(tempSTR!=null && !tempSTR.equals(""))
NAME_SEARCH=tempSTR;
tempSTR=request.getParameter("POST_SEARCH");
if(tempSTR!=null && !tempSTR.equals(""))
POST_SEARCH=tempSTR;
tempSTR=request.getParameter("FORUMS_TO_SEARCH");
if(tempSTR!=null && !tempSTR.equals(""))
FORUMS_TO_SEARCH=tempSTR;
if(FORUMS_TO_SEARCH.equals("all"))
FORUMS_TO_SEARCH="0";
rs=connect.executeQuery("select searchopen from style where adminselected='1'");
if(rs.next())
searchopen=rs.getString(1);
if(SEARCH_STRING.equals("") || FORUMS_TO_SEARCH.equals(""))
errorinfo="搜索无法完成!请保证:1.关键字不能空;2.论坛名选择正确!";
else if(cookiemode.equals("1") && searchopen.equals("1"))
errorinfo="搜索无法完成!只有注册用户可以搜索!";
if(!errorinfo.equals("")) {
%>
<table cellpadding=0 cellspacing=0 border=0 width=<%=tablewidth%> bgcolor=<%=tablebordercolor%> align=center>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -