<!--#include file="Top.asp" -->
<%
GetErrInfo=" 【提示：下面是您保存过的列表,您可以选择一个您喜欢的HTML,然后点应用,即可!】"
IF CblogObj.FormRequest("action")="update" And CblogObj.FormRequest("template")<>"" Then
	Dim template,Reg,Templatetop,i,b
	b=CblogObj.FormRequest("template")
	Templatetop=chr(60)&"!--#include file=""../../INC/config.asp"" --"&chr(62)&chr(13)
	Templatetop=Templatetop&chr(60)&"!--#include file=""setup.asp"" --"&chr(62)&chr(13)
	Templatetop=Templatetop&chr(60)&"!--#include file=""../../inc/ubbcode.asp"" --"&chr(62)&chr(13)
	IF CblogObj.FormRequest("Submit")="应用" Then
		For I=0 to 1
			IF i=0 Then
				Template=CblogObj.GetTxt(CblogObj.GetUpLoadDir(Session("UserID"))&"/Template/"&b&"/default.html")
			Else
				Template=CblogObj.GetTxt(CblogObj.GetUpLoadDir(Session("UserID"))&"/Template/"&b&"/show.html")
			End IF
			Set Reg=New RegExp
			Reg.IgnoreCase =true
			Reg.Global=True
			Reg.Pattern="(Runatr=Server>)"
			Template=Reg.Replace(Template,"")
			Reg.Pattern="(Runatr="&chr(34)&"Server"&chr(34)&">)"
			Template=Reg.Replace(Template,"")
			Reg.Pattern="Runatr=(.[^>]*)Server"
			Template=Reg.Replace(Template,"")
			Template=replace(Template,chr(60)&chr(37),"&lt;%")
			Template=replace(Template,chr(37)&chr(62),"%&gt;")
			'以上为安全过滤
			reg.Pattern="("&chr(60)&"title"&chr(62)&"#blogname#"&chr(60)&"/title"&chr(62)&")"
			Template=reg.Replace(Template,chr(60)&"title"&chr(62)&chr(60)&"%=BlogName%"&chr(62)&chr(60)&"/title"&chr(62))
			reg.Pattern="(#blogname#)"
			Template=reg.Replace(Template,"<a href=""default.asp"">"&chr(60)&"%=BlogName%"&chr(62)&"</a>")
			reg.Pattern="(#blogtitle#)"
			Template=reg.Replace(Template,chr(60)&"%=BlogTitle%"&chr(62))
			reg.Pattern="(#Calendar#)"
			Template=reg.Replace(Template,chr(60)&"div id="&Chr(34)&"calendar"&Chr(34)&""&chr(62)&chr(60)&"/div"&chr(62)&Chr(13)&chr(60)&"script type="&chr(34)&"text/javascript"&chr(34)&" src="&chr(34)&"calendar.asp"&chr(34)&""&chr(62)&chr(60)&"/script"&chr(62))
			reg.Pattern="(#ByClass#)"
			Template=reg.Replace(Template,chr(60)&"!--#include file="&chr(34)&"byclass.html"&chr(34)&" --"&chr(62))
			reg.Pattern="(#ByMonth#)"
			Template=reg.Replace(Template,chr(60)&"!--#include file="&chr(34)&"bymonth.html"&chr(34)&" --"&chr(62))
			reg.Pattern="(#NewReply#)"
			Template=reg.Replace(Template,chr(60)&"!--#include file="&chr(34)&"newre.html"&chr(34)&" --"&chr(62))
			reg.Pattern="(#Link#)"
			Template=reg.Replace(Template,chr(60)&"!--#include file="&chr(34)&"link.html"&chr(34)&" --"&chr(62))
			reg.Pattern="(#Announcement#)"
			Template=reg.Replace(Template,chr(60)&"%=Announcement%"&chr(62))
			reg.Pattern="(#Statistics#)"
			Template=reg.Replace(Template,chr(60)&"%CBlogObj.Statistics(UserID)%"&chr(62))
			reg.Pattern="(#Aubot#)"
			Template=reg.Replace(Template,chr(60)&"%=About%"&chr(62))
			reg.Pattern="(#buluo#)"
			Template=reg.Replace(Template,chr(60)&"%CBlogObj.UserTb_BuoLuo(UserID)%"&chr(62))
			'以上为通用部份
			IF I=0 Then			
				reg.Pattern="(#do#)"
				Template=reg.Replace(Template,chr(60)&"!--#include file="&chr(34)&"../../inc/do.asp"&chr(34)&" --"&chr(62))
				reg.Pattern="(#title#)"
				Template=reg.Replace(Template,chr(60)&"%=title%"&chr(62))
				reg.Pattern="(#wh#)"
				Template=reg.Replace(Template,chr(60)&"%=wh%"&chr(62))
				reg.Pattern="(#zy#)"
				Template=reg.Replace(Template,chr(60)&"%=zy%"&chr(62))
				reg.Pattern="(#foot#)"
				Template=reg.Replace(Template,chr(60)&"%=foot%"&chr(62))
				reg.Pattern="(#loop#)"
				Template=reg.Replace(Template,chr(60)&"!--#include file="&chr(34)&"../../inc/loop.asp"&chr(34)&" --"&chr(62))
				Template=Templatetop & Template
				
					reg.Pattern="(iframe>)"
					Template=reg.Replace(Template,"iframe&gt;")
					reg.Pattern="(javascript)"
					Template=reg.Replace(Template,"<i>&#106avascript</i>")
					reg.Pattern="(jscript:)"
					Template=reg.Replace(Template,"<i>&#106script:</i>")
					reg.Pattern="(js:)"
					Template=reg.Replace(Template,"<i>&#106s:</i>")
					reg.Pattern="(</SCRIPT>)"
					Template=reg.Replace(Template,"&lt;/script&gt;")
					reg.Pattern="(<SCRIPT)"
					Template=reg.Replace(Template,"&lt;script")
					reg.Pattern="(\r\n){3,}"
					Template=reg.Replace(Template,"$1$1$1")
					reg.Pattern="(&lt;script language=""<i>&#106avascript</i>"" src=""../../inc/common.js"" type=""text/<i>&#106avascript</i>"">&lt;/script&gt;)"
					Template=reg.Replace(Template,"<script language=""javascript"" src=""../../inc/common.js"" type=""text/javascript""></script>")
					reg.Pattern="(&lt;script type=""text/<i>&#106avascript</i>"" src=""calendar.asp"">&lt;/script&gt;)"
					Template=reg.Replace(Template,"<script type=""text/javascript"" src=""calendar.asp""></script>")
					CblogObj.WriteStream CblogObj.GetDir(Session("UserID")) & "/default.asp",Template
			Else
				reg.Pattern="(#ArticlesTitle#)"
				Template=reg.Replace(Template,chr(60)&"%=title%"&chr(62))
				reg.Pattern="(#wh#)"
				Template=reg.Replace(Template,chr(60)&"%=wh%"&chr(62))
				reg.Pattern="(#UserBlogInfo#)"
				Template=reg.Replace(Template,chr(60)&"%=BlogInfo%"&chr(62))
				reg.Pattern="(#Foot#)"
				Template=reg.Replace(Template,chr(60)&"%=foot%"&chr(62))
				reg.Pattern="(#tag#)"
				Template=reg.Replace(Template,chr(60)&"%=tag%"&chr(62))
				reg.Pattern="(#comments#)"
				Template=reg.Replace(Template,chr(60)&"%Call comments%"&chr(62))
				Templatetop=Templatetop&chr(60)&"!--#include file=""../../inc/blogshow.asp"" --"&chr(62)&chr(13)
				Template=Templatetop & Template
				reg.Pattern="(iframe>)"
				Template=reg.Replace(Template,"iframe&gt;")
				reg.Pattern="(javascript)"
				Template=reg.Replace(Template,"<i>&#106avascript</i>")
				reg.Pattern="(jscript:)"
				Template=reg.Replace(Template,"<i>&#106script:</i>")
				reg.Pattern="(js:)"
				Template=reg.Replace(Template,"<i>&#106s:</i>")
				reg.Pattern="(</SCRIPT>)"
				Template=reg.Replace(Template,"&lt;/script&gt;")
				reg.Pattern="(<SCRIPT)"
				Template=reg.Replace(Template,"&lt;script")
				reg.Pattern="(\r\n){3,}"
				Template=reg.Replace(Template,"$1$1$1")
				reg.Pattern="(&lt;script language=""<i>&#106avascript</i>"" src=""../../inc/common.js"" type=""text/<i>&#106avascript</i>"">&lt;/script&gt;)"
				Template=reg.Replace(Template,"<script language=""javascript"" src=""../../inc/common.js"" type=""text/javascript""></script>")
				reg.Pattern="(&lt;script type=""text/<i>&#106avascript</i>"" src=""calendar.asp"">&lt;/script&gt;)"
				Template=reg.Replace(Template,"<script type=""text/javascript"" src=""calendar.asp""></script>")
				CblogObj.WriteStream CblogObj.GetDir(Session("UserID")) & "/show.asp",Template
			End IF
		Next
		CblogObj.GetHttpUrl("")
	ElseIf CblogObj.FormRequest("Submit")="删除" Then
		template=Server.MapPath (CblogObj.GetUpLoadDir(Session("UserID"))&"/template/" & CblogObj.FormRequest("template"))
		CblogObj.DelFolder template
		CblogObj.GetHttpUrl("")
		Set CblogObj=Nothing
	End IF
