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

📄 news.asp

📁 程序为自主开发ASP+SQL大型购物搜索网站,系统管理、商铺、会员三种会员唯一帐号管理。目前已有数据条商品数据与数万条商铺信息
💻 ASP
字号:
<!--#include file="Conn.asp"-->
<!--#include file="public.asp"-->
<%
function HTMLEncodeNO(fString)
	if fString <> "" and Not isnull(fString) Then
    fString = Replace(fString, "<", ",")
    fString = Replace(fString, "/>", ",")
    fString = Replace(fString, ">", ",")
	End IF
		HTMLEncodeNO = fString
end function

Dim NewsClassArr

	Set Rs = Conn.Execute("Select * From NewsClass Where ShopNumberID = '"& ShopNumberID &"'")

	While Not Rs.Eof
	
	NewsClassArr = NewsClassArr & "·<a href=News.asp?C="& Rs("NumberID") &">"& Rs("Class") &"</A><br>"
	
	Rs.MoveNext
	Wend
	Rs.Close
	Set Rs = Nothing



Dim NewsClass
Dim NewsClassName

NewsClass = Trim(Request.QueryString("C"))

NavigationArr = "<a href=./ class=none1>"& ShopName &"</a> > <a href=./News.asp class=none1>新闻动态</a>"
    IF Not Isnull(NewsClass) and NewsClass <> "" Then
N = len(NewsClass)/3
x = 0
	For i = 1 to N
x = x + 3
Set Rs = Conn.Execute("Select * From NewsClass where NumberID = '"& Left(NewsClass,x) &"' and ShopNumberID = '"& ShopNumberID &"'")
		IF Not (rs.bof and rs.bof) Then
			NavigationArr = NavigationArr &" > <a href=./News.asp?N="& Left(NewsClass,x) &" class=none1>"& Rs("Class") &"</a>"
		End if
	Rs.Close
	Next
	End IF
'=======================================================
	
Dim NewsID
Dim NewsTitle
Dim NewsContent
Dim DateTime

	NewsID = Trim(Request.QueryString("NewsID"))
	
	IF NewsID <> "" AND Not Isnull(NewsID) Then
	
	Set Rs = Conn.Execute("Select * From News Where ShopNumberID = '"& ShopNumberID &"' and ID = "& NewsID &"")
	
		IF Not Rs.eof Then
		
		NewsContent = Rs("Content")
		
		NewsTitle   = Rs("Title")
		
		DateTime    = Rs("DateTime")

		NewsClassName = NewsClassName &" > <a href=# class=none1>"& NewsTitle &"</a>"
		
		End IF
		
		Rs.Close
	Set Rs = Nothing
	
	End IF
	
'==================================================================上一条,下一条
	IF Request.QueryString("NewsID")<> "" AND Not Isnull(Request.QueryString("NewsID")) Then

					C  = Trim(Request.QueryString("C"))
					
						if C <> "" and not isnull(C) then
						
							SQLC = "Class like '"& C &"%' and "
							
						end if
						
					  Set Rs = Conn.Execute("Select * From News where "& SQLC &" ID>"& Request.QueryString("NewsID") &" AND ShopNumberID='"& ShopNumberID &"' order by ID")
						  IF Not Rs.bof Then
						  NewsNextArr = ("<A href=News.asp?C="& C &"&NewsID="& Rs("ID") &" Class=None1>阅读上一条</a>&nbsp;")
						  NewsNextStr = true
						  End IF
						  Rs.Close
					  Set Rs = Nothing
					  Set Rs = Conn.Execute("Select * From News where "& SQLC &" ID<"& Request.QueryString("NewsID") &" AND ShopNumberID='"& ShopNumberID &"' order by ID Desc")
						  IF Not Rs.bof Then
						  NewsNextArr = NewsNextArr & ("<A href=News.asp?C="& C &"&NewsID="& Rs("ID") &" Class=None1>阅读下一条</a>")
						  NewsNextStr = true
						  End IF
						  Rs.Close
					  Set Rs = Nothing
					  IF NewsNextStr <> true Then
					  NewsNextArr =("<a href=News.asp?C="& C &" Class=None1>返回列表</a>")
					  End IF
	End IF
