<%
const MaxPerPage=30
dim totalPut
dim CurrentPage
dim TotalPages
dim i,j
dim idlist
if not isempty(request("page")) then
currentPage=cint(request("page"))
else
currentPage=1
end if
sql="select * from article where Nclassid=7 order by article.articleid desc"
rs.open sql,conns,1,1
%>
<%if rs.eof and rs.bof then%>
没有新闻
<% 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
showContent
showpage totalput,MaxPerPage,"news.asp"
else
if (currentPage-1)*MaxPerPage
<% do while not rs.eof %>
&" title=<%=left(rs("key"),140)%>>
<%=rs("title")%>
<% if rs("dateandtime")=date() then
%>
<% end if %>
<%
i=i+1
if i>=MaxPerPage then exit do
rs.movenext%>
<% loop
%>
<% rs.close %>
|
| |
|
<%
end sub
function showpage(totalnumber,maxperpage,filename)
dim n
if totalnumber mod maxperpage=0 then
n= totalnumber \ maxperpage
else
n= totalnumber \ maxperpage+1
end if
response.write " "
if CurrentPage<2 then
response.write "[首页] [上一页] "
else
response.write "[首页] "
response.write "[上一页] "
end if
if n-currentpage<1 then
response.write "[下一页] [尾页]"
else
response.write ""
response.write "[下一页] [尾页]"
end if
end function
%>
|
| |
|
| |
|
|