<!--#include file="../siteconfig/conn.asp"-->
<!--#include file="LabelHtml.asp"-->
<%
if session("adminlogin")<>sessionvar then
Response.Write("<script language=javascript>alert('你尚未登录，或者超时了！请重新登录');this.location.href='login.asp';</script>")
Response.End
End if
set rs=server.createobject("adodb.recordset")
set rss=server.createobject("adodb.recordset")
%>
<HTML>
<HEAD>
<TITLE>分类管理</TITLE>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312"> 
<LINK REL="stylesheet" HREF="css.css" TYPE="text/css">
</HEAD>
<script language="JavaScript" type="text/javascript" src="js.js"></script>
<BODY>
<%dim Skin_Id,strOut,Skin_Html,fldr,Skin_Name
Skin_Id=Request("Skin_Id")
Menu=Request("Menu")
if Skin_Id<>"" then
rs.open"select Skin_Skin,Skin_Html,Skin_Name from Skin where Skin_Id="&Skin_Id,conn,1,3
   if not rs.eof then
      strOut=rs("Skin_Skin")
	  Skin_Html=rs("Skin_Html")
	  Skin_Name=rs("Skin_Name")
   else
      Response.Write("<script language=javascript>alert('没有找到模板');DivOpenClose('',2,0,0);</script>")
      Response.End()
   end if
   rs.close
rs.open"select IndexAd_Label,IndexAd_Html from IndexAd",conn,1,3
while not rs.eof
   strOut=Replace(strOut,rs("IndexAd_Label")&"ed$",Server.URLEncode(rs("IndexAd_Html")))
   strOut=Replace(strOut,rs("IndexAd_Label"),rs("IndexAd_Html"))
rs.movenext
wend
rs.close
   strOut=Replace(strOut,"$Skin_Name$",Skin_Name)
   Dim fso,f
   Call SiteLable()
    Set fso=Server.CreateObject("Scripting.FileSystemObject") 
    fldr = ""
    GetNewsFold = Split(Skin_Html, "/")
    For f = 0 To UBound(GetNewsFold)-1
	if fldr="" then
		fldr=GetNewsFold(f)
	else
		fldr=fldr&"\"&GetNewsFold(f)
	end if
        If IsFolder(fldr)=false then
            CreateFolder "../"&fldr
        End If
    Next
	

   Set f=fso.CreateTextFile(Server.MapPath(Site_Div&Skin_Html&".html"),true)
   f.WriteLine strOut
   f.close
   Set f=Nothing
   Set fso=Nothing
   Response.Write("<script language=javascript>alert('生成成功');parent.window.location.reload();DivOpenClose('',2,0,0);</script>")
end if
%>
</BODY>
</HTML>

