?? search.asp
字號(hào):
<!--#include file="ku_top.asp" -->
<%
sub navigation()
response.write " >> "
response.write "站內(nèi)搜索結(jié)果"
end sub
%>
<div align="center">
<table border="0" cellpadding="0" cellspacing="0" width="800" height="50" bgcolor="#FFFFFF">
<tr>
<td width="218" valign="top">
<div align="center">
<table border="0" width="208" id="table2" bgcolor="#ebebeb" cellpadding="0" cellspacing="0">
<tr>
<td height="30" background="xbqq_img/gonggao.gif">
<p align="center"><b>站 內(nèi) 公 告</b></td>
</tr>
<tr>
<td><% xbqq_Marquee %></td>
</tr>
<tr>
<td height="0"><hr></td>
</tr>
<tr>
<td height="30" background="xbqq_img/gonggao.gif">
<p align="center"><b>信 息 搜 索</b></td>
</tr>
<tr>
<td height="23"><% xbqq_Search %></td>
</tr>
<tr>
<td height="0"><hr></td>
</tr>
<tr>
<td height="30" background="xbqq_img/gonggao.gif">
<p align="center"><b>站 內(nèi) 投 票</b></td>
</tr>
<tr>
<td><% xbqq_vote %></td>
</tr>
<tr>
<td height="0"><br></td>
</tr>
</table>
</div>
</td>
<td width="560" valign="top">
<div align="center">
<table border="0" cellpadding="0" cellspacing="0" width="580" height="28" id="table1" background="xbqq_img/kind1.gif">
<tr>
<td> <img border="0" src="xbqq_img/ico1.gif" width="11" height="9">
<font color="#FFFFFF">搜索結(jié)果</font></td>
</tr>
</table>
</div>
<div align="center">
<table border="0" cellpadding="0" cellspacing="0" width="580" height="5">
<tr>
<td></td>
</tr>
</table>
</div>
<div align="center">
<table border="0" cellpadding="0" cellspacing="0" width="580" height="160" style="border: 1px solid #CECFCE">
<tr>
<td bgcolor="#FFFFFF" width="100%">
<!--新聞文章開(kāi)始-->
<br>
<TABLE width=580 border=0 align="center" cellPadding=0 cellSpacing=0>
<TBODY>
<TR>
<TD width="100%"> <TABLE cellSpacing=0 cellPadding=0 width=580 align=center border=0>
<TBODY>
<TR bgColor=#ffffff>
<TD height=2></TD>
</TR>
</TBODY>
</TABLE>
<TABLE cellSpacing=0 cellPadding=0 width=580 border=0>
<TBODY>
<TR>
<TD vAlign=top align=left width=580 style="BORDER-RIGHT: #d8d8d8 1px solid">
<%
const MaxPerPage=20
dim totalPut
dim CurrentPage
dim TotalPages
dim i,j
dim idlist
dim Title
Title=Trim(Request.Form("txtitle"))
If Session("search")="" and Title="" Then : Session("search")=Title
If Request("page")<>"" Then
else
Session("search")=Title
End If
if not isempty(request("page")) then
currentPage=Trim(request("page"))
else
currentPage=1
end if
if not isempty(request("selAnnounce")) then
idlist=request("selAnnounce")
if instr(idlist,",")>0 then
dim idarr
idArr=split(idlist)
dim id
for i = 0 to ubound(idarr)
id=clng(idarr(i))
call deleteannounce(id)
next
else
call deleteannounce(clng(idlist))
end if
end if
dim sql
dim rs
%>
<table border="0" width="100%" cellspacing="0" cellpadding="0" align="center">
<tr>
<td width="100%" align="center">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<form method=Post action="search.asp"><tr>
<td>
<%
If session("search")<>"" Then : title=session("search")
if title<>"" then
sql="select * from Info where title like '%"&trim(title)&"%' or content like '%"&trim(title)&"%' order by ID desc"
end if
if title="" then
sql="select * from Info order by ID desc"
end if
Set rs= Server.CreateObject("ADODB.Recordset")
rs.open sql,conn,1,1
if rs.eof and rs.bof then
response.write "<br><br><p align='center'>沒(méi)有找到任何信息...</p>"
else
totalPut=rs.recordcount
if currentpage<1 then
currentpage=1
end if
if (currentpage-1)*MaxPerPage>totalput then
if (totalPut mod MaxPerPage)=0 then
currentpage= totalPut \ MaxPerPage
else
currentpage= totalPut \ MaxPerPage + 1
end if
end if
if currentPage=1 then
showpage totalput,MaxPerPage,"Search.asp"
showContent
showpage totalput,MaxPerPage,"Search.asp"
else
if (currentPage-1)*MaxPerPage<totalPut then
rs.move (currentPage-1)*MaxPerPage
dim bookmark
bookmark=rs.bookmark
showpage totalput,MaxPerPage,"Search.asp"
showContent
showpage totalput,MaxPerPage,"Search.asp"
else
currentPage=1
showpage totalput,MaxPerPage,"Search.asp"
showContent
showpage totalput,MaxPerPage,"Search.asp"
end if
end if
rs.close
end if
set rs=nothing
conn.close
set conn=nothing
sub showContent
dim i
i=0
%>
<br><br>
<table width="94%" border="0" align="center" cellpadding="0" cellspacing="1" bordercolorlight="#cccccc" bordercolordark="#FFFFFF" bgcolor="#CCCCCC">
<tr bgcolor="#D8D8D8">
<td width="486" height="22" align="center">信 息 標(biāo) 題</td>
<td width="80" align="center" bgcolor="#D8IDD8D8">發(fā) 布 時(shí) 間</td>
</tr>
<%do while not rs.eof%>
<tr bgcolor="#FFFFFF">
<td height="22" bgcolor="#FFFFFF">
<p align="left"> <a href="ViewInfo.asp?id=<%=rs(0)%>"><%=rs("title")%></a></td>
<td> <p align="center"><%=rs("AddDate")%></td>
</tr>
<%
i=i+1
if i>=MaxPerPage then exit do
rs.movenext
loop
%>
<tr bgcolor="#D8D8D8">
<td height="22" colspan="2">
<div align="right"> </div></td>
</tr>
</table>
<%
end sub
function showpage(totalnumber,maxperpage,filename)
dim n
if totalnumber mod maxperpage=0 then
n= totalnumber \ maxperpage
else
n= totalnumber \ maxperpage+1
end if
response.write "<p align='center'> "
if CurrentPage<2 then
response.write "首頁(yè) 上一頁(yè) "
else
response.write "<a href="&filename&"?page=1>首頁(yè)</a> "
response.write "<a href="&filename&"?page="&CurrentPage-1&">上一頁(yè)</a> "
end if
if n-currentpage<1 then
response.write "下一頁(yè) 尾頁(yè)"
else
response.write "<a href="&filename&"?page="&(CurrentPage+1)&">"
response.write "下一頁(yè)</a> <a href="&filename&"?page="&n&">尾頁(yè)</a>"
end if
response.write " 頁(yè)次:<strong>"&CurrentPage&"/"&n&"</strong>頁(yè)"
response.write " 共<b>"&totalnumber&"</b>篇文章 <b>"&maxperpage&"</b>篇文章/頁(yè)"
end function
%>
</td>
</tr></form>
</table> </td>
</tr>
</table>
</TD>
</TR></TBODY></TABLE></TD></TR></TBODY></TABLE>
<br>
<!-- 新聞文章結(jié)束-->
</td>
</tr>
</table>
</div>
</td>
</tr>
</table>
</div>
<!--#include file="xbqq_foot.asp" -->
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -