<%@ codepage ="936" %>
  <% 
	data_path="../../" 'ACC连接数据库路径，对SQL无效
	numid="101"
	dir="../err.asp" 
  %>
  <!--#include file="../../conn/conn.asp"-->
<!--#include file="../../inc/safe.asp"-->
  <!--#include file="../rolecheck.asp"-->

<%
  
if replace_text(request("id"))="" then
Response.write("<script >alert('对不起！参数传递错误！');history.back(-1);</script>")
response.End()
end if

 id=replace_text(request("id"))
 

action=request("action")
skinorder=request("skinorder")
if action="save" then
	sql="select * from Yixiang_userskin where id="&id&""
	set rs=server.Createobject("adodb.recordset")
	rs.open sql,conn,1,3
	if not rs.eof then 
		rs("userskinname")=Hope_htmlAll_urli(request("userskinname"),HOPE_InstallDir)
	    rs("skinpic")=Hope_htmlAll_urli(request("skinpic"),HOPE_InstallDir)
		if skinorder=0 or skinorder="" then 
		rs("skinmain")=Hope_htmlAll_urli(request("content"),HOPE_InstallDir)
		elseif skinorder=1 then 
		rs("skinuserlog")=Hope_htmlAll_urli(request("content"),HOPE_InstallDir)
		elseif skinorder=2 then 
		rs("SkinSupply")=Hope_htmlAll_urli(request("content"),HOPE_InstallDir)
		elseif skinorder=3 then 
		rs("SkinPtHall")=Hope_htmlAll_urli(request("content"),HOPE_InstallDir)
		elseif skinorder=4 then 
		rs("SkinPurInfo")=Hope_htmlAll_urli(request("content"),HOPE_InstallDir)
		elseif skinorder=5 then 
		rs("SkinCompanyInfo")=Hope_htmlAll_urli(request("content"),HOPE_InstallDir)
		elseif skinorder=6 then 
		rs("SkinCusApp")=Hope_htmlAll_urli(request("content"),HOPE_InstallDir)
		elseif skinorder=7 then 
		rs("SkinUnInfo")=Hope_htmlAll_urli(request("content"),HOPE_InstallDir)
		elseif skinorder=8 then 
		rs("SkinEmpInfo")=Hope_htmlAll_urli(request("content"),HOPE_InstallDir)
		elseif skinorder=9 then 
		rs("SkinCusMsg")=Hope_htmlAll_urli(request("content"),HOPE_InstallDir)
		elseif skinorder=10 then 
		rs("SkinCantact")=Hope_htmlAll_urli(request("content"),HOPE_InstallDir)
		
		end if 
		rs.update
		rs.close
		set rs=nothing
		response.write "<script language=javascript>alert('修改成功');history.back();</script>"
	end if 
end if 
 
 
'********************替换后台编辑器中的标签安装路径函数*****  start   *****************

 '^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 Function Yixiang_out(str,str1)
 
 result=ReplaceTest( "href=([\042\']{0,}(\s+)?)#HOPE_InstallDir#",str,"href=$1"&str1)
 result= ReplaceTest( "src=([\042\']{0,}(\s+)?)#HOPE_InstallDir#",result,"src=$1"&str1)
 result= ReplaceTest( "background=([\042\']{0,}(\s+)?)#HOPE_InstallDir#",result,"background=$1"&str1)
 yixiang_out=result
 
 End Function
 
 '^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 Function Yixiang_in(str,str1)

  result=ReplaceTest( "href=([\042\']{0,}(\s+)?)"&str1,str,"href=$1#HOPE_InstallDir#")
  result=ReplaceTest( "src=([\042\']{0,}(\s+)?)"&str1,result,"src=$1#HOPE_InstallDir#")
  result=ReplaceTest( "background=([\042\']{0,}(\s+)?)"&str1,result,"background=$1#HOPE_InstallDir#")
  yixiang_in=result
  
 End Function
 
'^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
'替换匹配函数
Function ReplaceTest(patrn,str,replStr) 

Dim regEx, str1 ' 建立变量。 
Set regEx = New RegExp ' 建立正则表达式。 
regEx.Pattern = patrn ' 设置模式。 
regEx.IgnoreCase = false ' 设置是否区分大小写。 
ReplaceTest = regEx.Replace(str, replStr) ' 作替换。 

End Function 