End IF
%>
<script language="javascript" src="../inc/js.js"></script>
<table width="99%" border="0" align="center" cellpadding="5" cellspacing="0">
  <tr> 
    <td height="30" bgcolor="#FFFFFF"><table width="650" border="0" align="right" cellpadding="0" cellspacing="0">
        <tr> 
          <td width="120" class="box3"> <div align="center"><a href="Template_Help.Asp">模板帮助</a></div></td>
          <td>-</td>
          <td width="120" class="box3"> <div align="center"><a href="Template_List.Asp">选择CSS样式</a></div></td>
          <td>-</td>
          <td width="120" class="box3"> <div align="center"><a href="Template_Decides.Asp">上传我的CSS</a></div></td>
          <td>-</td>
          <td width="120" class="box3"> <div align="center"><a href="Template_CssList.Asp">我的CSS列表</a></div></td>
          <td>-</td>
          <td width="120" class="box3"> <div align="center"><a href="Template_Highlevel.Asp">自定义HTML</a></div></td>
          <td>-</td>
          <td width="160" class="box3"> <div align="center"><a href="Template_HtmlList.Asp">我的HTML列表</a></div></td>
          <td>-</td>
          <td width="160" class="box3"> <div align="center"><a href="Template_Format.Asp">恢复默认样式</a></div></td>
        </tr>
      </table></td>
  </tr>
  <tr> 
    <td height="30" bgcolor="#FFFFFF" class="h1"><img src="img/GuestBook.gif" width="23" height="21"> 
      管理我自定义的Html样式 
      <hr size="0"></td>
  </tr>
  <tr> 
    <td valign="top" bgcolor="#FFFFFF" class="h1"> <table width="100%" border="0" cellspacing="0" cellpadding="10">
        <tr> 
          <td class="box"> <table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr> 
                <td width="2%" valign="middle"><img src="img/3.gif" width="16" height="16"></td>
                <td width="98%" valign="middle"><%=GetErrInfo%></td>
              </tr>
            </table></td>
        </tr>
        <tr height="5"> 
          <td height="5"></td>
        </tr>
      </table>
      <table width="100%" border="0" cellpadding="2" cellspacing="1" class="box2">
        <form name="form1" method="post" action="">
          <tr bgcolor="#666666"> 
            <td width="3%" bgcolor="#999999"><img src="img/page.gif" width="20" height="20"></td>
            <td width="97%" height="25" bgcolor="#999999"><font color="#FFFFFF">Html模板名称</font></td>
          </tr>
