?? news.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"> </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"> </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> </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"> </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"> </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 + -