📄 list.asp
字号:
<!--#include file="conn.asp"-->
<!--#include file="const.asp"-->
<!--#include file="code.asp"-->
<%
dim sql
dim rs
dim rstype
dim typesql
dim typeid,typename,classname,classid,Nclassname,Nclassid
dim title
set rs=server.createobject("adodb.recordset")
sql="update article set hits=hits+1 where articleID="&request("id")
rs.open sql,conn,1,3
sql="select Aclass.class,ANclass.Nclass,article.title,article.classid,article.Nclassid from article,Aclass,ANclass where article.classid=Aclass.classid and article.Nclassid=ANclass.Nclassid and article.articleID="&request("id")
rs.open sql,conn,1,1
if not rs.eof then
title=rs("title")
classid=rs("classid")
Nclassid=rs("Nclassid")
classname=rs("class")
Nclassname=rs("Nclass")
end if
rs.close
%>
<html>
<head>
<meta NAME="GENERATOR" Content="Microsoft FrontPage 4.0">
<meta HTTP-EQUIV="Content-Type" content="text/html; charset=gb2312">
<meta name="keywords" content="ASP动网先锋,http://www.aspsky.net">
<LINK href="style.css" rel=stylesheet>
<title><%=title%>|http://www.aspsky.net</title>
</head>
<body>
<!--#include file="head.inc" -->
<TABLE cellSpacing=0 cellPadding=0 width="95%" border=0 align=center>
<TBODY>
<TR>
<TD>
<TABLE class="border" cellSpacing=0 cellPadding=4 width="100%" border=0>
<TR>
<TD class="title" colspan="2">
<%
sql="select class,classid from Aclass"
rs.open sql,conn,1,1
if rs.eof and rs.bof then
response.write "还没有任何栏目"
response.end
else
do while not rs.eof
%>| <a href="default.asp?classid=<%=rs("classid")%>"><%if cint(rs("classid"))=cint(classid) then%><font color=red><%=rs("class")%></font><%else%><%=rs("class")%><%end if%></a> |
<%
rs.movenext
loop
end if
rs.close
dim key
sql="select * from article where articleid="&request("id")
rs.open sql,conn,1,1
if rs.eof and rs.bof then
response.write "没有找到相关文章。"
response.end
end if
if rs("Nkey")<>"" then
key=rs("Nkey")
else
key="None News"
end if
%>
</TD></TR>
<TR>
<TD class="title2" colspan="2">
<table width=100% cellpadding=0 cellspacing=0 border=0>
<tr><td width=*>
| <a href="index.asp?classid=<%=classid%>"><%=classname%></a>>><a href="index.asp?classid=<%=classid%>&Nclassid=<%=Nclassid%>"><%=Nclassname%></a>>><%=title%>
</td><td width=50><img src=pic/printpage.gif align=absmiddle> <a href=printpage.asp?id=<%=request("id")%> >打印</a></td>
</tr>
</table>
</TD></TR>
<TR>
<TD class="tdbg" colspan="2">
<center><b><font size=3><%=rs("title")%></font></b><br>www.aspsky.net <%=rs("dateandtime")%> 动网先锋</center><p>
<blockquote>
<br>
<font class="b1"><%=rs("content")%></font><br>
<br>
<p align=right>
原作者:<%if not isnull(rs("writer")) then%><%=rs("writer")%><%else%>不详<%end if%><br>
来 源:<%if not isnull(rs("writefrom")) then%><%=rs("writefrom")%><%else%>不详<%end if%><br>
共有<%=rs("hits")%>位读者阅读过此文
<br><br>
【<a href=sendmail.asp?id=<%=rs("articleid")%>>告诉好友</a>】
</blockquote>
<%
rs.close
sql="select title,articleid from article where articleid="&request("id")-1
rs.open sql,conn,1,1
if rs.eof and rs.bof then
%><p><li>上篇文章:已经没有了
<%else%>
<p><li>上篇文章:<a href="list.asp?id=<%=rs("articleid")%>"><%=rs("title")%></a>
<%end if%>
<BR>
<% rs.close
sql="select title,articleid from article where articleid="&request("id")+1
rs.open sql,conn,1,1
if rs.eof and rs.bof then
%><li>下篇文章:已经没有了
<%else
%>
<li>下篇文章:<a href="list.asp?id=<%=rs("articleid")%>"><%=rs("title")%></a>
<%end if%>
</TD></TR>
<TR>
<TD class="title3" width="50%">□- 本周热门文章
</TD>
<TD class="title3" width="50%">□- 相关文章
</TD></TR>
<tr class="tdbg"><td width="50%" valign=top >
<%
dim i
set rs=conn.execute("SELECT top 7 articleid,title,hits FROM article where month(dateandtime)=month(date()) and day(dateandtime)>=day(date()-6) order by hits desc")
i=1
do while not rs.eof
%>
<%=i%>.<a href="list.asp?id=<%=rs("articleid")%>" title="<%=rs("title")%>" target=_top><%if len(rs("title"))>18 then%><%=left(rs("title"),18)%>...<%else%><%=rs("title")%><%end if%></a>[<font color=red><%=rs("hits")%></font>]<br>
<%
i=i+1
rs.movenext
loop
%>
</td><td width="50%" valign=top >
<%
set rs=conn.execute("SELECT top 7 articleid,title FROM article where Nkey='"&key&"' order by articleid desc")
do while not rs.eof
%>
<a href='list.asp?id=<%=rs("articleid")%>'><%=rs("title")%></a><br>
<%
rs.movenext
loop
%>
</td></tr>
</table>
</td>
</tr>
</tbody>
</table>
</div>
<!--#include file="foot.inc" -->
</body>
</html>
<%
rs.close
set rs=nothing
conn.close
set conn=nothing
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -