<!--#include file="conn.asp"-->
<!--#include file="../../inc/function.asp"-->
<!--#include file="_html_fun.asp"-->
<!--#include file="../../../include/Lebi_Db_cls.asp"-->
<!--#include file="../../../include/lebi_cache_cls.asp"-->
<!--#include file="../../../include/lebi_cache.asp"-->
<!--#include file="_html_lang.asp"-->
<!--#include file="../../../include/lebi_main.asp"-->
<%
'**************************************
'* 最后更新 2012-05-20 by 56770.kingdge
'* copyright www.56770.com
'**************************************
server.scripttimeout =99999
html_page="1"
eshop_url = replace(eshop_url,"/tohtml/","/")
%>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<style type="text/css">
body{margin-top:0px;margin-left:0px;position:absolute;background-color:#ffffff;font-size:11px;}
td{font-size:11px;}
</style>
<body>
<!--#include file="../../include/lebi_function.asp"-->
<!--#include file="../../include/lebi_page_cls.asp"-->
<%
admin_flag=",12.6,"
if request.cookies(cookiesname)("admin_name")="" or instr(","&request.cookies(cookiesname)("flag")&",",admin_flag)=0 then
		response.write("没有操作此功能的权限！")
		response.end
end if
if show_html <> 1 then
		response.write("请先选择静态模式(HTML)！")
		response.end
end if
rem html_type 0全部 1新数据
c_id = clng(request("c_id"))
nextc_id = clng(request("nextc_id"))
thisc_id = clng(request("thisc_id"))
thisc_name = request("thisc_name")
stoptime=request("stoptime")
if not isnumeric(stoptime) then stoptime=3
s_text=loadfile("../../text/lebi_news"& LangTxt &".text")
sitename = trim(split(s_text,"$$$")(0))
description = trim(split(s_text,"$$$")(2))
keywords = trim(split(s_text,"$$$")(3))
showpath = "<a href='"& eshop_url & url_1 &"'>"& lebi_word(0) &"</a> → <a href='"& eshop_url & url_7 &"'>"& lebi_word(18) &"</a>"
skin_body = LoadFile("../../../skins/"& template &"/template/help_list.htm")
write_lebi_eshop("<div id=""table_sort"">")
write_lebi_eshop("<table width=""100%"" border=""0"" cellspacing=""1"" cellpadding=""1"">")
write_lebi_eshop("<tr><td colspan=""2"" id=""categoryname""></td></tr>")
write_lebi_eshop("<tr><td width=""60"">分页更新：</td>")
write_lebi_eshop("<td width=""300"" align=""left"">")
write_lebi_eshop("<table width=""300"" border=""0"" cellspacing=""1"" cellpadding=""1"" height=""8"" bgcolor=""#b2b2a6""><tr><td bgcolor=ffffff height=""8""><img src=""../../images/bar.gif"" width=0 height=8 id=bar_p_img name=bar_p_img align=absmiddle></td></tr></table></td>")
write_lebi_eshop("<td><span id=bar_p_txt2 name=bar_p_txt2 style=""font-size:9pt;color:red;""></span><span id=bar_p_txt1 name=bar_p_txt1 style=""font-size:9pt"">0</span><span style=""font-size:9pt"">%</span></td></tr></table></div>")
dim body_news_class
set fs=server.createobject("scripting.filesystemobject")
if fs.folderexists(server.mappath("../../"& LangPath & folder(1)))=false then
        fs.createfolder(server.mappath("../../"& LangPath & folder(1)))
end if
rem 取得数据库中最大的一条id
set rs = conn.execute("select top 1 smallclassid from [smallclass] where bigclassid="&thisc_id&" order by smallclassid desc")
lastnum = rs(0)
rs.close:set rs=nothing
set rs_list=server.createobject("adodb.recordset")
sql="select smallclassid,smallclassname from [smallclass] where 1=1"
if c_id<>0 then sql=sql&" and bigclassid="&c_id&" and smallclassid="&nextc_id&""
if c_id=0 then sql=sql&" and bigclassid="&thisc_id&" and smallclassid="&nextc_id&""
rs_list.open sql,conn,1,1
'response.write sql
if not rs_list.eof then
        classid = thisc_id
		s_classid = rs_list("smallclassid")
		smallclassname = rs_list("smallclassname")
        sql_i = "select id from [news] where smallclassid="&rs_list("smallclassid")&""
        sql_i = sql_i &" order by id desc"
        set rs_i = server.createobject("adodb.recordset")
        rs_i.open sql_i,conn,1,1
		rs_i.pagesize = top23
        if rs_i.eof then
                pagecounts = 1
        else
	            pagecounts = rs_i.pagecount
        end if
        for page = 1 to pagecounts
	            rem ----------------------------------------------------------------------------
		        write_lebi_eshop("<script>categoryname.innerHTML=""正在生成分类 "& bigclassname &" 静态页，请稍等..."";bar_p_img.width=" & fix((page/pagecounts) * 300) & ";")
		        write_lebi_eshop("bar_p_txt1.innerHTML=""当前分页数 " & page & " ，完成 " & formatnumber2(page/pagecounts*100) & """;")
		        write_lebi_eshop("bar_p_img.title=""成功生成分页数 (" & page & ") "";</script>")
		        response.flush
                %><!--#include file="../../include/item/item_news_class.asp"--><%
				HtmlName = "../../../"& LangPath & folder(1) & classid&"."& rs_list("smallclassid") &"."& page &"."& Sys_Ext
				savehtml HtmlName,html_splits(skin_body)
        		rem -----------------------------------------------------------------------------------------
        next
		if c_id <> 0 then
		        if clng(s_classid) >= clng(lastnum) then
        		        write_lebi_eshop("<table width=""100%"" border=""0"" cellspacing=""1"" cellpadding=""1"" class=""classlist""><tr><td height=30 class=classtd>·"& thisc_name &" 静态页生成完毕！</td></tr></table>")
				        write_lebi_eshop("<script>document.getElementById(""table_sort"").style.display=""none"";</script>")
				        response.end
				else
                        set rs = conn.execute("select top 1 smallclassid from [smallclass] where bigclassid="&thisc_id&" and smallclassid>"& s_classid &" order by smallclassid asc")
                        nextc_id = rs(0)
                        rs.close : set rs = nothing
				        write_lebi_eshop("<table width=""100%"" border=""0"" cellspacing=""1"" cellpadding=""1"" class=""classlist""><tr><td height=30 class=classtd>·缓解服务器压力，<font color=red><span id=""resettime"">0</span></font> 秒后生成任务继续执行...</td></tr></table>")
				        write_lebi_eshop("<script>document.getElementById(""table_sort"").style.display=""none"";</script>")
				        write_lebi_eshop("<script language=""javascript"">url=""?c_id="&c_id&"&nextc_id="&nextc_id&"&thisc_id="&thisc_id&"&thisc_name="&thisc_name&"&stoptime="&stoptime&""";if (!url){url=document.referrer}function countdown(secs){document.getElementById(""resettime"").innerHTML=secs;if(--secs>0) {settimeout(""countdown(""+secs+"")"",1000);}else {window.location.href=url;}}countdown("&stoptime&");</script>")
				end if
		end if
		if clng(s_classid) >= clng(lastnum) then
                set rs = server.createobject("adodb.recordset")
				rs.open "select top 1 bigclassid from [bigclass] where bigclassid > "& thisc_id &" order by bigclassid asc",conn,1,1
				if rs.eof then
				        bigclasscount = 0
				else
				        bigclasscount = 1
                        nextc_id = rs(0)
				end if
                rs.close : set rs = nothing
				if bigclasscount = 0 then
        		        write_lebi_eshop("<table width=""100%"" border=""0"" cellspacing=""1"" cellpadding=""1"" class=""classlist""><tr><td height=30 class=classtd>·全部分类生成完毕！</td></tr></table>")
				        write_lebi_eshop("<script>document.getElementById(""table_sort"").style.display=""none"";</script>")
				else
				        write_lebi_eshop("<table width=""100%"" border=""0"" cellspacing=""1"" cellpadding=""1"" class=""classlist""><tr><td height=30 class=classtd>·缓解服务器压力，<font color=red><span id=""resettime"">0</span></font> 秒后生成任务继续执行...</td></tr></table>")
				        write_lebi_eshop("<script>document.getElementById(""table_sort"").style.display=""none"";</script>")
				        write_lebi_eshop("<script language=""javascript"">url=""_html_news_class.asp?c_id="&c_id&"&nextc_id="&nextc_id&"&stoptime="&stoptime&""";if (!url){url=document.referrer}function countdown(secs){document.getElementById(""resettime"").innerHTML=secs;if(--secs>0) {settimeout(""countdown(""+secs+"")"",1000);}else {window.location.href=url;}}countdown("&stoptime&");</script>")
				end if
		else
                set rs = conn.execute("select top 1 smallclassid from [smallclass] where bigclassid="&thisc_id&" and smallclassid>"& s_classid &" order by smallclassid asc")
                nextc_id = rs(0)
                rs.close : set rs = nothing
				write_lebi_eshop("<table width=""100%"" border=""0"" cellspacing=""1"" cellpadding=""1"" class=""classlist""><tr><td height=30 class=classtd>·缓解服务器压力，<font color=red><span id=""resettime"">0</span></font> 秒后生成任务继续执行...</td></tr></table>")
				write_lebi_eshop("<script>document.getElementById(""table_sort"").style.display=""none"";</script>")
				write_lebi_eshop("<script language=""javascript"">url=""?c_id="&c_id&"&nextc_id="&nextc_id&"&thisc_id="&thisc_id&"&thisc_name="&thisc_name&"&stoptime="&stoptime&""";if (!url){url=document.referrer}function countdown(secs){document.getElementById(""resettime"").innerHTML=secs;if(--secs>0) {settimeout(""countdown(""+secs+"")"",1000);}else {window.location.href=url;}}countdown("&stoptime&");</script>")
		end if
end if
rs_list.close:set rs_list=nothing
write_lebi_eshop("<script>bar_p_img.width=300;bar_p_txt2.innerHTML='';bar_p_txt1.innerHTML=""100"";</script>")
%>
</body>
</html>