📄 news.asp
字号:
<!-- #include file="conn.asp" -->
<!--#include file="webconfig.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title><%=webname%></title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<!--#include file="include/top.asp" -->
<table width="778" border="0" align="center" cellpadding="0" cellspacing="0">
<tr valign="top">
<td width="1" bgcolor="#cccccc"></td>
<td width="220" height="100"><!-- #include file="include/left.asp" --></td>
<td width="1" bgcolor="cccccc"></td>
<td align="center">
<!--#include file="include/search.asp" -->
<table width="96%" border="0" cellspacing="0" cellpadding="3">
<tr>
<td> <%
sql="select * from Net008_news where type1='1' order by adddate desc"
set rs=server.createobject("adodb.recordset")
rs.open sql ,conn,1,2
if rs.recordcount<1 then
response.write"暂无信息!"
'response.end
end if
const maxperpage=20 '定义每一页显示的数据记录的常量
dim currentpage '定义当前页的变量
rs.pagesize=maxperpage
currentpage=request.querystring("pageid")
if currentpage="" then
currentpage=1
elseif currentpage<1 then
currentpage=1
else
currentpage=clng(currentpage)
if currentpage > rs.pagecount then
currentpage=rs.pagecount
end if
end if
'如果变量currentpage的数据类型不是数值型
'就1赋给变量currentpage
if not isnumeric(currentpage) then
currentpage=1
end if
dim totalput,n '定义变量
totalput=rs.recordcount
if totalput mod maxperpage=0 then
n=totalput\maxperpage
else
n=totalput\maxperpage+1
end if
if n=0 then
n=1
end if
rs.move(currentpage-1)*maxperpage
%> <table width="100%" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td height="22" align="left" class="centertitle">最新消息</td>
</tr>
<tr>
<td height="1" bgcolor="cccccc"></td>
</tr>
</tbody>
</table>
<table cellspacing=0 cellpadding=3 width="100%"
border=0>
<tbody>
<%
i=0
do while i< maxperpage and not rs.eof
%>
<tr>
<td height=23 colspan="4"><img src="images/img_03.gif" width="12" height="12" align="absmiddle">
<a href=browse.asp?id=<%=rs("id")%> class=LeftTypeLink target=_blank><%=rs("title")%></a> <%
response.write "["&FormatDateTime(rs("adddate"),2)&"]"
response.write "(阅读:"&rs("click")&"次)"
if rs("adddate")+10>date() then
response.write " <img src='images/new.gif'>"
end if
%> </td>
</tr>
<%
i=i+1
rs.movenext
loop
%>
</tbody>
</table></td>
</tr>
<tr>
<td align="center"> </td>
</tr>
<tr>
<td align="center">页数:<%=currentpage%>/
<% =n%> <%k=currentpage
if k<>1 then%>
[<a href="news.asp?pageid=1" class="LeftTypeLink">首页</a>] [<a href="news.asp?pageid=<%=k-1%>" class="LeftTypeLink">上一页</a>]
<%else%>
[首页] [上一页]
<%end if%> <%if k<>n then%>
[<a href="news.asp?pageid=<%=k+1%>" class="LeftTypeLink">下一页</a>]
[<a href="news.asp?pageid=<%=n%>" class="LeftTypeLink">尾页</a>]
<%else%>
[下一页] [尾页]
<%end if%>
共有<font color="red"><%=totalput%></font>条信息</td>
</tr>
<tr>
<td> </td>
</tr>
</table>
</td>
<td width="1" bgcolor="cccccc"></td>
</tr>
</table>
<!-- #include file="include/bottom.asp" -->
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -