📄 newsresearch.asp
字号:
<!--网站头文件-->
<!--#include file="byshop_conn.asp"-->
<!--#include file="webhead.asp"-->
<title>新闻搜索结果-<%=webname%></title>
<SCRIPT language=javaScript>
<!--
function mOvr(src,clrOver){
if (!src.contains(event.fromElement)) {
src.style.cursor = 'hand';
src.bgColor = clrOver;
}
}
function mOut(src,clrIn) {
if (!src.contains(event.toElement)) {
src.style.cursor = 'default';
src.bgColor = clrIn;
}
}
//-->
</SCRIPT>
<%
servername1=cstr(request.servervariables("http_referer"))
servername2=cstr(request.servervariables("server_name"))
if mid(servername1,8,len(servername2)) <> servername2 then
response.write "路径有误,禁止从网站外部提交表单!"
response.end
end if
%>
<%
keyword=trim(request("keyword"))
area=trim(request("area"))
sort=trim(request("sort"))
if area ="1" or area ="2" then
else
response.write "参数错误!"
response.End
end if
if sort = "0" or sort ="1" or sort ="2" or sort = "3" or sort = "4" then
else
response.write "参数错误!"
response.End
end if
'//新闻标题
if area="1" then
str1=" "
str3=" "
str2=keyword
counter=0
if instr(str2,str1) then
for i=1 to len(str2)
if mid(str2,i,len(str1))<>(str1) then
counter=0
for ii=i to len(str2)
if mid(str2,ii,len(str1))<>str1 then
counter=counter+1
else
exit for
end if
next
strsubkey=mid(keyword,i,counter)
strnew=strnew&" and newsname like '%"&strsubkey&"%'"
counter=counter+1
end if
if mid(str2,i,len(str3))=( str3) then
counter=counter+1
end if
next
end if
tj1=strnew
if strnew="" then
tj1=" and newsname like '%"&keyword&"%' "
end if
end if
'//新闻内容
if area="2" then
str1=" "
str3=" "
str2=keyword
counter=0
if instr(str2,str1) then
for i=1 to len(str2)
if mid(str2,i,len(str1))<>(str1) then
counter=0
for ii=i to len(str2)
if mid(str2,ii,len(str1))<>str1 then
counter=counter+1
else
exit for
end if
next
strsubkey2=mid(keyword,i,counter)
strnew2=strnew2&" and newscontent like '%"&strsubkey2&"%'"
counter=counter+1
end if
if mid(str2,i,len(str3))=( str3) then
counter=counter+1
end if
next
end if
tj2=strnew2
if strnew2="" then
tj2=" and newscontent like '%"&keyword&"%' "
end if
end if
if sort<>"0" then
tj3=" and class= "&sort
end if
set rs2news=server.createobject("adodb.recordset")
if area="1" then
rs2news.open "select * from news where 1=1 "&tj1&" "&tj3&" and 1=1",conn,1,1
end if
if area="2" then
rs2news.open "select * from news where 1=1 "&tj2&" "&tj3&" and 1=1",conn,1,1
end if
%>
<div align="center">
<table border="0" width="779" id="table2" cellspacing="0" cellpadding="0">
<tr>
<td>
搜索条件:
</td>
</tr>
</table>
<table border="0" width="779" id="table1" cellspacing="0" cellpadding="0">
<tr>
<td width="175" valign="top">
<!--网站左面-->
<div align="center">
<table width="100%" border="0" cellspacing="1" cellpadding="0" id="table1">
<tr>
<td align="center" valign="top" height="2"></td>
</tr> <tr>
<td align="center" valign="top">
<!--新闻--><!--#include file="in_news.asp"-->
<!--二手车收索--><!--#include file="in_newssearch.asp"-->
<!--广告--><!--#include file="in_ads2.asp"-->
</td>
</tr>
</table>
</div> </td>
<td valign="top" width="8"> </td>
<td valign="top" align="right" >
<!----><div align="center">
</div>
<div align="right">
<table border="0" id="table2" cellspacing="0" cellpadding="0">
<tr>
<td align="center"><table cellSpacing="0" cellPadding="0" width="100%" bgColor="#ffffff" border="0" id="table64">
<tr>
<td vAlign="top" align="middle">
<table cellSpacing="0" cellPadding="0" width="100%" border="0" id="table65">
<tr vAlign="top">
<td>
<table cellSpacing="0" cellPadding="0" width="100%" border="0" id="table66">
<tr>
<td vAlign="top">
<table cellSpacing="0" cellPadding="0" width="100%" border="0" id="table67">
<tr>
<td width="6">
<p align="left">
<img height="6" src="images/didi_001.gif" width="6"></td>
<td background="images/didi_005.gif">
<p align="left">
<img height="6" src="images/didi_005.gif" width="6"></td>
<td width="6">
<p align="left">
<img height="6" src="images/didi_002.gif" width="6"></td>
</tr>
<tr>
<td background="images/didi_007.gif">
<p align="left"> </td>
<td vAlign="top">
<table height="1" cellSpacing="0" cellPadding="0" width="100%" bgColor="#ffffff" border="0" id="table68">
<tr>
<td bgcolor="#BDDBE9">
<p align="left"> <span lang="zh-cn">汽车新闻</span></td>
</tr>
</table>
<table cellSpacing="0" cellPadding="5" width="100%" border="0" id="table69">
<tr>
<td class="didibaba_l17" vAlign="top">
<table border="0" width="555" id="table2" cellspacing="0" cellpadding="0">
<tr>
<td align="center"></td>
</tr>
<tr>
<td>
<p align="right">『<a href="carnews.asp?class=1">二手车新闻</a>』 『<a href="carnews.asp?class=2">行内标准</a>』
『<a href="carnews.asp?class=3">行内政策</a>』 『<a href="carnews.asp?class=4">二手车贷款</a>』</td>
</tr>
<%
if rs2news.recordcount=0 then
%>
<tr>
<td>暂无信息
</td>
</tr>
<%else%>
<tr>
<td>
<%
rs2news.PageSize =24 '每页记录条数
iCount=rs2news.RecordCount '记录总数
iPageSize=rs2news.PageSize
maxpage=rs2news.PageCount
page=request("page")
if Not IsNumeric(page) or page="" then
page=1
else
page=cint(page)
end if
if page<1 then
page=1
elseif page>maxpage then
page=maxpage
end if
rs2news.AbsolutePage=Page
if page=maxpage then
x=iCount-(maxpage-1)*iPageSize
else
x=iPageSize
end if
%>
<table width="555" border="0" style="border-collapse: collapse" bordercolor="#BDDBE9" cellpadding="4">
<%
byshop_i=1
For i=1 To x
%>
<tr onmouseout="mOut(this,'#FFFFFF');" onmouseover="mOvr(this,'#e4f3fa');">
<td width="538" ><a href="news.asp?id=<%=rs2news("newsid")%>" title="<%=trim(rs2news("newsname"))%>"><%=trim(rs2news("newsname"))%></a><a title="<%=rs2news("adddate")%>"><font color="#ff9900"> [
<%=year(rs2news("adddate"))%>-<%=month(rs2news("adddate"))%>-<%=day(rs2news("adddate"))%> 浏览:<%=rs2news("viewcount")%> ]</font></a></td>
</tr>
<%if byshop_i mod 10 = 0 then%>
<tr >
<td width="538" > </td>
</tr>
<%end if%>
<%
byshop_i=byshop_i+1
rs2news.movenext
next
%>
</table>
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td align="right"> <%call PageControl(iCount,maxpage,page,"border=0 align=right","<p align=right>")%></td>
</tr>
</table>
<%
end if
rs2news.close
set rs2news=nothing
Sub PageControl(iCount,pagecount,page,table_style,font_style)
'生成上一页下一页链接
Dim query, a, x, temp
action = "http://" & Request.ServerVariables("HTTP_HOST") & Request.ServerVariables("SCRIPT_NAME")
query = Split(Request.ServerVariables("QUERY_STRING"), "&")
For Each x In query
a = Split(x, "=")
If StrComp(a(0), "page", vbTextCompare) <> 0 Then
temp = temp & a(0) & "=" & a(1) & "&"
End If
Next
Response.Write("<table " & Table_style & ">" & vbCrLf )
Response.Write("<form method=get onsubmit=""document.location = '" & action & "?" & temp & "Page='+ this.page.value;return false;""><TR>" & vbCrLf )
Response.Write("<TD align=right>" & vbCrLf )
Response.Write(font_style & vbCrLf )
Response.Write(" 共有" & iCount & "条信息" &" "& vbCrLf)
Response.Write(" 共:" & pageCount & "页" &" "& vbCrLf)
Response.Write(" 每页" & iPageSize & "篇" &" "& vbCrLf)
Response.Write(" 当前第:" & page & "页" &" "& vbCrLf)
if page<=1 then
Response.Write ("首页 " & vbCrLf)
Response.Write ("上一页 " & vbCrLf)
else
Response.Write("<A HREF=" & action & "?" & temp & "Page=1>首页</A> " & vbCrLf)
Response.Write("<A HREF=" & action & "?" & temp & "Page=" & (Page-1) & ">上一页</A> " & vbCrLf)
end if
if page>=pagecount then
Response.Write ("下一页 " & vbCrLf)
Response.Write ("尾页 " & vbCrLf)
else
Response.Write("<A HREF=" & action & "?" & temp & "Page=" & (Page+1) & ">下一页</A> " & vbCrLf)
Response.Write("<A HREF=" & action & "?" & temp & "Page=" & pagecount & ">尾页</A> " & vbCrLf)
end if
Response.Write("</TD>" & vbCrLf )
Response.Write("</TR></form>" & vbCrLf )
Response.Write("</table>" & vbCrLf )
End Sub
%></td>
</tr>
<tr>
<td></td>
</tr>
</table><%rs2newsb.close
set rs2newsb=nothing%><table border="0" width="100%" id="table72" cellspacing="0" cellpadding="0">
<tr>
<td>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
<td background="images/didi_008.gif">
<p align="left"> </td>
</tr>
<tr>
<td>
<p align="left">
<img height="6" src="images/didi_003.gif" width="6"></td>
<td background="images/didi_006.gif">
<p align="left">
<img height="6" src="images/didi_006.gif" width="6"></td>
<td>
<p align="left">
<img height="6" src="images/didi_004.gif" width="6"></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</td>
</tr>
</table> </td>
</tr>
</table>
<!--#include file=webfoot.asp--></div>
<p> </p>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -