📄 search_yp.asp
字号:
<!--#include file="main.asp"-->
<%word=request("word")
key=request("key")
ypxxone_id=request("ypxxone_id")
ypxxtwo_id=request("ypxxtwo_id")
addone_id=request("addone_id")
addtwo_id=request("addtwo_id")
if ypxxone_id<>"" then
xxsort=" and SMT_ypxxone_id="&ypxxone_id&""
if ypxxtwo_id<>"" then
xxsort=xxsort&" and SMT_ypxxtwo_id="&ypxxtwo_id&""
end if
end if
if addone_id<>"" then
addsort=" and SMT_addone_id="&addone_id&""
if addtwo_id<>"" then
addsort=addsort&" and SMT_addtwo_id="&addtwo_id&""
end if
end if
'==================================
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 valign="top" width="570">
<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
<tr><td height=10 colspan=5></td></tr>
<tr><td valign="top" height=400>
<!--==================-->
<table width="100%" border="0" cellspacing="1" cellpadding="0" align="center">
<%sql= "select * from SMT_yp where SMT_key<>0 and SMT_key<>2 and SMT_key1=1 and(SMT_coname like'%"&word&"%' or SMT_cojc like'%"&word&"%' or SMT_coms like'%"&word&"%') "&xxsort&addsort&" 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=15
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
goname=rs("SMT_user")
goid=rs("SMT_id")
'====================
SMT_coname=replace(rs("SMT_coname"),word,"<font color=red>"&word&"</font>")
aaa=trim(rs("SMT_coms"))
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_coms=c&d
else
SMT_coms=Trim(left(aaa,100))&"..."
end if
SMT_coms=replace(SMT_coms,word,"<font color=red>"&word&"</font>")
'====================
%>
<!--#include file="dns/dns.asp"-->
<tr align=center>
<td width="4%"><strong><font color=#ff6600>>></font></strong></td>
<td width="96%" height=30 align=left><a href="<%=usertwourl%>" target="_blank" class="f14"><strong><%=SMT_coname%></strong></a> <font color=#cc3300>(<%=rs("SMT_date")%>)</font></td>
</tr>
<tr><td></td>
<td height=30><p style="line-height:180%"> <%=SMT_coms%></td></tr>
<tr><td background="img/list_line_1.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=30 bgcolor=#FFE2DA><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> </td>
<%end if%></tr>
</table>
</td></tr>
</table>
</td>
<!--======== end left ==========-->
<td width="10"></td>
<!--======== right ==========-->
<td width="180" valign="top" background="img/pa_bg9.jpg" style="background-repeat:repeat-y;border:1px #cccccc solid">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td height=30 background="img/bgtitle1.gif" width="180"> <font color=#ffffff><strong>产品信息推荐</strong></font></td>
</tr>
<tr><td height=5></td></tr>
<%set rs=server.createobject("adodb.recordset")
sql="select top 10 * from SMT_cp where SMT_key=1 and SMT_key1=1 and SMT_key2=1 and SMT_key3=1 order by SMT_id desc"
rs.open sql,conn,1,1
do while not rs.eof
cpname=rs("SMT_cpname")%>
<tr><td height=90 align=center><a href=cp_view.asp?id=<%=rs("SMT_id")%> target="_blank"><img src="<%=rs("SMT_pic")%>" border="0" width=80 height=80 style="border:1px #000000 solid"></a></td></tr>
<tr><td align="center" height=25><strong><a href=cp_view.asp?id=<%=rs("SMT_id")%> target="_blank"><%=LeftT(cpname,12)%></a></strong></td></tr>
<%rs.movenext
loop
rs.close%>
</table>
</td>
</tr>
</table>
<!--====== bottom ========-->
<table width="760" border="0" cellspacing="0" cellpadding="0" align="center" bgcolor=#ffffff>
<tr><td height=2 bgcolor=#cc3300></td></tr>
<tr>
<td align="center" height=80><%=citybottom%></td>
</tr>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -