<!--#include file="../ACT.Function.asp"-->
<!--#include file="../../Inc/Function.asp"-->
<!--#include file="../../Inc/ArticleChannel.asp"-->
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<link href="../Images/<%=session("css")%>/css.css" rel="stylesheet" type="text/css">
<%

Dim CmsMake,RefreshFlag,urls,title,ts,FsoHtmlTF
Set Cmsmake =New Cls_MakeHtml
Dim ID,RsSql,Rs,ClassID,FileName,SaveArticlePath
ID = ChkNumeric(Request("ID"))
Select Case Request.QueryString("RefreshFlag")

	Case "ID"
		response.write MakeArticle()

End Select 

Function MakeArticle()
FsoHtmlTF=Conn.Execute("Select FsoHtmlTF From Channel_Act Where ChannelID=1")(0)
	If ID > 0 Then
	RefreshFlag=Conn.Execute("Select RefreshFlag From Channel_Act Where ChannelID=1")(0)
		RsSql = "Select top 1 * from Article_ACT Where ID="& ID &" Order By ID Desc"
		Set RS = Server.CreateObject("ADODB.RecordSet")
		RS.Open RsSql,Conn, 1, 1
If FsoHtmlTF = 1 Then 
			if RefreshFlag=2 then'栏目生成
			 Dim ObjRS,i:Set ObjRS=Server.CreateObject("Adodb.Recordset")
			 ObjRS.Open "Select navid From Class_ACT Where classid='" & rs("classid") &"'",Conn,1,1
			 If Not ObjRS.Eof Then
			  Dim FolderIDArr:FolderIDArr=Split(left(ObjRS(0),Len(ObjRS(0))-1),"/")
			  For I=0 To Ubound(FolderIDArr)
				response.Write "<div align=center><iframe src=""make1.Asp?ChannelID=1&Types=Folder&RefreshFlag=ID&CassID=" & FolderIDArr(i) &""" width=""0"" height=""0"" frameborder=""0""></iframe></div>"
				 Next
			 End If
			 ObjRS.Close:Set ObjRS=Nothing
			ts=ts&"相关栏目已生成成功<br>"
			end if
			If RS.EOF And RS.BOF Then
			Else
			CmsMake.ArticleContent(rs)
			ts="内容页已生成成功<br>"&ts
			FileName = Rs("FileName")
			SaveArticlePath = Rs("SaveArticlePath")
			ClassID = Rs("ClassID")
			title=rs("title")
			End if
			RsSql = "Select top 1 * from class_ACT Where ClassID='"& classID &"' Order By ID Desc"
			Set RS = Server.CreateObject("ADODB.RecordSet")
			RS.Open RsSql,Conn, 1, 1
			if RefreshFlag=>3 Then
			response.Write "<div align=center><iframe src=""MakeIndex.asp"" width=""0"" height=""0"" frameborder=""0""></iframe></div>"
			ts=ts&"首页已生成成功"
			End If 
			urls="<a target=""_blank"" href="&ClsMain.MainURL&ClsMain.ArticleDir&rs("ClassEName")&SaveArticlePath&FileName&">"&ClsMain.MainURL&ClsMain.ArticleDir&rs("ClassEName")&SaveArticlePath&FileName&"</a>"
			
		Else
			title=rs("title")
			urls="<a target=""_blank"" href="&ClsMain.MainURL&"Article/ShowInfo.asp?ID="&rs("id")&">"&ClsMain.MainURL&"Article/ShowInfo.asp?ID="&rs("id")&"</a>"
			ts="由于文章中心没有启用生成HTML的功能,所以ID号为 <font color=red>" & ID & "</font>  的文章没有生成"
		End If 
	End If
	'RS.Close:Set RS=Nothing
End Function

%>
<table width="98%" border="0" align="center" cellpadding="2" cellspacing="1" class="table">
  <tr>
    <td colspan="2" align="center" class="bg_tr"><strong>添加文章成功</strong></td>
  </tr>
  <tr>
    <td width="100" class="td_bg">文章标题:</td>
    <td class="td_bg"><%=title%></td>
  </tr>
  <tr>
    <td class="td_bg">文章地址:</td>
    <td class="td_bg"><%=urls%></td>
  </tr>
  <tr>
    <td class="td_bg">提示:</td>
    <td class="td_bg"><%=ts%></td>
  </tr></table>
