⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 search_ypdt.asp

📁 一个诚信信息港门户网 功能: 系统设置  企业会员  个人会员  商贸机会  产品管理  企业新闻  行业新闻  招聘信息  展会管理  模版管理
💻 ASP
字号:
<!--#include file="main.asp"-->
<%word=request("word")
key=request("key")
if word="" or key="" then
response.redirect"search.asp"
end if%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title><%=citytitle%></title>
</head>

<body topmargin="0">
<%SMT_TOP%>
<%search%>
<table width="760" border="0" cellspacing="0" cellpadding="0" align="center">
<tr><td height=10 colspan=5></td></tr>
<tr><td valign="top" height=400>
<!--==================-->
<table width="96%" border="0" cellspacing="1" cellpadding="0" align="center">
<%sql= "select * from SMT_xxnews where SMT_key=1 and SMT_key1=1 and SMT_key2=1 and(SMT_title like'%"&word&"%' or SMT_news like'%"&word&"%') order by SMT_id desc"
set rs=server.createobject("adodb.recordset")                     
rs.open sql,conn,1,1                     
if rs.eof and rs.bof then                     
	response.write "<tr><td height=50>没有找到能和“<font color=red>"&word&"</font>”匹配的内容,请尝试其它搜索。</td></tr>"
else  
'分页的实现 
listnum=20
Rs.pagesize=listnum
page=Request("page")
if (page-Rs.pagecount) > 0 then
page=Rs.pagecount
elseif page = "" or page < 1 then
page = 1
end if
Rs.absolutepage=page
'编号的实现
j=rs.recordcount
j=j-(page-1)*listnum
i=0%>
<tr><td background="img/search_line.gif" colspan=2></td></tr>
<%do while not rs.eof and i<listnum
'====================
SMT_title=replace(rs("SMT_title"),word,"<font color=red>"&word&"</font>")
aaa=trim(rs("SMT_news"))
if instr(aaa,word) then
a=len(aaa)
b=instr(aaa,word)
if b<50 then c=left(aaa,b) else c="..."&mid(aaa,b-50,50)
if a-(b+len(word))<50 then d=right(aaa,a-(b+len(word))) else d=mid(aaa,b,50)&"..."
SMT_news=c&d
else
SMT_news=Trim(left(aaa,100))&"..."
end if
SMT_news=replace(SMT_news,word,"<font color=red>"&word&"</font>")
'====================
if cityHTML=1 then
webget="Html/xxnews/"&year(rs("SMT_date"))&month(rs("SMT_date"))&"/"&replace(replace(replace(rs("SMT_date"),"-",""),":","")," ","")&".html"
else
webget="new_view.asp?id="&rs("SMT_id")&""
end if

%>
<tr align=center>
 <td width="4%"><strong><font color=#ff6600>>></font></strong></td>
 <td width="96%" align=left height=30><a href=<%=webget%> target="_blank" class="f14"><strong><%=SMT_title%></strong></a> <font color=#999999>(<%=rs("SMT_date")%>)</font></td>
</tr>
<tr><td></td>
<td height=30><p style="line-height:180%">&nbsp;  <%=SMT_news%>...</td></tr>
<tr><td background="img/search_line.gif" colspan=2></td></tr>
<%rs.movenext 
i=i+1 
j=j-1
loop%>
<tr>
<%filename="search_"&key&".asp?word="&word&"&key="&key%>
<td colspan=2 align=right height=20 bgcolor=#95CDFF><strong><%=page%>/<%=Rs.pagecount%>  
<% if page=1 then %><%else%>
<a href=<%=filename%>>|<<</a> 
<a href=<%=filename%>&page=<%=page-1%>><<</a> 
<a href=<%=filename%>&page=<%=page-1%>>[<%=page-1%>]</a> 
<%end if%><% if Rs.pagecount=1 then %><%else%>[<%=page%>]<%end if%>
<% if Rs.pagecount-page <> 0 then %>
<a href=<%=filename%>&page=<%=page+1%>>[<%=page+1%>]</a> 
<a href=<%=filename%>&page=<%=page+1%>>>></a> 
<a href=<%=filename%>&page=<%=Rs.pagecount%>>>>|</a> 
<%end if%></strong>&nbsp;&nbsp;</td>
<%end if%></tr>
</table>
</td></tr>
</table>
<!--====== bottom ========-->
<table width="760" border="0" cellspacing="0" cellpadding="0" align="center" bgcolor=#ffffff>
<tr><td height=2 bgcolor=#4795EC></td></tr>
  <tr>
    <td align="center" height=80><%=citybottom%></td>
  </tr>
</table>
</body>
</html>

⌨️ 快捷键说明

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