📄 allnews.asp
字号:
<!--#include file="HMconnection.asp"-->
<%set rs=server.createobject("adodb.recordset")%>
<%
const MaxPerPage=20
dim totalPut
dim CurrentPage
dim TotalPages
dim i,j
if not isempty(request("page")) then
currentPage=cint(request("page"))
else
currentPage=1
end if
%>
<link rel="stylesheet" href="style/style.css" type="text/css">
<title>所有公告列表</title><center>
<table width="95%" height="48" border="0">
<tr>
<td height="30"><table width="100%" border="0" cellspacing="1" cellpadding="0" height="8" align="center">
<tr> <td height="2" colspan="2" bgcolor="#FFFFFF">
<DIV ALIGN="CENTER"><font color="#FF9900">公 告 列 表</font><br>
<hr size="1" width="100%" noshade>
</DIV>
<table width="100%" border="0" cellspacing="1" cellpadding="0" height="100%" ALIGN="CENTER">
<tr> <td bgcolor="#FFFFFF" height="166" VALIGN="TOP"> <%
sql="select * from news order by news_ID DESC"
rs.open sql,conn,1,1
if rs.eof and rs.bof then
response.write "暂无公告!"
else
totalPut=rs.recordcount
if currentpage<1 then
currentpage=1
end if
if (currentpage-1)*MaxPerPage>totalput then
if (totalPut mod MaxPerPage)=0 then
currentpage= totalPut \ MaxPerPage
else
currentpage= totalPut \ MaxPerPage + 1
end if
end if
if currentPage=1 then
showpages
showContent
showpages
else
if (currentPage-1)*MaxPerPage<totalPut then
rs.move (currentPage-1)*MaxPerPage
dim bookmark
bookmark=rs.bookmark
showpages
showContent
showpages
else
currentPage=1
showpages
showContent
showpages
end if
end if
end if
sub showcontent
%> <%do while not rs.eof%> <DIV ALIGN="LEFT"></DIV>
<p style="word-spacing: 2; line-height: 120%; margin-top: 4; margin-bottom: 6" ALIGN="LEFT">
<%i=0 %>
<%if len(rs("news_title"))>100 then
news_title=left(rs("news_title"),20)
%>
<img src="images/03-arrow.gif" width="6" height="7"> <a href="news.asp?news_id=<%=rs("news_id")%>"><%=news_title%>…… (<%=rs("news_date")%>)
</a>
<%else%>
<IMG SRC="images/03-arrow.gif" WIDTH="6" HEIGHT="7"><a href="news.asp?news_id=<%=rs("news_id")%>"> <%=rs("news_title")%> (<%=rs("news_date")%>)</a>
<%end if%>
<br>
<% i=i+1
if i>=MaxPerPage then exit do
rs.movenext
loop
end sub%> <%
sub showpages()
dim n
if (totalPut mod MaxPerPage)=0 then
n= totalPut \ MaxPerPage
else
n= totalPut \ MaxPerPage + 1
end if
response.write "<center>"
end sub %> </td></tr> </table></td></tr> </table></td></tr> </table>
</center>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -