<!--#include file="const.asp"-->
<%
Server.ScriptTimeout = 99999
Admin_header
'=====================================================================
' 软件名称：新云网站管理系统
' 当前版本：NewAsp Content Management System Version 4.0
' 文件名称：admin_makehtml.asp
' 更新日期：2008-07-16
' 官方网站：新云网络(www.newasp.net www.newasp.cn) QQ：94022511
'=====================================================================
' Copyright 2003-2008 newasp.net - All Rights Reserved.
' newasp is a trademark of newasp.net
'=====================================================================
%>
<table class="table1" cellspacing="1" cellpadding="3" align="center" border="0">
	<tr>
		<td class="tableline linetitle" width="200" align="left">批量生成HTML</td>
		<td class="tableline" width="*" align="right"><a href="admin_index.asp">管理首页</a>
			 - <a href="admin_makehtml.asp?ChannelID=<%=ChannelID%>">生成HTML管理</a>
			 - <a href="admin_list.asp?ChannelID=<%=ChannelID%>"><%=NewAsp.ModuleName%>管理</a>
			 - <a href="../sys/admin_channel.asp?action=edit&ChannelID=<%=ChannelID%>">频道设置</a>
			 - <a href="../sys/admin_class.asp?ChannelID=<%=ChannelID%>">分类管理</a>
			 - <a href="../sys/admin_template.asp">模板管理</a>
		</td>
	</tr>
</table>
<%
Dim Action
If Not ChkAdmin("CreateHtml_"&ChannelID) Then
	Call Transfer_error()
End If
Action = LCase(Request("action"))
Select Case Trim(Action)
	Case "state"	:	Call UpdateState()
	Case Else
		Call showmain
End Select
If FoundErr = True Then
	ReturnError(ErrMsg)
End If
Admin_footer
SaveLogInfo(AdminName)
NewAsp.PageEnd

Sub PlanbarCodes()
	Response.Write "	<div style=""display:none;"" id=""planmain"">" & vbCrLf
	Response.Write "		<div id=""planbartext"">进度</div>" & vbCrLf
	Response.Write "		<div class=""planbar""><div id=""ProgressBar""></div></div>" & vbCrLf
	Response.Write "		<div id=""PercentText"">0%</div>" & vbCrLf
	Response.Write "	</div>" & vbCrLf
	Response.Write "	<div class=""plantext"" id=""plantext""></div>" & vbCrLf
End Sub

Sub showmain()
	Dim i,softidlist
	If Request("softid")<>"" Then
		softidlist=NewAsp.CheckIDlist(Request("softid"))
	Else
		softidlist="0"
	End If
	If softidlist="0" Then softidlist=""
%>

<table id="tablehovered1" border="0" align="center" cellpadding="3" cellspacing="1" class="tableborder">
<tr>
	<th colspan="2">批量生成<%=NewAsp.ModuleName%>HTML</th>
</tr>
<tr>
	<td class="tablerow1" width="28%" align="right"><u>生成<%=NewAsp.ModuleName%>分类列表页的HTML</u>：</td>
	<td class="tablerow1" width="72%"><form name="createForm1" method="post" action="admin_makelist.asp" target="_blankframe">
		<input type="hidden" name="ChannelID" value="<%=ChannelID%>" />
		<input type="radio" name="maketype" value="1" checked="checked"/> 生成已更新&nbsp;
		<input type="radio" name="maketype" value="0"/> 生成所有&nbsp;
		<input type="submit" name="submit_button" class="button" value="开始生成HTML"/>&nbsp;
		<select name="order" size="1">
			<option value="0" selected="selected">按时间排序生成HTML</option>
			<option value="1">按ID排序生成HTML</option>
			<option value="2">按点击排序生成HTML</option>
			<option value="3">按大小排序生成HTML</option>
		</select>
		</form>
	</td>
</tr>
<tr>
	<td colspan="2" class="tablerow2"><%
	Call PlanbarCodes
	%>
	<iframe style="display:;width:100%;height:55px;" frameborder="0" src="../script/blank.html" name="_blankframe" allowTransparency="true"></iframe></td>
