%
MyConStr = "Provider=SQLOLEDB.1;Persist Security Info=False;Server=WEB3;User ID=sqldatalog;Password=sqldatalog@XJB0823;Database=CMS_Data;"
%>
<%
ON ERROR RESUME NEXT
Response.Buffer = true
act = Trim(request("act"))
dim startime
startime=timer()
'将搜索内容显示为红色
Function showSearch(allStr,partStr)
allStr = replace(allStr, ""&partStr&"", ""&partStr&"")
showSearch = allStr
End Function
'显示部分内容
Function showContent(str,num)
if len(trim(str))>num then
response.write left(trim(str),num)&"..."
else
response.write trim(str)
end if
end function
'过滤HTML CODE
Function FilterSign(str)
Dim strTemp
strTemp = str
While Instr(1,strTemp,"<")
strL = Left(strTemp, Instr(1, strTemp, "<")-1)
strR = Right(strTemp, Len(strTemp)-Instr(1,strTemp,">"))
strTemp = strL & strR
Wend
strTemp = replace(strTemp, " ", "")
strTemp = Replace(strTemp, " ","")
FilterSign = strTemp
End Function
%>
新京报 - 站内搜索
<%
If act = "sea" Then
call SeaList()
End If
'分页程序
Sub SeaList()
DIM MyRst,Sql,Key_Word
Key_Word = Trim(Request("Key_Word"))
search_kind = Trim(request("search_kind"))
select case search_kind
case "1"
search_kind = 1
case "2"
search_kind = 2
case "3"
search_kind = 3
case else
search_kind = 3
End Select
%>
<%
dim i,intPage,page,pre,last,filepath
set rs = server.CreateObject("adodb.recordset")
'判断用户 系统/部门/级别 显示所需内容
rs.PageSize = 10 '(Yoko:这里设定每页显示的记录数
rs.CursorType=1
rs.CursorLocation = 3
'**通过Connection对象调用存储过程**
Sql = "exec search_content '"&key_word&"',"&search_kind&""
'rs.open Sql,MyConStr,1,3
rs.Open sql,MyConStr,0,2,1
session("rscount") = rs.recordcount
'rs.Open sql,conn,0,2,1 '(Yoko:'这里执行你查询SQL并获得结果记录集
pre = true
last = true
page = trim(Request.QueryString("page"))
if len(page) = 0 then
intpage = 1
pre = false
else
if cint(page) =< 1 then
intpage = 1
pre = false
else
if cint(page) >= rs.PageCount then
intpage = rs.PageCount
last = false
else
intpage = cint(page)
end if
end if
end if
if not rs.eof then
rs.AbsolutePage = intpage
end if
%>
<%
for i=1 to rs.PageSize
if rs.EOF or rs.BOF then exit for
%>