<!-- #include file="Conn.asp" -->
<!--#include file="inc/cookies_check.asp"-->
<!--#include file="../include/Lebi_XML_Cls.asp"-->
<%
'*****************************************
'* 软件名称 乐彼网上开店软件(56770 EShop)
'* 软件开发 http://www.56770.com
'* 版权所有 http://www.56770.com
'* 文件名称 Admin_skin_load.asp
'* 最后更新 2012-07-02 by 56770.kingdge
'*****************************************
Dim admin_flag
admin_flag=",9.1,"
include "lang/"& LangFilePath &"/lang_sys.inc"
include "lang/"& LangFilePath &"/lang_menu.inc"
include "lang/"& LangFilePath &"/lang_skin.inc"
include "lang/"& LangFilePath &"/lang_data.inc"
CurrentId = 6
CurrentUrl = "admin_skin.asp"
LB_Head()
LB_Menu()
action = request("action")
%>
<div class="tabmenu mainwidth">
      <ul>
        <li><a href="admin_skin.asp"><span><%=Lang_Menu(58)%></span></a></li>
        <li class="current"><a href="admin_skin_load.asp"><span><%=Lang_Menu(156)%></span></a></li>
      </ul>
</div>
<%
Response.Write("<div class=""tab-mainbody"">")
Response.Write("<div class=""tab-mainbody2"">")
If Eshop_Lebi_name="" Or instr(","&Eshop_Lebi_flag&",",admin_flag)=0 Then
        adminflag()
Else
		If OutSubmit = 1 Then CheckOutSubmit()
        Dim Temp,sname,act,mdbname,sql
        dim action,StyleConn,Rs,ID
        Select Case Action
               Case Else
	                Main()
        End Select
End If
Response.Write("</div>")
Response.Write("</div>")
LB_Footer()

Sub Main()
		i = 1
		Set LB_XML = new ASPXML
		path = Server.MapPath("../skins/")
		Temp = "<?xml version=""1.0"" encoding=""utf-8""?>"& vbcrlf
		Temp = Temp & "<data>"& vbcrlf
		set fso=server.CreateObject("scripting.filesystemobject")    
        on error resume next
        set objFolder=fso.GetFolder(path)
        set objSubFolders=objFolder.Subfolders
        for each objSubFolder in objSubFolders
			DataFile = server.MapPath("../skins/"& objSubFolder.name &"/data.xml")
			If fso.FileExists(DataFile) Then
				LB_XML.Path = DataFile
				LB_XML.Data = "data"
				LB_XML.open
				LB_XML.SelectTable("config")
				name = LB_XML.read("name")
				picture = LB_XML.read("picture")
				templatefolder = LB_XML.read("templatefolder")
				stylefolder = LB_XML.read("stylefolder")
				preview = LB_XML.read("preview")
				previewwidth = LB_XML.read("previewwidth")
				previewheight = LB_XML.read("previewheight")
				LB_XML.close
				Temp = Temp & "<template>"& vbcrlf
				Temp = Temp & "<ID>"& i &"</ID>"& vbcrlf
				Temp = Temp & "<name>"& name &"</name>"& vbcrlf
				Temp = Temp & "<picture>"& picture &"</picture>"& vbcrlf
				Temp = Temp & "<templatefolder>"& templatefolder &"</templatefolder>"& vbcrlf
				Temp = Temp & "<stylefolder>"& stylefolder &"</stylefolder>"& vbcrlf
				Temp = Temp & "<preview>"& preview &"</preview>"& vbcrlf
				Temp = Temp & "<previewwidth>"& previewwidth &"</previewwidth>"& vbcrlf
				Temp = Temp & "<previewheight>"& previewheight &"</previewheight>"& vbcrlf
				Temp = Temp & "</template>"& vbcrlf
				i = i + 1
			End If 
        next
		Temp = Temp & "</data>"
		Savehtml "../skins/Lebi_Tpl.xml",Temp
		LB_XML.Path = server.MapPath("../skins/Lebi_Tpl.xml")
		LB_XML.Data = "data"
		LB_XML.open
		LB_XML.SelectTable("template")
		do while not(LB_XML.Xml_Bof or LB_XML.Xml_Eof)
		If Not fso.FolderExists(server.MapPath("../skins/"& LB_XML.read("templatefolder"))) Then
			LB_XML.delete "templatefolder", LB_XML.read("templatefolder")
		End If 
		LB_XML.MoveNext()
		Loop
		LB_XML.close
        set objFolder=nothing
        set objSubFolders=nothing
        set fso=Nothing
		Call Up_mes(Lang_Menu(156),"·"& Lang_Skin(140),0,"admin_skin.asp",0,0,2,1)
End Sub
%>