</tr>
<tr>
	<td class="tablerow1" align="right"><u>生成<%=NewAsp.ModuleName%>信息页的HTML</u>：</td>
	<td class="tablerow1"><form name="createForm2" method="get" action="admin_makeshow.asp" target="_blankframe">
		<input type="hidden" name="ChannelID" value="<%=ChannelID%>" />
		<input type="hidden" name="t" value="0" />
		<input type="radio" name="maketype" value="1" checked="checked"/> 生成已更新&nbsp;
		<input type="radio" name="maketype" value="0"/> 生成所有&nbsp;
		<input type="submit" name="submit_button" class="button" value="开始生成HTML"/>
		<input type="button" name="stop_button" onclick="_blankframe.location.href='../script/blank.html'" class="button" value="停止生成HTML"/>
		</form>
	</td>
</tr>
<tr>
	<td class="tablerow2" align="right"><u>按日期生成<%=NewAsp.ModuleName%>信息页的HTML</u>：</td>
	<td class="tablerow2"><form name="createForm3" method="get" action="admin_makeshow.asp" target="_blankframe">
		<input type="hidden" name="ChannelID" value="<%=ChannelID%>" />
		<input type="hidden" name="t" value="1" />
	<%
	Response.Write " <select size=""1"" name=""datYear"">"
	For i = 2001 To Year(Date)
		Response.Write "<option value=""" & i & """"
		If i = Year(Date) Then
			Response.Write " selected"
		End If
		Response.Write ">" & i & "</option>"
	Next
	Response.Write " </select> - "
	Response.Write " <select size=""1"" name=""datMonth"">"
	For i = 1 To 12
		Response.Write "<option value=""" & i & """"
		If i = Month(Date) Then
			Response.Write " selected"
		End If
		Response.Write ">" & i & "</option>"
	Next
	Response.Write " </select> - "
	Response.Write " <select size=""1"" name=""datDay"">"
	For i = 1 To 31
		Response.Write "<option value=""" & i & """"
		If i = Day(Date) Then
			Response.Write " selected"
		End If
		Response.Write ">" & i & "</option>"
	Next
	Response.Write " </select>"
		%>
		<input type="submit" name="submit_button" class="button" value="开始生成HTML"/>
		</form>
	</td>
</tr>
<tr>
	<td class="tablerow1" align="right"><u>按ID生成<%=NewAsp.ModuleName%>信息页的HTML</u>：</td>
	<td class="tablerow1"><form name="createForm4" method="get" action="admin_makeshow.asp" target="_blankframe">
		<input type="hidden" name="ChannelID" value="<%=ChannelID%>" />
		<input type="hidden" name="t" value="2" />
		<input type="text" size="25" name="insoftid" value="<%=softidlist%>">
		<input type="submit" name="submit_button" class="button" value="开始生成HTML"/> 多个ID请用“,”英文逗号分开
		</form>
	</td>
</tr>
<%If softidlist<>"" Then%>
<script type="text/javascript">
<!--
	document.createForm4.submit();
//-->
</script>
<%End If%>
<tr>
	<td class="tablerow2" align="right"><u>设置<%=NewAsp.ModuleName%>更新状态</u>：</td>
	<td class="tablerow2"><form name="createForm5" method="post" action="?action=state" target="_blankframe">
		<input type="hidden" name="ChannelID" value="<%=ChannelID%>" />
		<input type="submit" name="submit_button" class="button" value="设置更新状态"/>
		<input type="radio" name="stype" value="1" checked="checked"/> 全部设为已更新状态
		<input type="radio" name="stype" value="0"/> 全部设为未更新状态
		</form>
	</td>
</tr>
<tr>
	<td colspan="2" class="tablerow1">生成其它相关HTML&nbsp;</td>
</tr>
<tr>
	<td colspan="2" class="tablerow2"><form name="morelistForm" method="post" action="" target="_blankframe">
		<input type="hidden" name="ChannelID" value="<%=ChannelID%>" />
		<input type="submit" onclick="document.morelistForm.action='admin_makeindex.asp';" name="submit_button1" class="button" value="生成首页HTML"/>
		<input type="submit" onclick="document.morelistForm.action='admin_makespecial.asp';" name="submit_button3" class="button" value="生成专题HTML"/>
		<input type="submit" onclick="document.morelistForm.action='admin_makemore.asp';" name="submit_button2" class="button" value="生成其它HTML"/>
		<input type="button" name="stop_button" onclick="_blankframe.location.href='../script/blank.html'" class="button" value="停止生成HTML"/>
		</form>
	</td>
</tr>
<tr>
	<td colspan="2" class="tablerow1">按分类生成相关HTML&nbsp;[请按 CTRL 键多选]</td>
</tr>
<form name="createForm6" method="get" action="" target="_blankframe">
<tr>
	<td class="tablerow2" align="right">
	<input type="hidden" name="ChannelID" value="<%=ChannelID%>" />
	<input type="hidden" name="t" value="3" />
	<select name="inclassid" size="2" multiple style="height:260px;width:200px;">
	<%
	Call selectClasslist(ChannelID,-1)
	%></select></td>
	<td class="tablerow2"><input type="submit" onclick="document.createForm6.action='admin_makelist.asp';" name="submit_button" class="button" value="生成分类列表页HTML"/><br/><br/>
	<input type="submit" onclick="document.createForm6.action='admin_makeshow.asp';" name="submit_button2" class="button" value="生成<%=NewAsp.ModuleName%>信息页HTML"/><br/><br/>
	<input type="button" name="stop_button" onclick="_blankframe.location.href='../script/blank.html'" class="button" value="停止正在生成的HTML"/><br/><br/>
	<select name="order" size="1">
		<option value="0" selected="selected">按时间排序生成HTML</option>
		<option value="1">按ID排序生成HTML</option>
		<option value="2">按点击排序生成HTML</option>
		<option value="3">按大小排序生成HTML</option>
	</select>
	</td>
</tr>
</form>
<tr>
	<td class="tablerow1" align="right"><u>生成GOOGLE站点地图</u>：</td>
	<td class="tablerow1"><form name="sitemapForm" method="post" action="admin_makesitemap.asp?action=sitemap">
		<input type="hidden" name="ChannelID" value="<%=ChannelID%>" />
		地图路径：<input type="text" size="30" name="sitemapPath" value="<%=NewAsp.ChannelDest%>sitemap.xml">
		地图数：<input type="text" size="10" name="sitemapnum" value="10000" maxlength="5">
		<input type="submit" name="submit_button" class="button" value="开始生成地图"/>
		</form>
	</td>
</tr>
<tr>
	<td colspan="2" class="tablerow2"><ol>
		<li>生成HTML前，请在频道管理中打开生成HTML功能；生成HTML的时候，请不要刷新或离开本页面。</li>
		<li>什么是已更新？当你添加或者编辑一个软件时，那么这个软件的状态就是已更新。</li>
		<li>如果你生成所有HTML，遇到意外停止后，下次生成时请选择“生成已更新”，就不会重复生成。</li>
		<li>生成其它HTML，包括最近更新、推荐、热门、字母检索等HTML页面。</li>
		<li>有关 Google 向网站管理员提供的网站地图详情，请访问 <a href="http://www.google.com/webmasters/" target="_blank">Google 网站管理员中心</a>。</li>
	</ol></td>
</tr>
</table>
<%
End Sub

Sub UpdateState()
	Dim sType
	sType=NewAsp.ChkNumeric(Request("stype"))
	If sType=0 Then
		NewAsp.Execute ("UPDATE NC_SoftList SET isUpdate=0 WHERE isAccept>0 And ChannelID="&ChannelID)
	Else
		NewAsp.Execute ("UPDATE NC_SoftList SET isUpdate=1 WHERE isAccept>0 And ChannelID="&ChannelID)
	End If
	Response.Redirect (Request.ServerVariables("HTTP_REFERER"))
End Sub

%>
