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

📄 news.asp

📁 商业网站/图片管理系统/投票系统/新闻管理系统/
💻 ASP
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<%option explicit%>
<%dim db
db=1
%>
<!--#include file="config/db.asp"-->
<!--#include file="config/function.inc.asp"-->
<%dim rst,sql,rst1,sql1,page,pagelistnum,sqlfy,myErrors
set rst=server.createobject("adodb.recordset")
set rst1=server.createobject("adodb.recordset")
%>
<%'------------------翻页参数-----------------------
pagelistnum=15
if request.querystring("page")="" then
	page = 1
else
	page=request.querystring("page")
end if
'if session("show_id")="" then session("show_id")="0"
'----------------地址栏参数传递----------------
if request.querystring("c")<>"" then
	session("show_id")=request.querystring("c")
else
	session("show_id")="0"
end if
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>新闻列表</title>
<link href="css/mycss.css" rel="stylesheet" type="text/css" />
</head>

<body>
<div align="center">
	<table width="780" height="385" border="0" cellpadding="0" cellspacing="0">
		<tr>
			<td width="13" height="260">&nbsp;</td>
			<td width="200" valign="top" class="allbcolor">
			
			<table width="198" height="228" border="0" cellpadding="0" cellspacing="0">
				<tr>
				
					<td width="173" valign="top">
					<%
					sql="select * from shop_newsclass where nc_upid=0 order by nc_sort asc"
					rst.open sql,conn,1,1
					do while not rst.eof
					%>
					<table width="196" height="30" border="0" cellpadding="0" cellspacing="0">
						<tr>
							<td width="196" height="30" valign="top">
							
							<table width="194" border="0" cellspacing="0" cellpadding="0">
								<tr>
									<td width="1" height="25" bgcolor="#333333">&nbsp;</td>
									<td width="184" align="left" bgcolor="#CCCCCC"><%=rst("nc_name")%></td>
								</tr>
							</table>							</td>
						</tr>
					</table>
						<%
						sql1="select * from shop_newsclass where nc_upid<>0 and nc_upid="&rst("nc_id")
						rst1.open sql1,conn,1,1
						do while not rst1.eof
						%>
						<table width="196" border="0" cellspacing="0" cellpadding="0">
							<tr>
								<td align="center" valign="middle"><a href="news.asp?c=<%=rst1("nc_id")%>"><%=rst1("nc_name")%></a></td>
							</tr>
						</table>
					<%
							rst1.movenext
						loop
						rst1.close
						rst.movenext
					loop
					rst.close
					%>						</td>
				</tr>
			</table>
			
			<p>&nbsp;</p></td>
			<td width="570" align="center" valign="top" class="allbcolor"><div align="center">
				<table width="550" height="228" border="0" align="center" cellpadding="0" cellspacing="0">
						<tr>
							<td height="46" align="center" valign="middle">
							<%sql="select top "&(page*pagelistnum)&" * from shop_news" 
							sqlfy="select count(*) as num from shop_news"
							if session("show_id")<>"0" then
								sql=sql&" where n_ncid="&session("show_id")
								sqlfy=sqlfy&" where n_ncid="&session("show_id")
							end if
							rst.open sql,conn,1,1
							on error resume next
							rst.pagesize=pagelistnum
							rst.AbsolutePage=page
							%>
							<table width="548" border="4" align="center" cellpadding="0" cellspacing="0" bordercolor="#CCCCCC">
								<tr>
									<td width="53" height="27">&nbsp;</td>
									<td width="495" align="left">
									<%
									if session("show_id")=0 then
										response.write("所有新闻")
									else
										sql1="select * from shop_newsclass where nc_id="& session("show_id")
										rst1.open sql1,conn,1,1
										response.write(rst1("nc_name"))
										rst1.close
									end if
									%></td>
								</tr>
							</table></td>
						</tr>
						<tr>
							<td valign="top">
							<%do while not rst.eof%>
							<table width="542" height="20" border="0" cellpadding="0" cellspacing="0">
								<tr>
									<td width="30" height="20" align="center" valign="middle"><img src="images/arrowOut.gif" width="3" height="5" /></td>
									<td width="507" align="left"><a href="shopnews.asp?id=<%=rst("n_id")%>" target="_blank"><%=rst("n_title")%></a></td>
								</tr>
							</table>
								<%
									rst.movenext
								loop
								rst.close
								%>
								<table width="527" border="0" cellspacing="0" cellpadding="0">
									<tr>
										<td width="527" align="right"><% fy sqlfy,page,pagelistnum,"news.asp?t="%></td>
									</tr>
								</table></td>
						</tr>
							</table>
			</div></td>
			<td width="14">&nbsp;</td>
		</tr>
	</table>
</div>
<%
set rst=nothing
set rst1=nothing
conn.close
set conn=nothing
%>
</body>
</html>

⌨️ 快捷键说明

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