'===================================================读取
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>新闻动态-<%=HTMLEncodeNO(ShopName)%>-<%=HTMLEncodeNO(ShopTitle)%>-互联之光大卖场</title>
<meta name="keywords" content="<%=HTMLEncodeNO(ShopKey)%>">
<meta name="description" content="<%=HTMLEncodeNO(ShopContent)%>">
<link href="../../../Search/images/search.css" rel="stylesheet" type="text/css">
</head>
<body>
<!--#include File="Top.asp"-->
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr> 
          <td width="1%" height="24"><img src="../../../Search/images/search_5.gif" width="10" height="24"></td>
          <td width="97%" align="center" valign="bottom" background="../../../Search/images/search_7.gif"><table width="82%" height="23"  border="0" cellpadding="0" cellspacing="0">
              <tr align="center"> 
                <td width="18%" class="text_4"><span class="text_3"><a href="./" class="link2">商品/服务展示</a></span></td>
                <td width="11%" bgcolor="#F16507" class="text_4"><a href="News.asp" class="link2"><span class="text_3">新闻动态</span></a></td>
                <td width="12%" class="text_4"><a href="SeaveInfo.asp" class="link2">服务中心</a></td>
                <td width="12%" class="text_4"><a href="Ask.asp" class="link2">留言反馈</a></td>
                <td width="12%" class="text_4"><a href="../../../Historical/Info.asp?ID=<%=ShopNumberID%>" target="_blank" class="link2">卖家档案</a></td>
                <td width="34%">&nbsp;</td>
              </tr>
            </table>
          </td>
          <td width="1%" align="right"><img src="../../../Search/images/search_6.gif" width="10" height="24"></td>
        </tr>
      </table>
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr> 
          <td height="4" bgcolor="#FF6600"></td>
        </tr>
      </table>
      
    </td>
  </tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr> 
    <td width="63%" height="40" align="left" valign="bottom"> <%=NavigationArr%> </td>
    <td width="37%" align="right" valign="bottom">&nbsp;</td>
  </tr>
</table>
<table width="100%" height="300" border="0" cellpadding="0" cellspacing="0">
  <tr> 
    <td width="180" valign="top"> 
      <table width="98%" border="0" cellpadding="1" cellspacing="1" bgcolor="#CDCDCD">
          <tr> 
            <td bgcolor="ffffff"> <table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tr> 
                  <td height="25" align="center" bgcolor="#FF6600"><font color="#FFFFFF" size="2"><strong>新闻分类</strong></font></td>
                </tr>
              </table>
              <table width="100%" border="0" cellspacing="1" cellpadding="0">
                <tr> 
                  <td>
<%	
	Response.write NewsClassArr
%>
				  
				  </td>
                </tr>
              </table> </td>
          </tr>
      </table> 
      <br>
    </td>
    <td align="left" valign="top"> 
      <table width="100%" cellspacing="0" cellpadding="0">
        <tr> 
          <td height="1" bgcolor="#999999"></td>
        </tr>
      </table>
<%
IF NewsID = "" or Isnull(NewsID) Then
%>
				
				
      <table width="96%" border="0" align="center" cellpadding="5" cellspacing="0">
        <tr> 
                      
          <td> 
            <%
Dim C

C  = Trim(Request.QueryString("C"))

	if C <> "" and not isnull(C) then
	
		SQLC = "Class like '"& C &"%' and "
		
	end if




SQL = "Select * From News Where "& SQLC &" ShopNumberID = '"& ShopNumberID &"' Order By DateTime Desc"
Set Rs = Server.CreateObject("adodb.Recordset")
	Rs.Open SQL,Conn,1,1
IF Not (Rs.bof AND Rs.eof) Then
	Rs.PageSize = 30
%>
            <!--#include File="Page.asp"-->

<%  
	For ii = 1 To x
	Response.Write "<table width=""100%"" border=""0"" cellspacing=""0"" cellpadding=""0"">"
	Response.Write "<tr>"
	Response.Write "<td width=""70%"" class=text_7>·<A href=News.asp?C="& C &"&NewsID="& Rs("ID") &">"& Rs("Title") &"</A></td>"
	Response.Write "<td width=""25%""><FONT COLOR=999999>"& Rs("DateTime") &"</FONT></td>"
	Response.Write "</tr></table>"
	
	Rs.MoveNext
	Next
%>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td height="50"> 
      <%
call PageControl(iCount,maxpage,page,"border=0 align=center","<p align=center>")
	End IF
	Rs.Close
Set Rs = Nothing
%>
    </td>
  </tr>
</table>

		  
		  </td>
                    </tr>
                  </table>
<%
Else
%>
                  
      <table width="96%" border="0" align="center" cellpadding="5" cellspacing="0">
        <tr> 
                      <td height="30" align="center"><font size="2"><strong><%=NewsTitle%></strong></font></td>
                    </tr>
                    <tr> 
                      <td align="center"><%=DateTime%><br> <hr width="100%" size="1" color="#FF6600" noshade></td>
                    </tr>
                    <tr> 
                      
          <td valign="top"><strong><%=NewsContent%></strong></td>
                    </tr>
                    <tr> 
                      <td height="25" align="right">
					  <%					
					  Response.Write(NewsNextArr)
					  %>
					  </td>
                    </tr>
                  </table> 
                  <%End IF%>

          </td>
  </tr>
</table>
<table width="100%" cellspacing="0" cellpadding="0">
        <tr> 
          <td height="1" bgcolor="#999999"></td>
        </tr>
      </table>      
<!--#include file="Foot.asp"-->
</body>
</html>

⌨️ 快捷键说明

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