<!--#include file="conn.asp"-->
<!--#include file="inc/cookies_check.asp"-->
<!--#include file="inc/Page_cls.asp"-->
<!--#include file="../include/Config.inc"-->
<!--#include file="../include/Lebi_Cache_cls.asp"-->
<!--#include file="../include/Lebi_XML_Cls.asp"-->
<%
'*****************************************
'* 软件名称 乐彼网上开店软件(56770 EShop)
'* 软件开发 http://www.56770.com
'* 版权所有 http://www.56770.com
'* 文件名称 Admin_skin.asp
'* 最后更新 2013-05-29 by 56770.kingdge
'*****************************************
On Error Resume Next 
Set LB_XML = new ASPXML
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_page.inc"
include "lang/"& LangFilePath &"/lang_system.inc"
CurrentId = 6
CurrentUrl = "admin_skin.asp"
htmlstate = checknum(request("htmlstate"),1)
action = request("action")
If action <> "s_view" Then 
	LB_Head()
	LB_Menu()
%>
<div class="tabmenu mainwidth">
      <ul>
		<%If action = "s_edit" Then%>
		<li <%If htmlstate = 0 Then response.write("class=""current""") End If%>><a href="admin_skin.asp?action=s_edit&template=<%=request("template")%>&s_name=<%=request("s_name")%>&path=<%=request("path")%>&filename=<%=request("filename")%>&htmlstate=0"><span><%=Lang_sys(104)%></span></a></li>
		<li <%If htmlstate = 1 Then response.write("class=""current""") End If%>><a href="admin_skin.asp?action=s_edit&template=<%=request("template")%>&s_name=<%=request("s_name")%>&path=<%=request("path")%>&filename=<%=request("filename")%>&htmlstate=1"><span><%=Lang_sys(105)%></span></a></li>
		<%End If%>
        <li <%If action <> "s_list" And action <> "s_edit" Then Response.Write("class=""current""") End If%>><a href="admin_skin.asp"><span><%=Lang_Menu(58)%></span></a></li>
		<%If action="s_list" Then%><li class="current"><a href="?action=s_list&template=<%=request("template")%>&s_name=<%=server.urlencode(request("s_name"))%>"><span><%=request("s_name")%></span></a></li><%End If%>
        <li><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"">")
End If 
If Eshop_Lebi_name="" Or instr(","&Eshop_Lebi_flag&",",admin_flag)=0 Then
		adminflag()
