www.gusucode.com > 玩玩小游戏FLASH系统 2.1码程序 > admin/html_makeclass2.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("classid")<>"" then

Sql="Select * From class where ID="&Request("classid")
Set Rs=Server.Createobject("Adodb.Recordset")
Rs.open Sql,Conn,1,1
name=rs("name")
cc=rs("classid")
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="&cc&"  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=100% class=p1>"
set rs_list=server.CreateObject("ADODB.RecordSet")
                           rs_list.open "select * from class where classid='"&cc&"' 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=replace(top2,""&name&"","<font color=red>"&name&"</font>")

'------------------top2结束


Set Rs=Server.Createobject("Adodb.Recordset")
Sql="Select * From flash where classid='"&request("classid")&"' 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=""style7"">&nbsp;&nbsp;<a class=""style7"" href=../flash/"&rs("id")&".htm target=_blank>·"&rs("flashname")&"("&rs("hits")&")</a></td></tr>"
if i>=30 then exit do
rs.movenext
loop
rs.close
set rs=nothing

Set Rs=Server.Createobject("Adodb.Recordset")
Sql="Select * From flash where classid='"&request("classid")&"' 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"">&nbsp;&nbsp;&nbsp;"&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 classid='"&request("classid")&"' 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&"个FLASH&nbsp;"
plist_bottom=plist_bottom&"[第"&CurrentPage&"页/共"&PageCount1&"页]&nbsp;"
Pageno=CurrentPage
If cint(Pageno)>1 Then
plist_bottom=plist_bottom&"<a href="&Request("classid")&"_1.htm title=""首页"">"
End If
plist_bottom=plist_bottom&"[首页]</a>&nbsp;"
If Cint(Pageno)>1 Then
plist_bottom=plist_bottom&"<a href="&Request("classid")&"_"&Pageno-1&".htm title=""上一页"">"
End If
plist_bottom=plist_bottom&"[上一页]</a>&nbsp;"
If Cint(Pageno)< PageCount1 Then
plist_bottom=plist_bottom&"<a href="&request("classid")&"_"&Pageno+1&".htm title=""下一页"">"
End If
plist_bottom=plist_bottom&"[下一页]</a>&nbsp;"
If Cint(Pageno)< Pagecount1 Then
plist_bottom=plist_bottom&"<a href="&Request("classid")&"_"&PageCount1&".htm title=""尾页"">"
End If
plist_bottom=plist_bottom&"[尾页]</a>&nbsp;"
plist_bottom=plist_bottom&"跳到&nbsp;<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("classid")&"_"&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("classid")
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=""238"" height=""25"" border=""0"" cellpadding=""0"" cellspacing=""0""><tr>"
body=body&"<td align=center width=120 height=80><A href=""../flash/"&Rs("ID")&".htm""  target=_blank><img src="&Rs("pic")&" alt="&Rs("flashname")&" width=104 height=76 border=""0"" style=""border:1px solid #DFF2FF;""></a></td>"
body=body&"<td valign=bottom align=center height=50><div align=left>&nbsp;<A href=""../flash/"&Rs("ID")&".htm""  target=_blank><b><font color=#0C8FFF>"&left(Rs("flashname"),8)&"</font></b></a><br><br><div align=left><font color=#0099CC>&nbsp;类 型:</font><font color=#0099CC>"&Rs("classname")&"</font><br><font color=#999999>&nbsp;点 击:</font><font color=#FF0000>"&rs("hits")&"</font></td>"
body=body&"<tr><td align=center></td>"
body=body&"<tr>"
body=body&"<td colspan=2><hr style='BORDER-BOTTOM-STYLE: dotted; BORDER-LEFT-STYLE: dotted; BORDER-RIGHT-STYLE: dotted; BORDER-TOP-STYLE: dotted' color=#999999 size=1> </td>"
body=body&"</tr>"
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("classid")&"_"&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_MakeClass2.asp?classid="&Request("classid")&"&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
%>