<%
Dim Fso,Moban,ObjFolder,ObjSubFolders,objSubFolder,nowpath,PPP
Set Fso=Server.CreateObject("Scripting.FileSystemObject")
Moban=server.MapPath(CblogObj.GetUpLoadDir(Session("UserID"))&"/Template/")
Set ObjFolder=Fso.GetFolder(Moban)
Set ObjSubFolders=ObjFolder.SubFolders
For Each objSubFolder in objSubFolders 
nowpath=trim(objSubFolder.name)
IF left(nowpath,4)="html" Then
%>
          <tr> 
            <td class="tr2"><input type="radio" name="template" value="<%=nowpath%>"></td>
            <td class="tr2"><%=MID(nowpath,5)%> <a href="<%=CblogObj.GetUpLoadDir(Session("UserID"))&"/Template/"&nowpath&"/default.html"%>"><font color="#990000">下载主模板</font></a> 
              <a href="<%=CblogObj.GetUpLoadDir(Session("UserID"))&"/Template/"&nowpath&"/show.html"%>"><font color="#990000">下载副模板</font></a> 
              (右键目标别存为)</td>
          </tr>
          <%
End IF
Next
%>
          <tr> 
            <td colspan="2"><div align="center"> 
                <input name="action" type="hidden" id="action" value="update">
                <input type="submit" name="Submit" value="应用">
                <input name="Submit" type="submit" id="Submit" value="删除">
              </div></td>
          </tr>
        </form>
      </table></td>
  </tr>
  <tr> 
    <td bgcolor="#FFFFFF">&nbsp;</td>
  </tr>
  <tr bgcolor="#0066CC" height="2"> 
    <td height="2"></td>
  </tr>
</table>


<!--#include file="Foot.asp" -->