'^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
'匹配内容函数
 Function RegExpTest_url(patrn, strng)
 
   Dim regEx, Match, Matches   ' 建立变量。
   Set regEx = New RegExp   ' 建立正则表达式。
   regEx.Pattern = patrn   ' 设置模式。
   regEx.IgnoreCase = False   ' 设置是否区分字符大小写。
   regEx.Global = True   ' 设置全局可用性。
   Set Matches = regEx.Execute(strng)   ' 执行搜索。
   For Each Match in Matches   ' 遍历匹配集合。
   On Error Resume Next
   RetStr = RetStr & Match.Value&"|"
   Next
   RegExpTest_url = RetStr
   
 End Function

 '^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 '^^^^^^^^^^^^^^^^^^^^^^^^^^^  查出  ^^^  start   ^^^^^^^^^^^^^^^^^^^^^^^^^^^
'1.替换href=后的#HOPE_InstallDir#

 Function  Hope_htmlAll_href(str,str1)
    
    strInfo=RegExpTest_url("href=([\042\']{0,}(\s+)?)#HOPE_InstallDir#", str) '调用函数(RegExpTest)匹配出所有str变量中的标签
 
	If strInfo<>"" then
			arrInfo=Split(strInfo,"|")
			
			For i=0 To ubound(arrInfo)
			  str=yixiang_out( str,str1)
       		Next
						 
		End If
		 		
		Hope_htmlAll_href=str
  End Function

'^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

'2.替换src=后的#HOPE_InstallDir#

 Function  Hope_htmlAll_src(str,str1)
    
    strInfo=RegExpTest_url("src=([\042\']{0,}(\s+)?)#HOPE_InstallDir#", str) '调用函数(RegExpTest)匹配出所有str变量中的标签
 
	If strInfo<>"" then
			arrInfo=Split(strInfo,"|")
			
			For i=0 To ubound(arrInfo)
			  str=yixiang_out( str,str1)
       		Next
						 
		End If
		 		
		Hope_htmlAll_src=str
  End Function


'^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

 '3.替换background=后的#HOPE_InstallDir#

 Function  Hope_htmlAll_bg(str,str1)
    
    strInfo=RegExpTest_url("background=([\042\']{0,}(\s+)?)#HOPE_InstallDir#", str) '调用函数(RegExpTest)匹配出所有str变量中的标签
 
	If strInfo<>"" then
			arrInfo=Split(strInfo,"|")
			
			For i=0 To ubound(arrInfo)
			  str=yixiang_out( str,str1)
       		Next
						 
		End If
		 		
		Hope_htmlAll_bg=str
  End Function



'^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

'对查出来的模板中的#HOPE_InstallDir#进行安装路径的替换 

Function Hope_htmlAll_url(str,str1)

result=Hope_htmlAll_href(str,str1)  '替换href=后的
result=Hope_htmlAll_src(result,str1) '替换src=后的
result=Hope_htmlAll_bg(result,str1)   '替换background=后的

Hope_htmlAll_url=result

End Function 


'^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 '^^^^^^^^^^^^^^^^^^^^^^^^^^^  查出  ^^^  end   ^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 
  '^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 '^^^^^^^^^^^^^^^^^^^^^^^^^^^  存入  ^^^  start   ^^^^^^^^^^^^^^^^^^^^^^^^^^^
'1.替换href=后的安装路径为#HOPE_InstallDir#

 Function  Hope_htmlAll_hrefi(str,str1)
    
    strInfo=RegExpTest_url("href=([\042\']{0,}(\s+)?)"&str1, str) '调用函数(RegExpTest)匹配出所有str变量中的标签
 
	If strInfo<>"" then
			arrInfo=Split(strInfo,"|")
			
			For i=0 To ubound(arrInfo)
			  str=Yixiang_in( str,str1)
       		Next
						 
		End If
		 		
		Hope_htmlAll_hrefi=str
  End Function

'^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

'2.替换src=后的安装路径为#HOPE_InstallDir#

 Function  Hope_htmlAll_srci(str,str1)
    
    strInfo=RegExpTest_url("src=([\042\']{0,}(\s+)?)"&str1, str) '调用函数(RegExpTest)匹配出所有str变量中的标签
 
	If strInfo<>"" then
			arrInfo=Split(strInfo,"|")
			
			For i=0 To ubound(arrInfo)
			  str=Yixiang_in( str,str1)
       		Next
						 
		End If
		 		
		Hope_htmlAll_srci=str
  End Function


'^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

 '3.替换background=后的安装路径为#HOPE_InstallDir#

 Function  Hope_htmlAll_bgi(str,str1)
    
    strInfo=RegExpTest_url("background=([\042\']{0,}(\s+)?)"&str1, str) '调用函数(RegExpTest)匹配出所有str变量中的标签
 
	If strInfo<>"" then
			arrInfo=Split(strInfo,"|")
			
			For i=0 To ubound(arrInfo)
			  str=Yixiang_in( str,str1)
       		Next
						 
		End If
		 		
		Hope_htmlAll_bgi=str
  End Function



