复制代码代码如下:
<!--#includefile="conn.asp"-->
<styletype="text/css">
body,td,th{
color:#000000;
font-size:14px;
background-color:#D6DFF7;
}
</style>
<%
dimrs
setrs=server.CreateObject("adodb.recordset")
ifrequest("type")="date"then
yearstr=request("selyear")
monstr=request("selmonth")
daystr=request("selday")
ifdaystr<>""then
theymd=yearstr&"-"&monstr&"-"&daystr
sql="selectidfromnewswheredatetimelike'"&theymd&"%'orderbydatetimedesc"
else
theymd=yearstr&"-"&monstr&"-"
sql="selectidfromnewswheredatetimelike'"&theymd&"%'orderbydatetimedesc"
endif
elseifrequest("type")="new"then
topnew=request("newcount")
iftopnew<>""then
topnew=cint(topnew)
sql="selecttop"&topnew&"idfromnewsorderbydatetimedesc"
endif
elseifrequest("type")="nosh"then
sql="selectidfromnewswhereshengcheng=0"
elseifrequest("type")="all"then
sql="selectidfromnewsorderbyiddesc"
endif
ifsql<>""then
response.writesql
response.write"<center><b><fontcolor=""#FF0000"">正在生成文章内容页的Html页,请等待......</font></b><spanid=showImport></span></center><IE:DownloadID=""oDownload""STYLE=""behavior:url(#default#download)""/>"
ifrequest("p")<>""then
p=cint(request("p"))
else
p=1
endif
MaxPerPage=100
rs.opensql,conn,1,1
ifnotrs.eofthen
rs.pagesize=MaxPerPage'得到每页数
mpage=rs.pagecount'得到总页数
allshu=rs.recordcount'得到总数
rs.move(p-1)*MaxPerPage
dowhilenotrs.eof
i=i+1
callMakeHtml()
ifi>=MaxPerPagethenexitdo
rs.movenext
loop
endif
rs.close
Sshu=MaxPerPage*p-MaxPerPage+1'当前已经生成的数量
Tshu=Sshu+i-1'已生成生成的
ifallshu<Sshuthen
setrs=nothing
conn.close
setconn=nothing
response.redirect"makehtmlall.asp?type=ok"&"&shu="&request("shu")&"&D="&d&"&p="&p+1
response.end
else
%>
<metahttp-equiv="refresh"content="0;url=makehtmlall.asp?type=<%=request("type")%>&newcount=<%=request("newcount")%>&selyear=<%=request("selyear")%>&selmonth=<%=request("selmonth")%>&selday=<%=request("selday")%>&shu=<%=Tshu%>&D=<%=D%>&p=<%=p+1%>">