📄 find.asp
字号:
<!--#include file="conn.asp"-->
<!--#include file="set.asp"-->
<%
findstr=trim(request.form("string"))
bid=request.form("bid")
if findstr="" or isempty(findstr) or findstr="查找的标题" then
response.write "请输入查找的内容!"
end if
if bid="" then
bid=0
end if
if bid=0 then
sqlstr="select * from book where title like '%" &findstr& "%' and type=0 order by ldate desc"
else
sqlstr="select * from book where title like '%" &findstr& "%' and bid=" &bid& " and type=0 order by ldate desc"
end if
set reco=server.createobject("adodb.recordset")
reco.open sqlstr,conn,1,1
%>
<html>
<head>
<title>my bbs</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body bgcolor="#FFFFFF" background="images/bg.gif">
<table width="614" border="0" cellspacing="2" cellpadding="2" class=buinput>
<tr>
<td height="15" colspan="2" width="375">版面:<%=session("bname")%></td>
<td height="15" width="235">版主:<%=session("dbuser")%></td>
<td height="15" width="100"></td>
</tr>
<tr>
<td height="15" colspan="4" class=trtop>查找 <font color="red"><%=findstr%></font> 内容,查找到 <font color="red"><%=reco.recordcount%></font> 条记录。</td>
</tr>
</table>
<table width="614" border="0" cellspacing="2" cellpadding="2">
<tr>
<td>
<%if bid<>0 then%>
[ <a href='post.asp?bid=<%=bid%>' title='发表新帖子'>发表</a> ]
<%end if%>
[ <a href="topic.asp?bid=<%=bid%>" title="新新帖子">新新帖子</a> ]
[ <a href="topic.asp?bid=<%=bid%>&method=hot" title="回复数最多的帖子">热门话题</a> ]
[ <a href="topic.asp?bid=<%=bid%>&method=hits" title="点击数最多的帖子">人气帖子</a> ]
</td>
</tr>
</table>
<table width="614" border="0" cellspacing="2" cellpadding="2" class=buinput>
<%
if reco.eof then
%>
<tr>
<td height="15" align='center'>暂 未 查 找 到 相 关 帖 子 !</td>
</tr>
<%
else
%>
<tr class=buinput>
<td height="15" width="30"></td>
<td height="15" width="301">
<div align="center">文 章 标 题</div>
</td>
<td height="15" width="100">
<div align="center">发言人</div>
</td>
<td height="15" width="33">
<div align="center">回复</div>
</td>
<td height="15" width="74">
<div align="center">发表日期</div>
</td>
<td height="15" width="74">
<div align="center">更新日期</div>
</td>
</tr>
<%
do while not reco.eof
id=reco("id")
title=trim(reco("title"))
username=trim(reco("username"))
usermail=trim(reco("usermail"))
reply=reco("reply")
wdate=month(reco("wdate")) & "/" & day(reco("wdate"))
ldate=month(reco("ldate")) & "/" & day(reco("ldate"))
faceimg="<img src='images/"&trim(reco("faceimg"))&".gif'>"
if usermail<>"" then
userlink="<a href='mailto:" &usermail & "' title='给 " &username& " 发封妹儿'>" &username& "</a>"
else
userlink=username
end if
%>
<tr class=tr>
<td height="15" width="30" align='center'><%=faceimg%></td>
<td height="15" width="301"><a href='show.asp?id=<%=id%>'><%=title%></a></td>
<td height="15" width="100" align='center' valign='min'><%=userlink%></td>
<td height="15" width="33" align='center' valign='min'><%=reply%>篇</td>
<td height="15" width="74" align='center' valign='min'><%=wdate%></td>
<td height="15" width="74" align='center' valign='min'><%=ldate%></td>
</tr>
<%
reco.movenext
loop
end if
%>
</table>
<br>
<table width="614" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align='center' height='15'>
<form method="post" action="find.asp" name="find"><input type='text' class=buinput maxlength="30" size="20" name='string' value='查找的标题'>
<input type='hidden' name='bid' value=<%=bid%>>
<input type="submit" value=" 查找 " name='find' class=buinput>
</form>
</td>
</tr>
</table>
<table width="614" border="0" cellspacing="2" cellpadding="2" class=buinput>
<tr>
<td height="15" colspan="2" width="375">版面:<%=session("bname")%></td>
<td height="15" width="235">版主:<%=session("dbuser")%></td>
<td height="15" width="100"></td>
</tr>
<tr>
<td height="15" colspan="4" align='center' class=trtop>《闪客论坛》版权所有:<a href='mailto:roam@yeah.net'>漫步人</a></td>
</tr>
</table>
</body>
</html>
<%
set reco=nothing
set conn=nothing
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -