%
Server.ScriptTimeOut=90
ON ERROR RESUME NEXT
dime Tanme,dhname,keyword
'---------
fwfh=fwwzjc("/inc/fwpbip1.txt","")
if fwfh="ER_0" then
response.end
end if
'----------
keyword=replacestr(request("keyword"))
if keyword="" then
page=1
response.Redirect("/yanyu/")
response.end
end if
QueryWords= Split( keyword )
stype=request("stype")
fs=request("fs")
if Request("stype")="" then
stype="1"
else
stype=Trim(Request("stype"))
end if
if Request("fs")="" then
fs="1"
else
fs=Trim(Request("fs"))
end if
function replacestr(str)
str=replace(replace(replace(replace(lcase(trim(str)),"'",""),">",""),"<",""),"chr","")
replacestr=replace(replace(replace(str,"%",""),"char",""),"=","")
end function
Function ReplaceTest(str,patrn, replStr)
Dim regEx, str1 ' 建立变量。
str1 = str
Set regEx = New RegExp ' 建立正则表达式。
regEx.Pattern = patrn ' 设置模式。
regEx.IgnoreCase = True ' 设置是否区分大小写。
ReplaceTest = regEx.Replace(str1, replStr) ' 作替换。
End Function
function replnr(str)
dim ih
ih=0
For ih = LBound( QueryWords ) to UBound( QueryWords )
str=replaceTest(str,""&QueryWords(ih)&"",""&QueryWords(ih)&"")
Next
replnr=str
end function
dim CurrentPage,MaxPerPage,totalPut,totalnumber,Pcount,tempPcount,j
Tname=""
dhname=""
if keyword<>"" then
Tname=keyword&"_"
dhname=" > 查询“"&keyword&"”"
end if
%>
<%=Tname%>名人名言大全
<% if not isempty(request("page")) then
CurrentPage=cint(request("page"))
else
CurrentPage=1
end if
MaxPerPage =30
if not isnumeric(request("page")) and request("page")<>"" then
page=1
end if
sql=""
if keyword="" then
sql = " isLock=0"
else
dim tempJoinWord
tempJoinWord=""
Select case stype
case 1
if fs=1 then
For i = 0 To UBound( QueryWords )
sql = SQL & tempJoinWord & "(" & _
"username like '%"&QueryWords(i)&"%' or "&_
"content like '%"&QueryWords(i)&"%')"
tempJoinWord = " and "
Next
else
For i = 0 To UBound( QueryWords )
sql = SQL & tempJoinWord & "(" & _
"username='"&QueryWords(i)&"' or "&_
"content='"&QueryWords(i)&"')"
tempJoinWord = " and "
Next
end if
case 2
if fs=1 then
For i = 0 To UBound( QueryWords )
sql = SQL & tempJoinWord & "(" & _
"content like '%"&QueryWords(i)&"%')"
tempJoinWord = " and "
Next
else
For i = 0 To UBound( QueryWords )
sql = SQL & tempJoinWord & "(" & _
"content='"&QueryWords(i)&"')"
tempJoinWord = " and "
Next
end if
case 3
if fs=1 then
For i = 0 To UBound( QueryWords )
sql = SQL & tempJoinWord & "(" & _
"username like '%"&QueryWords(i)&"%')"
tempJoinWord = " and "
Next
else
For i = 0 To UBound( QueryWords )
sql = SQL & tempJoinWord & "(" & _
"username='"&QueryWords(i)&"')"
tempJoinWord = " and "
Next
end if
case 4
if fs=1 then
For i = 0 To UBound( QueryWords )
sql = SQL & tempJoinWord & "(" & _
"sortname like '%"&QueryWords(i)&"%')"
tempJoinWord = " and "
Next
else
For i = 0 To UBound( QueryWords )
sql = SQL & tempJoinWord & "(" & _
"sortname='"&QueryWords(i)&"')"
tempJoinWord = " and "
Next
end if
End Select
end if
dim sqlzs,fzd
fzd=" softid,username,content,sortname "
sqlzs = "SELECT softid FROM [NC_softinfo] WHERE " & sql
%>
<%
set rs = server.CreateObject ("adodb.recordset")
rs.open sqlzs ,conn,1,1
if rs.bof and rs.eof then
else
totalPut=rs.recordcount
totalnumber=rs.recordcount
end if
rs.close
if CurrentPage=1 then
sql="SELECT top "&MaxPerPage& fzd &" FROM [NC_softinfo] WHERE "&sql & " order by softid " '总页码为1取当前页
else
sqlzs="(select top "&((CurrentPage-1)*MaxPerPage)&" softid FROM [NC_softinfo] WHERE "&sql '使用组合查询方式
sql="SELECT top "&MaxPerPage& fzd &" FROM [NC_softinfo] WHERE softid>(select max(softid) from "&sqlzs&" order by softid ) AS T ) and "&sql&" order by softid "
end if
dim ares
rs.open sql ,conn,1,1
ares = rs.GetRows
rs.close
conn.close
set conn=nothing
dim ls_jlzs
ls_jlzs=UBound(ares, 2)
if (ls_jlzs<0 or ls_jlzs="") then
response.write "
"
else
if (totalPut mod MaxPerPage)=0 then
Pcount= totalPut \ MaxPerPage
else
Pcount= totalPut \ MaxPerPage + 1
end if
if currentpage > Pcount then currentpage = Pcount
if currentpage<1 then currentpage=1
j=(currentpage-1)*MaxPerPage+1
response.write "
"
sub showpage()
dim filename,ii,n
filename="/mrmy/mrmyso.asp"
if totalnumber mod maxperpage=0 then
n= totalnumber \ maxperpage
else
n= totalnumber \ maxperpage+1
end if
response.write ""
end sub
%>