Else
		If OutSubmit = 1 Then CheckOutSubmit()
		Function SelectSkin(template,lang)
				Set LB_XMLList = new ASPXML
				SelectSkin = "<select name=""skinid"" onChange=""var jmpURL=this.options[this.selectedIndex].value ;if(jmpURL!='') {window.location=jmpURL; }else{ this.selectedIndex=0; }"">"
				SelectSkin = SelectSkin &"<option value=""#"" selected>┌ "& Lang_Skin(5) &"</option>"
				LB_XMLList.Path = server.MapPath("../skins/Lebi_Tpl.xml")
				LB_XMLList.Data = "data"
				LB_XMLList.open
				LB_XMLList.SelectTable("template")
				do while not(LB_XMLList.Xml_Bof or LB_XMLList.Xml_Eof)
				SelectSkin = SelectSkin &"<option value=""?action=check&template="& LB_XMLList.read("templatefolder") &"&langid="& lang &""" "& judge2(rs("template"),LB_XMLList.read("templatefolder")) &">├ "& LB_XMLList.read("name") &"</option>"
				LB_XMLList.MoveNext()
				Loop
				LB_XMLList.close
				SelectSkin = SelectSkin &"</select>"
		End Function
		Select Case action
			   Case"check":check()
			   case"edit":edit()
			   case"edit_ok":edit_ok()
			   case"del":del()
			   Case"s_list":s_list()
			   case"s_view":s_view()
			   case"s_edit":s_edit()
			   case"s_edit_ok":s_edit_ok()
			   Case Else
					main()
		End Select
End If
If action <> "s_view" Then 
	Response.Write("</div>")
	Response.Write("</div>")
	LB_Footer()
End If 

Sub check
		If OnlyRead = 1 Then OnlyReadMessage()
		template = safereplace(request("template"))
		langid = safereplace(request("langid"))
		If UBound(Split(langid,",")) = 0 Then
				conn.execute("update [Lebi_Language] Set template = '"& template &"' where l_id = "& langid &"")
		Else
				For i = 0 To UBound(Split(template,","))
						conn.execute("update [Lebi_Language] Set template = '"& Trim(Split(template,",")(i)) &"' where l_id = "& Split(langid,",")(i) &"")
				Next
		End If
		Application.Contents.RemoveAll
		ManageLog Lang_Skin(34) &" ["&template&"]"
		Call Up_mes(Lang_sys(69),"·"& Lang_sys(68),0,"admin_skin_save.asp?action=all&back_type=0",0,0,2,1)
End Sub

Sub del
		If OnlyRead = 1 Then OnlyReadMessage()
		template = safereplace(request("template"))
		set rs = conn.execute("select template from [Lebi_Language] where template='"& template &"'")
		If Not rs.eof Then
				Call Up_mes(Lang_sys(46),"·"& Lang_Skin(36),0,m_u,0,0,2,0)
		Else
				set fso=Server.CreateObject ("Scripting.FileSystemObject")
				fso.DeleteFolder(server.mappath("../skins/"& template))
				Set fso = Nothing
			    ManageLog Lang_Skin(35) &" ["&template&"]"
			    Call Up_mes(Lang_sys(43),"·"& Lang_sys(42),0,"admin_skin_load.asp",0,0,2,1)
		End If
		rs.close:Set rs=Nothing
End Sub

Sub edit_ok
		If OnlyRead = 1 Then OnlyReadMessage()
		template = safereplace(request("template"))
		If Safereplace(request("name"))="" Then
			   save_error=True
			   error_info="·"& Lang_Skin(37) &"<br>"
		End If
		If Safereplace(request("templatefolder"))="" Then
			   save_error=True
			   error_info=error_info&"·"& Lang_Skin(38) &"<br>"
		End If
		If save_error=True Then
			    Call Up_mes(Lang_sys(46),error_info,0,"javascript:history.back()",0,0,2,0)
		Else
				LB_XML.Path = server.MapPath("../skins/"& Safereplace(request("templatefolder")) &"/data.xml")
				LB_XML.Data = "data"
				LB_XML.open
				LB_XML.SelectTable("config")
				LB_XML.Write "name",Safereplace(request("name"))
				LB_XML.Write "picture",Safereplace(request("picture"))
				LB_XML.Write "preview",Safereplace(request("preview"))
				LB_XML.Write "previewwidth",Safereplace(request("previewwidth"))
				LB_XML.Write "previewheight",Safereplace(request("previewheight"))
				LB_XML.Write "stylefolder",Safereplace(request("stylefolder"))
				LB_XML.Write "templatefolder",Safereplace(request("templatefolder"))
				LB_XML.Update
				LB_XML.close
				LB_XML.Path = server.MapPath("../skins/Lebi_Tpl.xml")
				LB_XML.Data = "data"
				LB_XML.open
				LB_XML.SelectTable("template")
				LB_XML.SelectItem "templatefolder",template
				LB_XML.Write "name",Safereplace(request("name"))
				LB_XML.Write "picture",Safereplace(request("picture"))
				LB_XML.Write "preview",Safereplace(request("preview"))
				LB_XML.Write "previewwidth",Safereplace(request("previewwidth"))
				LB_XML.Write "previewheight",Safereplace(request("previewheight"))
				LB_XML.Write "stylefolder",Safereplace(request("stylefolder"))
				LB_XML.Write "templatefolder",Safereplace(request("templatefolder"))
				LB_XML.Update
				LB_XML.close
				If Config_Lebi_Eshop(17)="1" Then
						Application.Contents.RemoveAll
				End If
			    ManageLog Lang_Skin(42) &" ["&s_name&"]"
			    m_u="?"
			    Call Up_mes(Lang_sys(48),"·"& Lang_sys(47),0,m_u,"?htmlstate="& htmlstate,0,2,1)
		End If
End Sub

Sub s_edit_ok()
		If OnlyRead = 1 Then OnlyReadMessage()
		s_name = safereplace(request("s_name"))
		template = Replace(Replace(safereplace(request("template")),"./",""),"\","")
		path = safereplace(request("path"))
		filecontent = request.form("filecontent")
		filename = safereplace(request("filename"))
		If path <> "" Then 
				filepath = "../skins/"& template &"/"& path &"/"& filename
		Else
				filepath = "../skins/"& template &"/"& filename
		End If 
		Dim Hackchar
		Hackchar = "truncate,declare,createtextfile,createdirectory,deletedirectory,deletefolder,savehtml,shell.application,wscript,script.encode,javascript.encode"
		For i = 0 To UBound(Split(Hackchar,","))
				If InStr(LCase(filecontent),Split(Hackchar,",")(i)) > 0 Then
						Call Up_mes(Lang_sys(46),"·"& Lang_sys(87) &"["& Split(Hackchar,",")(i) &"]",0,"javascript:history.back();",0,0,2,0)
				End If
		Next
		If (InStr(LCase(str),"execute(request")>0 or InStr(LCase(str),"execute request")>0) Or (InStr(LCase(str),"eval(request")>0 or InStr(LCase(str),"eval request")>0) Or (InStr(LCase(str),"eval(session")>0 or InStr(LCase(str),"eval session")>0) Then
				Call Up_mes(Lang_sys(46),"·"& Lang_sys(87) &"",0,"javascript:history.back();",0,0,2,0)
		End If
		Savehtml filepath,filecontent
	    m_u="?action=s_list&template="& template &"&s_name="& server.urlencode(s_name) &"&path="& path
		If path = "template" Then 
				m_s_z="<IFRame frameborder=0 width='100%' height='25' scrolling=no src='admin_skin_save.asp?template="& template &"&s_name="& server.urlencode(s_name) &"&filename="& filename &"&mes_type=1'></IFrame>"
		End If 
	    Call Up_mes(Lang_sys(48),"·"& Lang_sys(47),m_s_z,m_u,0,0,2,1)
End Sub 

Sub edit()
	template = safereplace(request("template"))
	LB_XML.Path = server.MapPath("../skins/"& template &"/data.xml")
	LB_XML.Data = "data"
	LB_XML.open
	LB_XML.SelectTable("config")
	name = LB_XML.read("name")
	picture = LB_XML.read("picture")
	preview = LB_XML.read("preview")
	previewwidth = LB_XML.read("previewwidth")
	previewheight = LB_XML.read("previewheight")
	stylefolder = LB_XML.read("stylefolder")
	templatefolder = LB_XML.read("templatefolder")
	LB_XML.close
%>
<table width="100%" border="0" cellspacing="0" cellpadding="0" id="edit" class="classtable">
  <form method="post" action="?action=edit_ok">
  <tr>
     <td height="30" align="left" class="classhead"><input name="submit" type="image" src="lang/<%=LangFilePath%>/images/bt_app.gif" title=" <%=Lang_sys(1)%> " align="absmiddle">&nbsp;<input type="image" src="lang/<%=LangFilePath%>/images/bt_res.gif" title=" <%=Lang_sys(2)%> " onclick="reset();return false;" align="absmiddle"><input type="hidden" name="template" value="<%=template%>"></td>
	<td align="right" class="classhead">
	<%=QuickMenu("","")%>
	</td>
 </tr>
  <tr>
     <td height="30" class="classtop" colspan="2"><%=Lang_Skin(70)%></td>
  </tr>
  <tr class="classrow">
     <td width="15%" class="classrow" height="30"><%=Lang_Skin(47)%></td><td class="classrow"><input type="text" name="name" size="20" class="form" value="<%=name%>"></td>
  </tr>
  <tr class="classrow">
     <td width="15%" class="classrow" height="30"><%=Lang_Skin(48)%></td><td class="classrow"><input type="text" name="picture" size="20" class="form" value="<%=picture%>"></td>
  </tr>
  <tr class="classrow">
     <td width="15%" class="classrow" height="30"><%=Lang_Skin(49)%></td><td class="classrow"><input type="text" name="templatefolder" size="20" class="form" value="<%=templatefolder%>"> <img src="images/help.gif" width="16" height="16" align="absmiddle" onmouseover="showhintinfo(this,0,0,'','<%=Lang_Skin(50)%>','50','up');" onmouseout="hidehintinfo();" /></td>
  </tr>
  <tr class="classrow">
     <td width="15%" class="classrow" height="30"><%=Lang_Skin(51)%></td><td class="classrow"><input type="text" name="stylefolder" size="20" class="form" value="<%=stylefolder%>"> <img src="images/help.gif" width="16" height="16" align="absmiddle" onmouseover="showhintinfo(this,0,0,'','<%=Lang_Skin(52)%>','50','up');" onmouseout="hidehintinfo();" /></td>
  </tr>
      <tr class="classrow">
     <td width="15%" class="classrow" height="30"><%=Lang_Skin(65)%></td><td class="classrow"><input type="radio" value="0" <%if preview=0 then Response.Write"checked"%> name="preview"> <%=Lang_Skin(66)%>
<input type="radio" value="1" <%if preview=1 then Response.Write "checked"%> name="preview"> <%=Lang_Skin(67)%> <img src="images/help.gif" width="16" height="16" align="absmiddle" onmouseover="showhintinfo(this,0,0,'','<%=Lang_Skin(68)%>','50','up');" onmouseout="hidehintinfo();" /></td>
  </tr>
  <tr class="classrow">
     <td width="15%" class="classrow" height="30"><%=Lang_Skin(61)%></td><td class="classrow"><%=Lang_Skin(59)%><input type="text" name="previewwidth" size="3" class="form" value="<%=previewwidth%>">&nbsp;&nbsp;<%=Lang_Skin(60)%><input type="text" name="previewheight" size="3" class="form" value="<%=previewheight%>"></td>
  </tr>
  </tr>
  <tr>
     <td align="left" height="30" colspan="2" class="classfooter">
		<input name="submit" type="image" src="lang/<%=LangFilePath%>/images/bt_app.gif" title=" <%=Lang_sys(1)%> " align="absmiddle">&nbsp;<input type="image" src="lang/<%=LangFilePath%>/images/bt_res.gif" title=" <%=Lang_sys(2)%> " onclick="reset();return false;" align="absmiddle">
	 </td>
  </tr>
  </form>
</table>
<script>tdshow("edit");</script>
<%End Sub

Sub main()
	keyword = safereplace(request("keyword"))
%>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="classtable-top">
<tbody>
<tr>
<form method="get" action="?">
<td height="30" align="left" class="classhead">
<input name="button" type="image" src="lang/<%=LangFilePath%>/images/bt_update.gif" title=" <%=Lang_Skin(74)%> " onclick="location.href='admin_skin_save.asp?action=all&back_type=1';return false;" align="absmiddle"><!--<input name="keyword" type="text" class="form_query" size="15"><input name="Submit" type="submit" value="" title="<%=Lang_sys(25)%>" align="absmiddle" class="btn_query">-->
</td>
</form>
<td height="30" align="right" class="classhead">
<%=QuickMenu("","admin_skin.asp?action=add|"& Lang_Skin(46) &"")%>
</td>
</tr>
</tbody>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="classtable2" style="margin-bottom:5px;">
<tbody>
<tr>
<td height="30" colspan="2" class="classtop"><%=Lang_Skin(75)%></td>
</tr>
<%
Set rs = conn.execute("select l_name,template,l_id from [Lebi_Language] where l_state = 1 order by l_default desc")
If rs.eof Then
		response.write("<tr class=""classrow""><td height=""25"" colspan=""2"" class=""classrow"">"& Lang_Skin(76) &"</td></tr>")
Else
		i = 1
		Do While Not rs.eof
		If CheckDir("../skins/"& rs(1) &"/") Then 
		LB_XML.Path = server.MapPath("../skins/"& rs(1) &"/data.xml")
		LB_XML.Data = "data"
		LB_XML.open
		LB_XML.SelectTable("config")
		name = LB_XML.read("name")
		picture = LB_XML.read("picture")
		preview = LB_XML.read("preview")
		previewwidth = LB_XML.read("previewwidth")
		previewheight = LB_XML.read("previewheight")
		stylefolder = LB_XML.read("stylefolder")
		templatefolder = LB_XML.read("templatefolder")
		LB_XML.close
		response.write("<td width=""50%""><table width=""96%"" border=""0"" cellspacing=""0"" cellpadding=""3"" align=""center"" class=""classlist""><td height=""25"" class=""classrow""><strong>"& rs(0) &"</strong></td><td align=""right"" class=""classrow"">"& SelectSkin(rs(1),rs(2)) &"</td></tr><tr class=""classrow""><td height=""25"" colspan=""2"" class=""classrow""><table border=""0"" cellspacing=""0"" cellpadding=""3""><tr><Td width=""120""><div class=""skin-pic""><img src=""../skins/"& templatefolder &"/"& picture &"""></div></td><td valign=""top"" style=""color:#000; line-height:190%"">"& Lang_Skin(47) &""& name &"<br>"& Lang_Skin(65))
		If preview = 0 Then 
				response.write(Lang_Skin(66))
		Else
				response.write(Lang_Skin(67))
		End If 
		response.write("<br>"& Lang_Skin(61) &""& previewwidth &" × "& previewheight &"<br>"& Lang_Skin(49) &""& templatefolder &"<br>"& Lang_Skin(51) &""& stylefolder &"</td></tr></table></td></tr><tr class=""classrow""><td height=""25"" colspan=""2"" class=""classrow""><a href=""?action=edit&template="& templatefolder &"&s_name="& server.urlencode(name) &"""><img src=""images/icon_edit.gif"" title="""& Lang_sys(51) &""" border=""0"" align=""absmiddle"" width=""16""></a>&nbsp;<a href=""?action=s_list&template="& templatefolder &"&s_name="& server.urlencode(name) &"""><img src=""images/icon_viewstyle.gif"" title="""& Lang_Skin(77) &""" border=""0"" align=""absmiddle"" width=""16""></a>&nbsp;<a href=""admin_skin_style.asp?template="& templatefolder &"&s_name="& server.urlencode(name) &"""><img src=""images/icon_style.gif"" title="""& Lang_Skin(78) &""" border=""0"" align=""absmiddle"" width=""16""></a>&nbsp;<a href=""admin_num.asp?template="& templatefolder &"&s_name="& server.urlencode(name) &"""><img src=""images/icon_config.gif"" title="""& Lang_Skin(2) &""" border=""0"" align=""absmiddle""></a>&nbsp;<a href=""admin_skin_save.asp?action=all&template="& templatefolder &"&s_name="& server.urlencode(name) &"""><img src=""images/icon_savefile.gif"" border=""0"" align=""absmiddle"" title="""& Lang_Skin(79) &""" width=""16""></a></td></tr></table></td>")
		End If 
		If rs.recordcount = 1 Then response.write("<td width=""50%"">")
		If i mod 2 = 0 Then response.write("</tr>")
		rs.movenext
		i = i + 1
		Loop
End If
rs.close : Set rs = Nothing
page = CLng(checknum(request("page"),1))
pagesize = 6
Set objXML = Server.CreateObject("Microsoft.XMLDOM") 
objXML.load(Server.MapPath("../skins/lebi_tpl.xml"))
set mydoms = objXML.getElementsByTagName("template")
count = mydoms.length
allpage = int(count/pagesize)+1
if count mod pagesize=0 Then 
   allpage = int(count/pagesize)
end if
if page > allpage Then page = allpage
if count <= pagesize Then page = 1
dim strart_id:strart_id=(page-1)*pagesize
dim end_id:end_id=strart_id+pagesize
if end_id>count then end_id=count 
end_id=end_id-1 
strart_id=count-strart_id-1
end_id=count-end_id-1
%>
<tr>
<td height="30" colspan="2" class="classtop"><%=Lang_Skin(80)%></td>
</tr>
<tr>
<%
j = 0
for i=strart_id to end_id step -1
		name=mydoms(i).selectSingleNode("name").Text
		picture=mydoms(i).selectSingleNode("picture").Text
		templatefolder=mydoms(i).selectSingleNode("templatefolder").Text
		stylefolder=mydoms(i).selectSingleNode("stylefolder").Text
		preview=mydoms(i).selectSingleNode("preview").Text
		previewwidth=mydoms(i).selectSingleNode("previewwidth").Text
		previewheight=mydoms(i).selectSingleNode("previewheight").Text
'		If InStr(name,keyword) > 0 Then 
		response.write("<td width=""50%""><table width=""96%"" border=""0"" cellspacing=""0"" cellpadding=""3"" align=""center"" class=""classlist""><tr class=""classrow""><td height=""25"" colspan=""2"" class=""classrow""><table border=""0"" cellspacing=""0"" cellpadding=""3""><tr><Td width=""120""><div class=""skin-pic""><img src=""../skins/"& templatefolder &"/"& picture &"""></div></td><td valign=""top"" style=""color:#000; line-height:190%"">"& Lang_Skin(47) &""& name &"<br>"& Lang_Skin(65))
		If preview = 0 Then 
				response.write(Lang_Skin(66))
		Else
				response.write(Lang_Skin(67))
		End If 
		response.write("<br>"& Lang_Skin(61) &""& previewwidth &" × "& previewheight &"<br>"& Lang_Skin(49) &""& templatefolder &"<br>"& Lang_Skin(51) &""& stylefolder &"</td></tr></table></td></tr><tr class=""classrow""><td height=""25"" class=""classrow""><a href=""?action=edit&template="& templatefolder &"&s_name="& server.urlencode(name) &"""><img src=""images/icon_edit.gif"" title="""& Lang_sys(51) &""" border=""0"" align=""absmiddle"" width=""16""></a>&nbsp;<a href=""?action=s_list&template="& templatefolder &"&s_name="& server.urlencode(name) &"""><img src=""images/icon_viewstyle.gif"" title="""& Lang_Skin(77) &""" border=""0"" align=""absmiddle"" width=""16""></a>&nbsp;<a href=""admin_skin_style.asp?template="& templatefolder &"&s_name="& server.urlencode(name) &"""><img src=""images/icon_style.gif"" title="""& Lang_Skin(78) &""" border=""0"" align=""absmiddle"" width=""16""></a>&nbsp;<a href=""admin_num.asp?template="& templatefolder &"&s_name="& server.urlencode(name) &"""><img src=""images/icon_config.gif"" title="""& Lang_Skin(2) &""" border=""0"" align=""absmiddle""></a>&nbsp;<a href=""?action=del&template="& templatefolder &""" onClick=""return ConfirmDel();""><img src=""images/icon_del.gif"" title="""& Lang_sys(15) &""" border=""0"" align=""absmiddle"" width=""16""></a></td><td height=""25"" class=""classrow""><div class=""skinconfirm""><ul class=""m_ul""><li class=""m_li"" onmouseover=""showmenu(this,0);""><a href=""#"">"& Lang_Skin(168) &"</a><div class=""l_m"" onmouseout=""hidemenu(1);hidemenu(0)"">")
		Set rs = conn.execute("select l_id,l_name from [lebi_Language] where l_state = 1 order by l_order desc")
		Do While Not rs.eof 
		response.write("<a href=""?action=check&template="& templatefolder &"&langid="& rs(0) &""" onmouseover=""showmenu(this,1)"">"& rs(1) &"</a>")
		rs.movenext 
		Loop
		rs.close : Set rs = Nothing 
		response.write("</div></li></ul></div></td></tr></table></td>")
		If (j+1) mod 2 = 0 Then response.write("</tr>")
		j = j + 1
next
set mydoms=nothing 
set objXMl=nothing
%>
<tr>
	<td height="30" class="classfooter" align="right" colspan="2">
	<form action='admin_skin.asp' name='pagefoot' method='post'>
	<div class="pagination">
	<%
	pagenmin=page-3'计算页码开始值
	If page = 1 Then
	   pagenmax=page+5
	Else
	   pagenmax=page+3
	End If
	If (pagenmin<1) then
		pagenmin=1
	end If
	pagec = FormatNumber2(count/pagesize)
	If pagec = ".00" Then pagec = 1
	If InStr(pagec,".") > 0 Then
			If CLng(Split(pagec,".")(1))>0 Then
			pagec = Split(pagec,".")(0) + 1
			Else
			pagec = CLng(Split(pagec,".")(0))
			End If
	End If
	If CLng(page) > CLng(pagec) Then page = pagec
	If (page>1) Then
			Response.Write"<a href='?page=1' class=""page-prev"">"& Lang_Page(1) &"</a>"
	End If
	if allpage>1 and allpage = page then
			Response.Write"<a href='?page="& page-1 &"' class=""page-prev"">"& Lang_Page(2) &"</a>"
	End If
	if(pagenmax>pagec) then
			pagenmax=pagec
	end if
	for page_i = pagenmin to pagenmax
			if(CLng(page_i)=CLng(page)) then
					Response.Write"<span class=""page-cur"">"& page_i &"</span>"
			else
					Response.Write"<a href=?page="& page_i &">"& page_i &"</a>"
			end if
	next
	if page=1 and n<>page and n <> 0 then
			Response.Write"<a href='?page="& page+1 &"' class=""page-next"">"& Lang_Page(3) &"</a>"
			Response.Write"<a href='?page="& pagec &"' class=""page-next"">"& Lang_Page(4) &"</a>"
	end if
	Response.Write"<span class=""page-skip"">"& Lang_Page(6) &" "& page &"/"& pagec &" <input type='text' name='Page' value='"& page+1 &"' class='text'><input type='submit' name='go' value='"& Lang_Page(5) &"' class='button'></span>"
	%>
	</div>
	</form>
	</td>
</tr>
<tr>
  <td colspan="2" class="classfaq" height="50">
  <div class="faq_main">
  <p class="faq_title"><%=Lang_sys(49)%></p>
  <img src="images/icon_edit.gif" border="0" align="absmiddle" width="16"> <%=Lang_Skin(81)%> <img src="images/icon_viewstyle.gif" border="0" align="absmiddle" width="16"> <%=Lang_Skin(77)%> <img src="images/icon_style.gif" border="0" align="absmiddle" width="16"> <%=Lang_Skin(78)%> <img src="images/icon_config.gif" border="0" align="absmiddle" width="16"> <%=Lang_Skin(2)%> <img src="images/icon_savefile.gif" border="0" align="absmiddle" width="16"> <%=Lang_Skin(74)%><br>
  <br><strong><%=Lang_Skin(82)%></strong>
  <br><%=Lang_Skin(83)%>
  <br><%=Lang_Skin(84)%>
   </div>
  </td>
</tr>
</table>
<%
End Sub

Sub s_list()
template = Replace(Replace(safereplace(request("template")),"\",""),"/","")
If template = "" Then template = "skins/"
s_name = safereplace(request("s_name"))
Path=Trim(request("path"))
path=Replace(Replace(path,"/",""),"\","")
IF Len(Path)>0 Then Path_mid="/"
Select Case Path
	Case "":Temp_file="../skins/"& template
	Case Else:Temp_file="../skins/"& template&"/"&Path&Path_mid
End Select
%>
<script language="javascript" type="text/javascript" src="inc/js/jquery.js"></script>
<script language="javascript" type="text/javascript" src="inc/js/tipswindown.js"></script>
<script language="javascript" type="text/javascript">
var $=jQuery;
function doZoom(size){
document.getElementById('zoom').style.fontSize=size+'px'
}
var DOM = (document.getElementById) ? 1 : 0;
var NS4 = (document.layers) ? 1 : 0;
var IE4 = 0;
if (document.all)
{
IE4 = 1;
DOM = 0;
}
var win = window;
var n = 0;
function findIt() {
if (document.getElementById("searchstr").value != "")
findInPage(document.getElementById("searchstr").value);
}
function findInPage(str) {
var txt, i, found;
if (str == "")
return false;
if (DOM)
{
win.find(str, false, true);
return true;
}
if (NS4) {
if (!win.find(str))
while(win.find(str, false, true))
n++;
else
n++;
if (n == 0)
alert("<%=Lang_Skin(175)%>");
}
if (IE4) {
txt = win.document.body.createTextRange();
for (i = 0; i <= n && (found = txt.findText(str)) != false; i++) {
txt.moveStart("character", 1);
txt.moveEnd("textedit");
}
if (found) {
txt.moveStart("character", -1);
txt.findText(str);
txt.select();
txt.scrollIntoView();
n++;
}
else {
if (n > 0) {
n = 0;
findInPage(str);
}
else
alert("<%=Lang_Skin(175)%>");
}
}
return false;
}
</script>
<table width="100%" border="0" cellspacing="0" cellpadding="0" id="list" class="classtable">
<tr>
 <td height="30" class="classhead" colspan="2">
 <input id="searchstr" name="searchstr" type="text" class="form_query" size="20"><input name="query" type="button" value="" title="<%=Lang_sys(25)%>" align="absmiddle" class="btn_query" onclick="javascript:findIt();"></td>
 <td class="classhead" colspan="3" align="right">
 <select onChange="var jmpURL=this.options[this.selectedIndex].value ;if(jmpURL!='') {window.location=jmpURL; }else{ this.selectedIndex=0; }" >
<option selected>┌ <%=Lang_Skin(86)%></option>
<option value="Admin_skin.asp?action=s_list&template=<%= template %>&s_name=<%=server.urlencode(s_name)%>">├ <%=Lang_Skin(77)%></option>
<option value="Admin_skin_style.asp?template=<%= template %>&s_name=<%=server.urlencode(s_name)%>">├ <%=Lang_Skin(78)%></option>
<option value="Admin_skin.asp">├ <%=Lang_Skin(85)%></option>
</select>
</td>
</tr>
    <tr>
	  <%If path="template" Then%>
      <td class="classtop" width="30%"><%=Lang_Skin(172)%></td>
	  <td class="classtop" width="35%"><%=Lang_Skin(89)%></td>
	  <%Else%>
	  <td class="classtop" width="65%"><%=Lang_Skin(172)%></td>
	  <%End If%>
      <td class="classtop" width="10%"><%=Lang_Skin(173)%></td>
      <td class="classtop" width="15%"><%=Lang_Skin(174)%></td>
      <td class="classtop" width="10%"><%=Lang_Skin(90)%></td>
    </tr>
	<%
	IF len(path)>0 Then
	%>
	<tr class="classrow">
      <td colspan="5" class="classrow"><img src="images/ext/folder_up.gif" align="absmiddle" /> <a href="?action=s_list&template=<%=template%>&s_name=<%=server.urlencode(s_name)%>">返回根目录</a></td>
    </tr>
	<%
	End If 
	Set Fso=CreateObject("Scripting.Filesystemobject")
	Set FsoFolder=Fso.GetFolder(server.mappath(Temp_file))
	Set Fsocontent=FsoFolder.files
	For Each Fsocount In FsoFolder.Subfolders
	%>
    <tr class="classrow">
		<td height="30" class="classrow"><%IF Instr(path_mid,"/")>0 Then%>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<%End IF%><img src="images/ext/folder.gif" align="absmiddle" /> <a href="?action=s_list&template=<%=template%>&s_name=<%=server.urlencode(s_name)%>&path=<%=path&Path_mid&Fsocount.name%>"><%=Fsocount.name%></a></td>
		<td class="classrow"><%=FormatNumber(Fsocount.size/1024,2)%> KB</td>
		<td class="classrow"><%=Fsocount.datelastmodified%></td>
		<td class="classrow">&nbsp;</td>
    </tr>
	<%
	Next
	For Each FsoItem in Fsocontent
		EditType=False
		FileExt = Lcase(right(FsoItem.name,3))
		Select Case FileExt
			Case "htm","tml","yle":picsrc="html":EditType=True
			Case ".js":picsrc="js":EditType=True
			Case "bmp","jpg","asp","gif","png","swf":picsrc=right(FsoItem.name,3)
			Case "css","txt","xml","xsl":picsrc=right(FsoItem.name,3):EditType=True
			Case Else:picsrc="file"
		End Select
		If path <> "" Then 
				filename = "../skins/"& template &"/"& path &"/"& FsoItem.name
		Else
				filename = "../skins/"& template &"/"& FsoItem.name
		End If 
	%>
    <tr class="classrow">
		<td height="30" class="classrow">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img src="images/ext/<%=picsrc%>.gif" align="absmiddle" /> <%if InStr("asp,xsl,xml,txt,css,htm,yle,.js",FileExt) > 0 Then%><a href="?action=s_edit&template=<%=template%>&s_name=<%=server.urlencode(s_name)%>&path=<%=path&Path_mid%>&filename=<%=FsoItem.name%>"><%Else%><a href="javascript:tipsWindown('<%=Lang_Skin(77)%>','iframe:admin_skin.asp?action=s_view&filename=<%=filename%>','800','222','true','','true','text');"><%End If%><%=FsoItem.name%></a></td>
	    <%If path="template" Then%>
        <td class="classrow"><%
		Select Case FsoItem.name
		Case "adv.htm" response.write(Lang_Skin(124))
		Case "advancedsearch.htm" response.write(Lang_Skin(116))
		Case "banner.htm" response.write(Lang_Skin(122))
		Case "brand.htm" response.write(Lang_Skin(99))
		Case "brand_list.htm" response.write(Lang_Skin(14))
		Case "default.htm" response.write(Lang_Skin(96))
		Case "error.htm" response.write(Lang_Skin(127))
		Case "foot.htm" response.write(Lang_Skin(125))
		Case "generic.htm" response.write(Lang_Skin(126))
		Case "gift.htm" response.write(Lang_Skin(112))
		Case "guestbook.htm" response.write(Lang_Skin(115))
		Case "head.htm" response.write(Lang_Skin(121))
		Case "help_default.htm" response.write(Lang_Skin(114))
		Case "help_list.htm" response.write(Lang_Skin(114) &"-"& Lang_Skin(134))
		Case "help_system.htm" response.write(Lang_Skin(136))
		Case "link.htm" response.write(Lang_Skin(118))
		Case "nav.htm" response.write(Lang_Skin(123))
		Case "news_default.htm" response.write(Lang_Skin(113))
		Case "news_detail.htm" response.write(Lang_Skin(113) &"-"& Lang_Skin(135))
		Case "news_list.htm" response.write(Lang_Skin(113) &"-"& Lang_Skin(134))
		Case "order_basket.htm" response.write(Lang_Skin(107))
		Case "order_checkout.htm" response.write(Lang_Skin(108))
		Case "order_checkout_europe.htm" response.write(Lang_Skin(108)&"-"&Lang_System(135))
		Case "order_pay.htm" response.write(Lang_Skin(176))
		Case "order_preview.htm" response.write(Lang_Skin(109))
		Case "order_preview_europe.htm" response.write(Lang_Skin(109)&"-"&Lang_System(135))
		Case "order_submit.htm" response.write(Lang_Skin(110))
		Case "product_category.htm" response.write(Lang_Skin(97))
		Case "product_detail.htm" response.write(Lang_Skin(104))
		Case "product_list.htm" response.write(Lang_Skin(100))
		Case "product_new.htm" response.write(Lang_Skin(101))
		Case "product_recommend.htm" response.write(Lang_Skin(102))
		Case "product_sale.htm" response.write(Lang_Skin(103))
		Case "product_showpic.htm" response.write(Lang_Skin(177))
		Case "product_unite.htm" response.write(Lang_Skin(119))
		Case "product_unite_detail.htm" response.write(Lang_Skin(120))
		Case "searchresult.htm" response.write(Lang_Skin(117))
		Case "success.htm" response.write(Lang_Skin(128))
		Case "user_panel.htm" response.write(Lang_Skin(111))
		Case "user_register.htm" response.write(Lang_Skin(105))
		Case "user_register_europe.htm" response.write(Lang_Skin(105)&"-"&Lang_System(135))
		Case "user_signin.htm" response.write(Lang_Skin(106))
		Case "vote.htm" response.write(Lang_Skin(178))
		Case "writemsg.htm" response.write(Lang_Skin(179))
		Case Else response.write("&nbsp;")
		End Select 
		%></td>
	    <%End If%>
		<td class="classrow"><%=FormatNumber2(FsoItem.size/1024)%> KB</td>
		<td class="classrow"><%=FsoItem.datelastmodified%></td>
		<td class="classrow"><%if InStr("asp,xsl,xml,txt,css,htm,yle,.js",FileExt) > 0 Then%><a href="?action=s_edit&template=<%=template%>&s_name=<%=server.urlencode(s_name)%>&path=<%=path&Path_mid%>&filename=<%=FsoItem.name%>"><img src="images/icon_edit.gif" border="0" align="absmiddle" title="<%=Lang_sys(51)%>" width="16" height="16"></a><%If path="template" and (InStr("adv.htm,head.htm,foot.htm,nav.htm,banner.htm",FsoItem.name)=0) Then%>&nbsp;&nbsp;<a href="admin_skin_save.asp?template=<%=template%>&s_name=<%=server.urlencode(s_name)%>&path=<%=path%>&filename=<%=FsoItem.name%>&mes_type=0"><img src="images/icon_savefile.gif" border="0" align="absmiddle" title="<%=Lang_Skin(95)%>" width="16" height="16"></a><%End If%><%Else%><a href="javascript:tipsWindown('<%=Lang_Skin(77)%>','iframe:admin_skin.asp?action=s_view&filename=<%=filename%>','800','222','true','','true','text');"><img src="images/icon_view.gif" border="0" align="absmiddle" title="<%=Lang_sys(59)%>" width="16" height="16"></a><%End If%></td>
    </tr>
	<%Next%>
<%
Set Fso=Nothing
Set FsoFolder=Nothing
Set Fsocontent=Nothing
%>
<tr>
<td class="classfooter" colspan="5" align="right" height="30">
<input type="image" name="button" title=" <%=Lang_sys(3)%> " onclick="javascript:history.back();" src="lang/<%=LangFilePath%>/images/bt_bak.gif">
</td>
</tr>
</table>
<script>tdshow("list");</script>
<%
End Sub

Sub s_edit()
	Dim filename,fso,TruePath
	template = safereplace(request("template"))
	s_name = safereplace(request("s_name"))
	filename = safereplace(request("filename"))
	path = safereplace(request("path"))
	If Right(path,1) = "/" Then path = CutText(path,0,1)
%>
<script>
function runscript(n){
	txtRun=n;window.open("../templates_view.asp","templates_view")
}
</script>
<script language="javascript" type="text/javascript" src="ckeditor/ckeditor.js"></script>
<table width="100%" border="0" cellspacing="0" cellpadding="0" id="edit" class="classtable">
<form method="post" action="?action=s_edit_ok">
<tr>
 <td height="30" class="classhead" align="left">
	<input name="submit" type="image" src="lang/<%=LangFilePath%>/images/bt_app.gif" title=" <%=Lang_sys(1)%> " align="absmiddle">&nbsp;<input type="image" src="lang/<%=LangFilePath%>/images/bt_res.gif" title=" <%=Lang_sys(2)%> " onclick="this.form.reset();return false;" align="absmiddle"><input type="hidden" name="template" value="<%=template%>"><input type="hidden" name="s_name" value="<%=s_name%>"><input type="hidden" name="filename" value="<%=filename%>"><input type="hidden" name="path" value="<%=path%>"><input type="hidden" name="htmlstate" value="<%=htmlstate%>">
 </td>
 <td align="right" class="classhead"><%=QuickMenu("","")%></td>
</tr>
<tr>
  <td class="classtop" colspan="2" height="30"><a href="?action=s_list&template=<%=template%>&s_name=<%= server.urlencode(s_name) %>"><%= s_name %></a> > <%If path <> "" Then%><a href="?action=s_list&template=<%=template%>&s_name=<%= server.urlencode(s_name) %>&path=<%= path %>"><%= s_name &"/"& path %></a> > <%End If%><%= filename %>
</td>
</tr>
<tr class="classrow">
    <td class="classrow" height="30" height="30">◎ <%=Lang_Skin(169)%></td>
	<td class="classrow" align="right"></td>
</tr>
<tr class="classrow">
<td class="classrow" colspan="2">
		<textarea cols="102" rows="24" id="filecontent" name="filecontent" class="html"><%
		If path <> "" Then 
			Response.write(server.htmlencode(LoadFile("../skins/"& template &"/"& path &"/"& filename)))
		Else
			Response.write(server.htmlencode(LoadFile("../skins/"& template &"/"& filename)))
		End If 
		%></textarea>
		<%If htmlstate = 0 Then%>
		<script type="text/javascript">
		CKEDITOR.replace('filecontent',{height:400});
		</script>
		<%Else%>
		 <br /><a href="javascript:u_Size(-10,'filecontent')"><img src="lang/<%=LangFilePath%>/images/tab/bt_close.gif" border='0'></a>
		 <a href="javascript:u_Size(10,'filecontent')"><img src="lang/<%=LangFilePath%>/images/tab/bt_open.gif" border='0'></a>
		<%End If%>
</td>
</tr>
<tr>
<td class="classfooter" colspan="2" align="left" height="30">
<input name="submit" type="image" src="lang/<%=LangFilePath%>/images/bt_app.gif" title=" <%=Lang_sys(1)%> ">&nbsp;<input type="image" src="lang/<%=LangFilePath%>/images/bt_res.gif" title=" <%=Lang_sys(2)%> " onclick="reset();return false;">
</td>
</tr>
</form>
</table>
<script>tdshow("edit");</script>
<%
End Sub

Sub s_view()
	filename = safereplace(request("filename"))
	fileext = LCase(Right(filename,3))
%>
<table width="100%" border="0" cellspacing="0" cellpadding="0" id="edit" class="classtable">
<tr class="classrow">
<td class="classrow" colspan="2">
	<%
	Select Case fileext 
	Case "jpg","gif","bmp","png","peg"
	response.write("<img src="""& filename &""" />")
	Case "swf","fla"
	response.write("<object classid=""clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"" codebase=""http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"" style="""" width=""800"" height=""200""><param name=""movie"" value="""& filename &""" /><param name=""quality"" value=""high"" /><param name=""menu"" value=""false"" /><param name=""wmode"" value=""opaque"" /><embed src="""& filename &""" wmode=""opaque"" quality=""high"" width=""800"" height=""200"" type=""application/x-shockwave-flash"" pluginspage=""http://www.macromedia.com/go/getflashplayer"" /></object>")
	End Select 
	%>
</td>
</tr>
</table>
<script>tdshow("edit");</script>
<%End Sub%>