'^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

'对模板中的进行安装路径替换为#HOPE_InstallDir# 

Function Hope_htmlAll_urli(str,str1)

result=Hope_htmlAll_hrefi(str,str1)  '替换href=后的
result=Hope_htmlAll_srci(result,str1) '替换src=后的
result=Hope_htmlAll_bgi(result,str1)   '替换background=后的

Hope_htmlAll_urli=result

End Function 


'^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 '^^^^^^^^^^^^^^^^^^^^^^^^^^^  存入  ^^^  end   ^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 
 

'********************替换后台编辑器中的标签安装路径函数*****  end   ******************



 
%>




<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>修改模版</title>
<link rel="stylesheet" type="text/css" href="../css/style.css">
<style type="text/css">
<!--
.STYLE1 {color: #FF0000}

-->
</style>
</head>
<script LANGUAGE="JavaScript">
function check()
{
if (document.form.userskinname.value=="")
{
alert("模版名称！")
document.form.userskinname.focus()
document.form.userskinname.select()
return
}
if (document.form.skinpic.value=="")
{
alert("模版预览图片！")
document.form.skinpic.focus()
document.form.skinpic.select()
return
}

document.form.submit()
}

function displaybj(){

	if (document.all.tez.style.display=="none"){
		document.all.tez.style.display=""
	}else{
	document.all.tez.style.display="none"
	}
}
</script>
<table cellpadding="2" cellspacing="1" border="0" width="98%" class="tableBorder" align=center>
  <tr align="center">
    <th  height=25  align="center"><strong>用户模版管理</strong></th>
  </tr>
  <tr align="center">
    <td  height=25  align="left" class="forumRow">管理选项:<strong>　</strong><a href="admin_userskin.asp?action=showskin&ispass=1">通过审核的模板</a>　　<a href="admin_userskin.asp?action=showskin&ispass=0">未通过审核的模版</a></td>
  </tr>
</table> 
<%
sql="select * from Yixiang_userskin where id="&id
Set rs= Server.CreateObject("ADODB.Recordset")
rs.open sql,conn,1,1

%>
<form name="form" method="POST" action="admin_edit.asp">
<input type="hidden" name="skinorder" value=<%=skinorder%>>
<input type="hidden" name="action" value="save">
<input type="hidden" name="id" value="<%=rs("id")%>">
  <TABLE width="100%" border="0" align=center cellpadding="0" cellspacing="1" class="tableBorder"> 
    <tr> 
      <th height=25 colspan="2" class="tableHeaderText"><strong>修改<%if skinorder=0 or skinorder="" then 
	                                                                     response.Write "首页" 
																		 elseif skinorder=2 then 
																		  response.Write "供应信息"
																		  elseif skinorder=3 then 
																		   response.Write "产品展厅"
																		   elseif skinorder=4 then 
																		   response.Write "采购信息"
																		    elseif skinorder=5 then 
																		   response.Write "公司介绍"
																		    elseif skinorder=6 then 
																		   response.Write "客户评价"
																		    elseif skinorder=7 then 
																		   response.Write "展会信息"
																		    elseif skinorder=8 then 
																		   response.Write "招聘中心"
																		    elseif skinorder=9 then 
																		   response.Write "客户留言"
																		    elseif skinorder=10 then 
																		   response.Write "联系方式"
																		   end if 
																		    %>模版</strong></th> 
    </tr> 
    <TR ALIGN="center"> 
      <TD> <TABLE width="100%" border="0" cellpadding="5" cellspacing="2" bordercolorlight="#CEE7FF" bordercolordark="#CEE7FF" style="border-collapse: collapse"> 
          <TR> 
            <TD width="210" align="right" class="Forumrow"><b>模版名称：</b></TD> 
            <TD width="729" class="Forumrow"> <font color="#F4FAFF">
              <input name="userskinname" type="text" class="smallInput" value="<%=rs("userskinname")%>" size="55"> 
              </font></TD>
          </TR>  
          <TR> 
            <TD align="right" class="Forumrow"><b>模版预览图片： </b></TD> 
            <TD class="Forumrow"><input name="skinpic" type="text" class="smallInput" value="<%=rs("skinpic")%>" size="50"></TD> 
          </TR>
		  		  		  		  <TR>
		  <td class="Forumrow"></td> 
<TD class="Forumrow">
<table width="100%" border="0" cellspacing="0" cellpadding="0" id=adv style="DISPLAY: none">
  <tr>
    <td width="92%">
<IFRAME name="upload" MARGINHEIGHT=0 MARGINWIDTH=0 Frameborder=0 SCROLLING=no width=100% height=35 bordercolor="#f1f3f5" Src="AdvUploadPicture.asp"></IFRAME>	  </td>
  </tr>
</table></TD>
</TR> 
          <TR> 
           
            <TD class="Forumrow" colspan=2><textarea name="content" style="display:none">
			<% if skinorder=0 or skinorder="" then %>
			<%=Hope_htmlAll_url(rs("skinmain"),HOPE_InstallDir)%>
			<% elseif skinorder=1 then %>
			<%=Hope_htmlAll_url(rs("skinshowlog"),HOPE_InstallDir)%>
			<% elseif skinorder=2 then %>
			<%=Hope_htmlAll_url(rs("SkinSupply"),HOPE_InstallDir)%>
			<% elseif skinorder=3 then %>
			<%=Hope_htmlAll_url(rs("SkinPtHall"),HOPE_InstallDir)%>
			<% elseif skinorder=4 then %>
			<%=Hope_htmlAll_url(rs("SkinPurInfo"),HOPE_InstallDir)%>
			<% elseif skinorder=5 then %>
			<%=Hope_htmlAll_url(rs("SkinCompanyInfo"),HOPE_InstallDir)%>
			<% elseif skinorder=6 then %>
			<%=Hope_htmlAll_url(rs("SkinCusApp"),HOPE_InstallDir)%>
			<% elseif skinorder=7 then %>
			<%=Hope_htmlAll_url(rs("SkinUnInfo"),HOPE_InstallDir)%>
			<% elseif skinorder=8 then %>
			<%=Hope_htmlAll_url(rs("SkinEmpInfo"),HOPE_InstallDir)%>
			<% elseif skinorder=9 then %>
			<%=Hope_htmlAll_url(rs("SkinCusMsg"),HOPE_InstallDir)%>
			<% elseif skinorder=10 then %>
			<%=Hope_htmlAll_url(rs("SkinCantact"),HOPE_InstallDir)%>
			<% end if %>
			</textarea><table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td width="100%"><iframe ID="eWebEditor1" src="../../editor/ewebeditor.asp?id=content&style=standard&originalfilename=d_originalfilename &savefilename=d_savefilename &savepathfilename=d_savepathfilename" frameborder="0" scrolling="no" width="100%" HEIGHT="450"></iframe></td>
    
  </tr>
    <tr><td width="31%" height="24" align="left" valign="middle"><span class="STYLE1" onClick="return displaybj()"><img src="../../images/arrow.gif" width="12" height="13" >查看标记说明</span></td>
    </tr>
  <tr><td width="31%" align="left" valign="top" id=tez style="display:none"><textarea cols="50" rows="30" readonly>标记说明
网站URL---------------#weburl#
网站名----------------#webname#
网站logo--------------#weblogo#
网站shoplogo----------#webshoplogo#
企业名称--------------#shopname#
企业logo--------------#shoplogo#
企业介绍--------------#shopabouts#
企业图片介绍----------#shopimgabouts#
特价产品--------------#productsselected#
最新供应--------------#supplymew#
会员编号--------------#vip_bh# 
指数------------------#vip_rz_fs# 
企业认证时间----------#vip_rz_sj# 
经验值----------------#vip_jlz#
VIP时间---------------#vip_sysj#
证书及荣誉 -----------#vip_zs#
经营许可证------------#vip_gj#
产品类证书------------#vip_jc#
税务登记证------------#vip_sw#
其它证书--------------#vip_qt#
会员评价好评----------#vip_pj#
会员评价中评----------#vip_zp#
会员评价差评----------#vip_cp#
产品导行--------------#Shop_class#
会员模板底部标签--------------#buttominfo# 
会员等级名称-------------------#vip_grade#
   </textarea></td></tr>
</table>
</TD> 
          </TR> 
          <TR height="40"> 
            <TD colspan="2" align="center" class="Forumrow" height="40">
              <input type="button" name="Submit" value=" 提　交 保 存" class="smallInput" onClick="check()">
			  &nbsp;&nbsp;&nbsp; 
            <input type="reset" name="Submit2" value=" 重　新 添 写" class="smallInput">          </TR> 
      </TABLE></TD> 
    </TR> 
  </TABLE> 
</FORM> 

<%
rs.close
set rs=nothing
conn.close
set conn=nothing
%>
<!--#include file="../copy.asp" -->