?? search.asp
字號:
<!--#include file=conn.asp-->
<head>
<title>新聞搜索</title>
<LINK href=Fsmanage/css/css.css rel=stylesheet>
<%
'=========================================================
'產品目錄:風訊產品N系列
'軟件名稱:風訊站點管理系統
'當前版本:2004.I.0225
'最新更新:2004.2.10
'=========================================================
'Copyright (C) 2002-2004 cooin.com. All rights reserved.
'網站: http://www.cooin.com Foosun.net
'程序制作:輕風云(QQ:655071)
'Email:skeen@cooin.com,skeen@Foosun.net
'論壇支持:風訊在線論壇(http://bbs.cooin.com http://bbs.foosun.net)
'=========================================================
keyword = request("keyword")
if keyword="" then
%>
<script luanage=javascript>
history.back()
alert("請輸入新聞關鍵字!")
</script>
<%
response.end
end if
%>
</head>
<body topmargin="7">
<table width="750" border="1" align="center" cellpadding="3" cellspacing="0" align=center>
<tr>
<td width="90%" height="20" align=center bgcolor=#cde4f0><div align="left" class="titlebig"><strong><font color="#FF0000">新聞搜索 </font></strong><font color="#000000"> 新聞關鍵字<font color="#FF0000">:<%=request("KeyWord")%></font></font></div></td>
</tr>
<%
const MaxPerPage=20
dim totalPut
dim CurrentPage
dim TotalPages
dim i,j
if not isempty(request("page")) then
currentPage=cint(request("page"))
else
currentPage=1
end if
%>
<%
set rs = server.createobject("adodb.recordset")
if request("condition")="title" then
sql = "select * from news where title like '%"&replace(request.form("keyword"),"'"," ")&"%' order by Date DESC"
end if
if request("condition")="content" then
sql = "select * from news where content like '%"&replace(request.form("keyword"),"'"," ")&"%' order by Date DESC"
end if
if request("condition")="author" then
sql = "select * from news where author like '%"&replace(request.form("keyword"),"'"," ")&"%' order by Date DESC"
end if
rs.open sql,conn,1,3
if rs.eof then
response.write("<tr><td width=90% height=""299"" align=center bgcolor=#ffffff><font color=red>沒有找到相關的新聞。請<a href=""javascript:history.back();"">返回</a>重新搜索</font></td></tr>")
else
totalPut=rs.recordcount
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
'showpages
showContent
showpages
else
if (currentPage-1)*MaxPerPage<totalPut then
rs.move (currentPage-1)*MaxPerPage
dim bookmark
bookmark=rs.bookmark
'showpages
showContent
showpages
else
currentPage=1
'showpages
showContent
showpages
end if
end if
rs.close
end if
set rs=nothing
conn.close
set conn=nothing
sub showContent
dim i
i=0
%>
<p style="word-spacing: 0; line-height: 150%; text-indent: 0; margin-left: 0; margin-right: 3; margin-top: 0; margin-bottom: 0">
共有<font color="#EF5952"><%=totalPut%></font>條記錄
<%
do while not rs.eof
response.write("<tr><td width=90% height=""20"" bgcolor=#ffffff><b>·</b><a href="&rs("LPath")&rs("FileName")&".html target=_blank>"&rs("title")&"</a><font color=red size=1>"&rs("Date")&"</font></td></tr>")
i=i+1
if i>=MaxPerPage then exit do
rs.movenext
loop
end sub
sub showpages()
dim n
if (totalPut mod MaxPerPage)=0 then
n= totalPut \ MaxPerPage
else
n= totalPut \ MaxPerPage + 1
end if
if n=1 then
response.write "<p align='left'style='word-spacing: 0; line-height: 150%; text-indent: 0; margin: 0'>"
exit sub
end if
dim k
response.write "<p align='left'style='word-spacing: 0; line-height: 150%; text-indent: 0; margin: 0'> 分頁"
for k=1 to n
if k=currentPage then
response.write "[<b>"+Cstr(k)+"</b>] "
else
response.write "[<b>"+"<a href='search.asp?page="+cstr(k)+"&condition="+request("condition")+"&keyword="+request("keyword")+"' style='color:#aa4466'>"+Cstr(k)+"</a></b>] "
end if
next
response.write ""
end sub %>
<tr><td><%showpages%></td></tr>
</table>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -