<!--#include file="articleconn.asp"-->
<%
IF Session("KEY")<>"super"THEN
response.redirect "mymanage.asp"
response.end
END IF
TypeItem=request("ItemName")
set rs=server.CreateObject("Adodb.Recordset")
sql="select * from type where typename='"&TypeItem&"'"
rs.open sql,conn,1,1
Type_Fold=rs("typename")
Type_Name=rs("type")
Type_index=rs("TypeIndex")
if rs.eof then
Response.Write("没有此栏目")
else
set rs_up=server.CreateObject("Adodb.recordset")
sql_up="select * from type"
rs_up.open sql_up,conn,1,1
i=1
do while not rs_up.eof
Menu=Menu&"<a href=../"&rs_up("typename")&"/"&rs_up("typeindex")&">"&rs_up("type")&"</a><font color='#0099FF'><b>—</b></font>"
i=i+1
rs_up.movenext
loop
rs.close
rs_up.close
TypeContent_sql="select * from article where typename='"&Type_Name&"'"
rs.open TypeContent_sql,conn,1,1
if rs.eof then
TypeContent=TypeContent&"此栏目暂时没有任何内容"
else
const MaxPerPage=3
rs.pagesize=MaxPerPage
CurrentPage=request("PageNo")
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
if not isnumeric(CurrentPage) then
CurrentPage=1
end if
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
TypeContent=TypeContent&"<table width='100%' border='0' cellspacing='0' cellpadding='0'>"
TypeContent=TypeContent&"<tr bgcolor='#009933'><td width='65%'>标题:</td>"
TypeContent=TypeContent&"<td width='25%' align='center'>日期:</td>"
TypeContent=TypeContent&"<td width='10%' align='center'>点击:</td></tr>"
TypeContent=TypeContent&""
for i=1 to rs.pagesize
if rs.eof then
Exit for
end if
TypeContent=TypeContent&"<tr><td><a href=../"&rs("path")&"/"&rs("N_fname")&">"&rs("title")&"</a></td>"
TypeContent=TypeContent&"<td align='center'>"&rs("dateandtime")&"</td>"
TypeContent=TypeContent&"<td align='center'><script language='javascript' src='../hits.asp?newsid="&rs("newsid")&"'></script></td></tr>"
rs.movenext
next
rs.close
set rs=nothing
conn.close
set conn=nothing
TypeContent=TypeContent&"</table>"
PageLoad=PageLoad&"<form name='form1'>"
PageLoad=PageLoad&" 页数<font color=red><b>"¤tpage&"</b></font>/"&n&" "
k=currentpage
if k<>1 then
PageLoad=PageLoad&"<In"&"dex.html>首页</a> "
if k=2 then
PageLoad=PageLoad&"<a href=In"&"dex.html>上一页</a> "
else
PageLoad=PageLoad&"<a href="&Type_Fold&"_"&k-1&".htm>上一页</a> "
end if
else
PageLoad=PageLoad&"首页 上一页 "
end if
if k<>n then
PageLoad=PageLoad&"<a href="&Type_Fold&"_"&k+1&".htm>下一页</a> "
PageLoad=PageLoad&"<a href="&Type_Fold&"_"&n&".htm>尾页</a> "
else
PageLoad=PageLoad&"下一页 尾页 "
end if
PageLoad=PageLoad&"共有<font color=blue><b>"&totalput&"</b></font>篇文章"
PageLoad=PageLoad&"<select name='menu1' onChange=MM_jumpMenu('parent',this,0)>"
for i=1 to n
if i=1 then
PageLoad=PageLoad&"<option value=In"&"dex.html"
else
PageLoad=PageLoad&"<option value="&Type_Fold&"_"&i&".htm "
end if
if cint(i)=cint(currentpage) then PageLoad=PageLoad& " selected"
PageLoad=PageLoad&">第"&i&"页</option>"
next
PageLoad=PageLoad&"</select></form>"
end if
Set fso = Server.CreateObject("Scripting.FileSystemObject")
set type_d = fso.opentextfile(server.mappath("Admin/more.html"),1,True)
pencat= type_d.ReadAll
pencat=replace(pencat,"$Menu$",Menu)
pencat=replace(pencat,"$TypeContent$",TypeContent)
pencat=replace(pencat,"$PageLoad$",PageLoad)
pencat=replace(pencat,"$TITLE$",Type_Name)
if CurrentPage<2 then
Set type_x = fso.CreateTextFile(server.mappath(Type_Fold&"/In"&"dex.html"),true)
else
Set type_x = fso.CreateTextFile(server.mappath(Type_Fold&"/"&Type_Fold&"_"¤tPage&".htm"),true)
end if
type_x.WriteLine (pencat)
set fso = nothing
type_d.close
type_x.close
response.write "<br>已生成/要生成分类:<font color=#FF0000>"¤tPage&"</font>/<font color=#FF0000><b>"&n&"</b></font>个,"
if n=<currentPage then
response.write "操作完成!"
response.Write("<a href='#' onclick=history.back()>返回</a>")
response.end
else
response.write "<br>已生成/此类分页:<font color=#FF0000>"¤tPage&"</font>/<font color=#FF0000><b>"&n&"</b></font>个,"
response.write "<meta http-equiv=Refresh content='0; URL=MakeHtml.asp?ItemName="&TypeItem&"&pageNo="¤tPage+1&"'>"
end if
end if
%>
这个绝对没问题我试过了。