actsearch.asp

来自「聊天室源码呵呵你好用~~~~~~2.0版本」· ASP 代码 · 共 113 行

ASP
113
字号
<%@ LANGUAGE=VBScript%>
<%Server.ScriptTimeout=300
Response.Expires=0
keyword=Request.Form("keyword")
range=Request.Form("range")
if range="" then range=2
Select Case range
 Case 2
  r="2"
 Case 0
  r="0"
 Case 1
  r="1"
 Case else
  r="2"
End Select
keyword=Trim(keyword)
if keyword="" then Response.Redirect "act.asp"
dim act(),show()
actfile = server.mappath("actdata.asp")
Set fs = CreateObject("Scripting.FileSystemObject")
set thisfile = fs.OpenTextFile(actfile,1,False)
countact = 0
do while not thisfile.AtEndOfStream
thisline = thisfile.readline
Redim preserve act(countact)
act(countact) = thisline
countact = countact + 1
loop
thisfile.Close
countactnum=(countact-3)/3
s=0
for i=3 to countact-1 step 3
if (act(i)=range or range=2) and (instr(LCase(act(i+1)),LCase(keyword))<>0 or instr(LCase(act(i+2)),LCase(keyword))<>0) then
 Redim preserve show(s+1),show(s+2),show(s+3)
 show(s+1)=act(i)
 show(s+2)=act(i+1)
 show(s+3)=act(i+2)
 s=s+3
end if
next%><html>
<head>
<title>搜索结果</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta http-equiv="refresh" content="100;URL=f3.asp">
<script language="JavaScript">
<!--
function ac(list){
parent.f2.document.forms[0].saystemp.value=list;
parent.f2.document.forms[0].saystemp.focus();
}
//-->
</script>
<style TYPE="text/css">
<!--
td  {line-height:110%; font-size:9pt;}
body  {line-height:110%; font-size:9pt;}
A  {color : Blue;text-decoration : none;}
A:Visited  {color : Blue;}
A:Active  {color : Fuchsia;}
A:Hover  {color : Blue;}
-->
</style>
</head>
<body bgcolor="008888" background="read/bg.gif" bgproperties="fixed" text="#FFFFFF">
<form method="post" action="actsearch.asp" name="">
<table border="1" align="center" cellpadding="4" bordercolor="#CCCCCC" width="120">
<tr> 
<td align="center" colspan="2" width="119"><a href="#1">移到页脚</a></td>
</tr>
<tr> 
<td align="center" colspan="2" width="119"><font color="#FFFF00"><%=countactnum%></font>条搜到<font color="#FFFF00"><%=s/3%></font>条</td>
</tr>
<tr> 
<td align="center" width="18"><font color="#FFFFFF">名<br>
称</font></td>
<td align="center" width="101"><font color="#FFFFFF">动作内容</font></td>
</tr>
<%for i=1 to s step 3
if show(i)=0 then%> 
<tr> 
<td align="center" bgcolor="#CCCCFF" width="18"><a href=javascript:ac("<%=Replace(show(i+2)," ","%20")%>")><%=show(i+1)%></a></td>
<td width="101"><%=show(i+2)%></td>
</tr>
<%end if
next%> <%for i=1 to s step 3
if show(i)=1 then%> 
<tr> 
<td align="center" bgcolor="#FFCCCC" width="18"><a href=javascript:ac("<%=Replace(show(i+2)," ","%20")%>")><%=show(i+1)%></a></td>
<td width="101"><%=show(i+2)%></td>
</tr>
<%end if
next%> 
</table>
<table border="1" cellpadding="4" bgcolor="#FFCC00" bordercolorlight="#000000" bordercolordark="#FFFFFF" cellspacing="0" align="center" width="120">
<tr> 
<td> 
<div align=center><a href="#" onClick="window.open('actaddform.asp','actadd','scrollbars=yes,resizable=yes,width=500,height=400')">添加新动作</a></div>
<input type="text" name="keyword" size="8" style="font-size:9pt" value="<%=keyword%>">
<input type="submit" value="搜" name="search" style="font-size:9pt">
<br>
<select style="font-size:9pt" name="range">
<option value="2" <%if r=2 then response.write "selected"%>>2 全库</option>
<option value="0" <%if r=0 then response.write "selected"%>>0 对自己</option>
<option value="1" <%if r=1 then response.write "selected"%>>1 对别人</option>
</select>
</td>
</tr>
</table>
<a name="1"></a>
</form>
</body>
</html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?