?? sonews.asp
字號:
<!--#include file="../conn.asp"-->
<!--#include file="../fuction.asp" -->
<!--#include file="../webconfig.asp"-->
<html>
<head>
<title><%=webname%>--新聞搜索</title>
<html>
<link rel="SHORTCUT ICON" href="/shortcut.ico">
<meta name="generator" content="snsn-shop">
<meta name=keywords content="<%=webgjz%>">
<meta name="description" content="<%=webmx%>">
<meta name="MSSmartTagsPreventParsing" content="TRUE">
<meta http-equiv="MSThemeCompatible" content="Yes">
<link href="/css.css" rel="stylesheet" type="text/css">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css">
<!--
.style2 {color: #0000FF}
-->
</style>
</head>
<body leftmargin=0 topmargin=0 marginwidth="0" marginheight="0"><!-- onMouseOver="window.status='【<%=webname%>】<%=weburl%> 如果您喜歡本站,別忘了把本站介紹給您的好友哦!:)';return true">-->
<!--#include file="../webtop.asp"-->
<table width="940" align="center" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="6" colspan="3"></td>
</tr>
<tr>
<td width="17"><img src="/img/index_1.gif" width="15" height="16"></td>
<td valign="bottom">您現在的位置是:<a href="<%=weburl%>"><%=webname%></a> -> <a href="/news/">新聞中心</a> -> 搜索新聞</td>
<td valign="bottom"> </td>
</tr>
<tr>
<td height="6" colspan="3"></td>
</tr>
</table>
<table width="945" border="0" align="center" cellpadding="0" cellspacing="0">
<tr valign="top">
<td width="200"><!--#include file="news_left.asp"--></td>
<td><!--#include file="top.asp"-->
<br>
<%selectkey=nosql(trim(request(trim("selectkey"))))
selectkey=Replace(selectkey, "'", "")
selectkey=Replace(selectkey, "‘", "")
selectkey=checkFFSQLStr(Replace(selectkey,"’",""))
lx=nosql(trim(request("lx")))
set rs=server.createobject("adodb.recordset")
if selectkey="" or selectkey="請輸入關鍵字" then
response.write "<script LANGUAGE='javascript'>alert('請輸入關鍵字,請返回!');history.go(-1);</script>"
response.End
else
if lx="id" then
rs.open "select newsid,newsname,addname,adddate,viewcount,newstop,tp,newstj from shop_news where newsid like '%"&selectkey&"%' order by newstop asc,newstj asc,newsid desc",conn,1,1
elseif lx="bt" then
rs.open "select newsid,newsname,addname,adddate,viewcount,newstop,tp,newstj from shop_news where newsname like '%"&selectkey&"%' order by newstop asc,newstj asc,newsid desc",conn,1,1
elseif lx="nr" then
rs.open "select newsid,newsname,addname,adddate,viewcount,newstop,tp,newstj from shop_news where newscontent like '%"&selectkey&"%' order by newstop asc,newstj asc,newsid desc",conn,1,1
else
rs.open "select newsid,newsname,addname,adddate,viewcount,newstop,tp,newstj from shop_news order by newstop asc,newstj asc,newsid desc",conn,1,1
end if
end if
if rs.recordcount=0 then
%>
<table width="100%" border="0" cellspacing="0" cellpadding="5" align="center">
<tr>
<td align=center>暫無新聞</td>
</tr>
</table>
<%
else
rs.PageSize =30 '每頁記錄條數
iCount=rs.RecordCount '記錄總數
iPageSize=rs.PageSize
maxpage=rs.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
rs.AbsolutePage=Page
if page=maxpage then
x=iCount-(maxpage-1)*iPageSize
else
x=iPageSize
end if
%>
<table width="98%" border="0" cellspacing="0" cellpadding="5" align="center">
<%
For i=1 To x
%>
<tr onMouseOver='JavaScript:this.style.backgroundColor="#f1f1f1"' onMouseOut='JavaScript:this.style.backgroundColor=""'>
<td align=center height=20 width="21"><img src="/img/top1.gif" border="0"> </td>
<td height=20 align=left><a href=news.asp?id=<%=rs("newsid")%>><%=replace(trim(rs("newsname")),"<br>","")%></a>
<%if rs("newstop")=0 then%>
<font color="#FF0000">頂</font>
<%end if%>
<%if rs("newstj")=0 then%>
<span class="style2">薦</span>
<%end if%>
<%if rs("tp")=0 then%>
<img src="../img/img.gif" width="13" height="13">
<%end if%></td>
<td height="20" colspan="2" align=left><div align="right"> 發布人:<%=trim(rs("addname"))%> | <%=year(rs("adddate"))&"年"&month(rs("adddate"))&"月"&day(rs("adddate"))&"日"%> | 瀏覽<font color="#FF0000"><%=rs("viewcount")%></font>次 </div></td>
</tr>
<tr>
<td height="1" background="/img/skin<%=cssid%>/x.gif"></td>
<td height="1" colspan="2" background="/img/skin<%=cssid%>/x.gif"></td>
<td width="120" height="1" background="/img/skin<%=cssid%>/x.gif"></td>
</tr>
<%
rs.movenext
next
%>
</table>
<br>
<%
call PageControl(iCount,maxpage,page,"border=0 align=center","<p align=center>")
end if
rs.close
set rs=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 )
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(" 頁次:" & page & "/" & pageCount & "頁" & vbCrLf)
Response.Write(" 共有" & iCount & "條新聞" & vbCrLf)
Response.Write(" 轉到 " & "<INPUT TYEP=TEXT class=wenbenkuang NAME=page SIZE=1 Maxlength=5 VALUE=" & page & ">" & " 頁" & vbCrLf & "<input name=go type=image src=/img/butn_go.gif alt=GO align=absMiddle border=0>")
Response.Write("</TD>" & vbCrLf )
Response.Write("</TR></form>" & vbCrLf )
Response.Write("</table>" & vbCrLf )
End Sub
%></td>
</tr>
</table>
<!--#include file="../copyright.asp"-->
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -