<!--#include file="const.asp"-->
<!--#include file="../inc/common.asp"-->
<!--#include file="../../common/flash/morelist.asp"-->
<!--#include file="../inc/head.asp"-->
<%
Dim t,d,p,TakeCount,m_strNowTitle,iCount
Dim totalnumber,MaxHtmlListNum

MaxHtmlListNum=100

totalnumber=NewAsp.ChkNumeric(Request("totalnumber"))
t=NewAsp.ChkNumeric(Request("t"))
p=NewAsp.ChkNumeric(Request("p"))
If p=0 Then p=1
TakeCount=NewAsp.ChkNumeric(Request("TakeCount"))
d=Request("d")
If d="" Then d=Now()

IsNowOutputText = False

Call createdhtml()
NewAsp.PageEnd()

Sub createdhtml()
	Dim Rs,SQL,ii
	Dim m_strLinkUrl
	m_strLinkUrl=""
	Response.Flush
	
	Response.Write "<script>$('planmain').style.display='';</script>"
	Response.Write "<script>$('plantext').style.display='';</script>"
	MoreAction=t
	
	Select Case MoreAction
		Case 1	:	m_strNowTitle="最新推荐"
			Call createdMorelist()
		Case 2	:	m_strNowTitle="热门排行"
			Call createdMorelist()
		Case 3	:	m_strNowTitle="字母检索"
			Call createdABClist()
		Case 4
			Response.Write "<script>"
			Response.Write "planpercent('100%');"
			Response.Write "planwidth(500);"
			Response.Write "</script>" & vbCrLf
			Response.Flush
	Case Else
		m_strNowTitle="最近更新"
		Call createdMorelist()
	End Select
	
	t=t+1
	m_strLinkUrl="admin_makemore.asp?ChannelID="&ChannelID&"&totalnumber="&totalnumber&"&d="&d&"&t="&t&"&p="&p&"&TakeCount="&TakeCount&m_strLinkUrl
	If t<5 Then
		Response.Write "<meta http-equiv=""refresh"" content=""0;url='"&m_strLinkUrl&"''"">"
	End If

	If IsObject(TPL_XmlDom) Then Set TPL_XmlDom=Nothing
End Sub

Sub createdABClist()
	Dim AbcListArry,iABC
	TakeCount=0:pagenow=1
	AbcListArry=Array("A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","A-Z","B-Z","C-Z","D-Z","E-Z","F-Z","G-Z","H-Z","J-Z","K-Z","L-Z","M-Z","N-Z","O-Z","P-Z","Q-Z","R-Z","S-Z","T-Z","W-Z","X-Z","Y-Z","Z-Z","0-9","A-9")
	totalnumber=UBound(AbcListArry)+1
	For iABC=0 To UBound(AbcListArry)
		If Not Response.IsClientConnected Then Response.End
		TakeCount=TakeCount+1
		iCount=iCount+1
		m_strABC=AbcListArry(iABC)
		Call BeginCreated()
		Response.Write "<script>"
		Response.Write "plantext("&totalnumber&","&TakeCount&",'" & ElapsedTime() & "','"&m_strNowTitle&" - "&HtmlFileName&"');"
		Response.Write "planpercent('" & FormatPercent(TakeCount/totalnumber,2,-1) & "');"
		Response.Write "planwidth("&Fix((TakeCount/totalnumber) * 500)&");"
		Response.Write "</script>" & vbCrLf
		Response.Flush
	Next
	p=1
End Sub

Sub createdMorelist()
	pagenow=1:TakeCount=0
	TakeCount=TakeCount+1
	Call BeginCreated()
	totalnumber=totalrec
	Response.Write "<script>"
	Response.Write "plantext("&totalnumber&","&TakeCount&",'" & ElapsedTime() & "','"&m_strNowTitle&" - "&HtmlFileName&"');"
	If totalnumber<1 Then
		Response.Write "planpercent('100%');"
		Response.Write "planwidth(500);"
	Else
	Response.Write "planpercent('" & FormatPercent(TakeCount/totalnumber,2,-1) & "');"
	Response.Write "planwidth("&Fix((TakeCount/totalnumber) * 500)&");"
	End If
	Response.Write "</script>" & vbCrLf
	Response.Flush
	If BuildHtmlDone=0 And Pcount>1 Then
		For pagenow=2 To Pcount
			If Not Response.IsClientConnected Then Response.End
			TakeCount=TakeCount+1
			iCount=iCount+1
			Call BeginCreated()
			Response.Write "<script>"
			Response.Write "plantext("&totalnumber&","&TakeCount&",'" & ElapsedTime() & "','"&m_strNowTitle&" - "&HtmlFileName&"');"
			Response.Write "planpercent('" & FormatPercent(TakeCount/totalnumber,2,-1) & "');"
			Response.Write "planwidth("&Fix((TakeCount/totalnumber) * 500)&");"
			Response.Write "</script>" & vbCrLf
			Response.Flush
		Next
		p=1
	Else
		p=1
	End If
End Sub

Function ElapsedTime()
	Dim ElapsedSeconds
	ElapsedSeconds=DateDiff("s", d, Now())
	If ElapsedSeconds > 3600 then
		ElapsedTime = ElapsedSeconds \ 3600 & " 时 " & (ElapsedSeconds mod 3600) \ 60 & " 分 " & ElapsedSeconds mod 60 & " 秒"
	ElseIf ElapsedSeconds > 60 then
		ElapsedTime = ElapsedSeconds \ 60 & " 分 " & ElapsedSeconds mod 60 & " 秒"
	Else
		ElapsedTime = ElapsedSeconds mod 60 & " 秒"
	End If
End Function

Sub BeginCreated()
	Call Main()
	HtmlFilePath=NewAsp.CheckHtmlFilePath(HtmlFileName)
	NewAsp.CreatPathEx HtmlFilePath
	NewAsp.CreatedTextFile HtmlFileName,TPL_Memory
	TPL_Memory="":iScanCount=0
End Sub
%>