📄 html_makeclass.asp
字号:
<!--#include file="conn.asp"-->
<%
If Request("Page")<>"" Then
If Cint(Request("Page"))<1 Then
CurrentPage=1
Else
CurrentPage=Cint(Request("Page"))
End If
End If
set rs=server.createobject("adodb.recordset")
rs.open ("select list from mb"),conn,1,1
pencat=rs("list")
rs.close
if request("nclass")<>"" then
Sql="Select * From class where ID="&Request("nclass")
Set Rs=Server.Createobject("Adodb.Recordset")
Rs.open Sql,Conn,1,1
classname=rs("name")
Rs.Close
Set Rs=nothing
Set Rsadd=Server.Createobject("Adodb.Recordset")
Sql="Select * From Class where classid='0'"
Rsadd.open Sql,Conn,1,3
id=rsadd("id")
top=top&"<td align=center class=a2><a class=m href=../index.html target=_blank>首页</a></td>"
Do While not Rsadd.Eof
top=top&"<td id="&rsadd("id")&" class=a2 height=25 align=center><a class=m href="&rsadd("id")&"_1.htm>"&rsadd("name")&"</a></td>"
Rsadd.Movenext
Loop
Rsadd.Close
Set Rsadd=nothing
top=replace(top,"<td id="&request("nclass")&" class=a2 height=25 align=center><a class=m","<td class=a1 height=25 align=center><a class=u")
'-------------------------------top2开始>>
top2=top2&"<table align=center border=0 cellpadding=2 cellspacing=1 style=border-collapse: collapse width=760 class=p1>"
set rs_list=server.CreateObject("ADODB.RecordSet")
rs_list.open "select * from class where classid='"&request("nclass")&"' order by id asc",conn,1,1
if NOT rs_list.EOF then
top2=top2&"<tr>"
do while not rs_list.eof
i=1
Do While i<=9
top2=top2&"<td height=25 width=11% bgcolor=#ffffff align=center><a href="&rs_list("id")&"_1.htm>"&rs_list("name")&"</a></td>"
i=i+1
rs_list.MoveNext
if rs_list.eof then
exit do
end if
loop
for l=0 to 10-i
top2=top2&"<td width=""11%"" bgcolor=#ffffff align=""center""> </td>"
next
top2=top2&"</tr>"
loop
end if
rs_list.close
top2=top2&"</table>"
'------------------top2结束
Set Rs=Server.Createobject("Adodb.Recordset")
Sql="Select * From flash where nclass='"&request("nclass")&"' order by hits desc"
Rs.open Sql,Conn,1,3
i=0
Do While not Rs.Eof
i=i+1
top15=top15&"<tr><td height=""25"" class=""table1""> <a href=../flash/"&rs("id")&".htm target=_blank>"&rs("flashname")&"("&rs("hits")&")</a></td></tr>"
if i>=35 then exit do
rs.movenext
loop
rs.close
set rs=nothing
Set Rs=Server.Createobject("Adodb.Recordset")
Sql="Select * From flash where nclass='"&request("nclass")&"' order by id desc"
Rs.open Sql,Conn,1,3
i=0
Do While not Rs.Eof
i=i+1
tj15=tj15&"<tr><td height=""25"" class=""table1""> "&rs("flashname")&"("&rs("hits")&")</td></tr>"
if i>=15 then exit do
rs.movenext
loop
rs.close
set rs=nothing
else
response.write "类别为空,请选择类别再生成"
response.end
end if
'------------------------------------flash界面
Set Rs=Server.Createobject("Adodb.Recordset")
Rs.open("Select * From flash where nclass='"&request("nclass")&"' order by id Desc"),Conn,1,1
If Rs.Eof And Rs.bof Then
body=body&"<tr><td width='100%'><p align=center>没有找到任何flash</td></tr>"
PageCount1=1
Totalnumber=0
Else
Maxperpage=30
Rs.Pagesize=MaxperPage
PageCount1=Rs.PageCount
Rs.Move (CurrentPage-1)*MaxperPage
Totalnumber=Rs.RecordCount
N=0
'分页程序
plist_bottom=plist_bottom&"<table width=""100%"" border=""0"" align=""center"" cellpadding=""2"" cellspacing=""0"">"
plist_bottom=plist_bottom&"<TBODY>"
plist_bottom=plist_bottom&"<TR align=""center"">"
plist_bottom=plist_bottom&"<td><p style=""margin-top: 2"">本类"&Totalnumber&"个 "
plist_bottom=plist_bottom&"[第"&CurrentPage&"页/共"&PageCount1&"页] "
Pageno=CurrentPage
If cint(Pageno)>1 Then
plist_bottom=plist_bottom&"<a href="&Request("nclass")&"_1.htm title=""首页"">"
End If
plist_bottom=plist_bottom&"[首页]</a> "
If Cint(Pageno)>1 Then
plist_bottom=plist_bottom&"<a href="&Request("nclass")&"_"&Pageno-1&".htm title=""上一页"">"
End If
plist_bottom=plist_bottom&"[上一页]</a> "
If Cint(Pageno)< PageCount1 Then
plist_bottom=plist_bottom&"<a href="&request("nclass")&"_"&Pageno+1&".htm title=""下一页"">"
End If
plist_bottom=plist_bottom&"[下一页]</a> "
If Cint(Pageno)< Pagecount1 Then
plist_bottom=plist_bottom&"<a href="&Request("nclass")&"_"&PageCount1&".htm title=""尾页"">"
End If
plist_bottom=plist_bottom&"[尾页]</a> "
plist_bottom=plist_bottom&"跳到 <select name=""select"" onchange=""javascript:window.location.href=this.options[this.selectedIndex].value"">"
For I=1 to PageCount1
Selected=""
If Currentpage=I Then
Selected=" Selected"
End If
plist_bottom=plist_bottom&"<option value="&Request("nclass")&"_"&I&".htm"&Selected&">第"&I&"页</option>"
Next
plist_bottom=plist_bottom&"</select></td></TR></TBODY></TABLE>"
'主页面
Row_Count=1
N_line = 3 '''设置每行显示列的数目
iPage=0
body=body&"<table border=""0"" cellspacing=""0"" cellpadding=""0""><tr>"
do while not rs.eof
N=N+1
Name=Rs("nclass")
Total=Rs.RecordCount
iPage=ipage+1
if ipage mod 2 = 0 then
trcolor = "#ffffff"
else
trcolor = "#ffffff"
end if
if (iPage-N_line-1) mod N_line= 0 then '''判断是否换行
body=body&"</tr></table><br><table bgcolor="&trcolor&" border=""0"" cellpadding=""0"" cellspacing=""0""><tr>"
end if
body=body&"<td>"
body=body&"<table width=""180"" height=""25"" border=""0"" cellpadding=""0"" cellspacing=""0""><tr>"
body=body&"<td align=center><A href=""../flash/"&Rs("ID")&".htm"" target=_blank><img src="&Rs("pic")&" alt="&Rs("flashname")&" width=120 height=70 border=""0"" style=""border:1px solid #676F72;""></a></td></tr>"
body=body&"<tr><td align=center height=25><A href=""../flash/"&Rs("ID")&".htm"" target=_blank><b><font color=red>"&left(Rs("flashname"),8)&"</font></b></a></td></tr>"
body=body&"<tr><td align=center>类型:"&Rs("classname")&"</td>"
body=body&"</tr></table>"
body=body&"</td>"
If Row_Count Mod 2 =0 Then
End If
Row_Count=Row_Count+1
If N>=MaxPerPage Then Exit do
Rs.Movenext
Loop
body=body&"</tr></table>"
Rs.Close
End If
pencat=replace(pencat,"<!top1!>",top)
pencat=replace(pencat,"<!top15!>",top15)
pencat=replace(pencat,"<!tj15!>",tj15)
pencat=replace(pencat,"<!classname!>",classname)
pencat=replace(pencat,"<!top2!>",top2)
pencat=replace(pencat,"<!body!>",body)
pencat=replace(pencat,"<!plist_bottom!>",plist_bottom)
Set fso = Server.CreateObject("Scripting.FileSystemObject")
Set fout = fso.CreateTextFile(server.mappath("../class/"&request("nclass")&"_"&CurrentPage&".htm"))
fout.Write pencat
fout.close
If CurrentPage<PageCount1 Then
Response.Write "·<b>生成第 <font color=#FF0000> "&CurrentPage&" </font> 页</b><br>·<b>共有 <font color=#FF0000>"&PageCount1&"</font> 页</b>"
Response.Write "<Meta http-equiv=Refresh content='0; URL=Html_MakeClass.asp?nclass="&Request("nclass")&"&page="&Cint(CurrentPage+1)&"'>"
End If
If CurrentPage=PageCount1 Then
Response.Write "<body>"
Response.Write "<p><br>"
Response.Write "·<b>成功:生成 <font color=""#FF0000"">"&CurrentPage&"</font> 页</b><br>"
Response.Write "·此类共有 <font color=""#ff0000"">"&PageCount1&"</font> 页,自动关闭窗口!"
Response.Write "<script LANGUAGE=""JavaScript"">"
Response.Write "<!--"
Response.Write "setTimeout('window.close();', 100);"
Response.Write "// -->"
Response.Write "</script>"
Response.Write "</p>"
Response.Write "</body>"
End If
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -