
<%
'##################################################################                                                                 
'★         web08.net - 威博购物系统                                              
'★  版权所有: web08.net                                                                                                       
'★  程序制作: 威博网络技术公司                                     
'★           email:web08net@hotmail.com                           
'★            Q Q :645095280,475980829
'★	       电话:021-55520018                                                                                                         
'★  相关网址: [产品介绍] http://www.021web.com.cn/gwxt.html
'★            [支持论坛] http://bbs.web08.net/                                                                                     
'★  主页地址: http://www.web08.net/  
'★		http://www.021web.com.cn/			                                                                 
'###################################################################
%>
<%
'###########################
'+ 二级目录初始化数据专用
'#############################
 Function CreateSiteConfig()
	Conndb
	
	set rec=server.createobject("adodb.recordset")
	sql="select * from Web_Webconfig where id=1"
	rec.open sql,conn,1,3
	cc_description=replace(trim(rec("W_webdescription")),chr(10),"")
	cc_description=replace(cc_description,chr(13),"")
	cc_description=replace(cc_description,chr(9),"")
	cc_keywords=replace(trim(rec("w_webkeyword")),chr(13),"")
	cc_keywords=replace(cc_keywords,chr(10),"")
	cc_keywords=replace(cc_keywords,chr(9),"")
	tmp=GetFileContent("..\..\template\config.asp")
	tmp=replace(tmp,"{$webname}",trim(rec("w_webname")))
	tmp=replace(tmp,"{$company}",trim(rec("w_company")))
	tmp=replace(tmp,"{$weburl}",trim(rec("w_weburl")))
	tmp=replace(tmp,"{$webdescription}",cc_description)
	tmp=replace(tmp,"{$webkeyword}",cc_keywords)
	tmp=replace(tmp,"{$webtitle}",trim(rec("w_webtitle")))
	tmp=replace(tmp,"{$linkman}",trim(rec("w_linkman")))
	tmp=replace(tmp,"{$telphone}",trim(rec("w_telphone")))
	tmp=replace(tmp,"{$mobile}",trim(rec("W_mobile")))
	tmp=replace(tmp,"{$setupfolder}",trim(rec("w_setupfolder")))
	'tmp=replace(tmp,"{$style}",trim(rec("style")))
	tmp=replace(tmp,"{$webemail}",trim(rec("w_webemail")))
	tmp=replace(tmp,"{$OpenFlag}",trim(rec("W_OpenFlag")))
	tmp=replace(tmp,"{$webaddr}",trim(rec("W_webaddr")))
        tmp=replace(tmp,"{$webpost}",trim(rec("W_webpost"))) 
	tmp=replace(tmp,"{$logo}",trim(rec("w_LOGO")))
	rec.close
	set rec=server.createobject("adodb.recordset")
	sql="select * from Web_Template where T_UseFlag=1"
	rec.open sql,conn,1,3
	if rec.eof then
		call Web_C_ReMessage("没有默认模版,请开启一个模版",1,"../template/templateManage.asp")
	else
		tmp=replace(tmp,"{$C_site}",trim(rec("t_site")))
		tmp=replace(tmp,"{$C_ms}",trim(rec("t_ms")))
		tmp=replace(tmp,"{$C_ms_class}",trim(rec("T_proclass")))
		tmp=replace(tmp,"{$C_ms_bigclass}",trim(rec("T_bigproclass")))
		tmp=replace(tmp,"{$C_ms_detail}",trim(rec("T_product")))
		tmp=replace(tmp,"{$C_as}",trim(rec("t_as")))
		tmp=replace(tmp,"{$C_as_class}",trim(rec("T_articleclass")))
		tmp=replace(tmp,"{$C_as_bigclass}",trim(rec("T_Bigarticleclass")))
		tmp=replace(tmp,"{$C_as_detail}",trim(rec("T_article")))
		tmp=replace(tmp,"{$C_gs}",trim(rec("t_gs")))
		tmp=replace(tmp,"{$C_gs_class}",trim(rec("T_gsclass")))
		tmp=replace(tmp,"{$C_gs_detail}",trim(rec("T_gsdetail")))
		tmp=replace(tmp,"{$C_gsprovince}",trim(rec("t_gsprovince")))
		tmp=replace(tmp,"{$C_gscity}",trim(rec("t_gscity")))
		tmp=replace(tmp,"{$C_notice}",trim(rec("t_notice")))
		tmp=replace(tmp,"{$C_helpclass}",trim(rec("t_helpclass")))
		tmp=replace(tmp,"{$C_help}",trim(rec("t_help")))
		tmp=replace(tmp,"{$C_active}",trim(rec("T_Activedetail")))
		tmp=replace(tmp,"{$C_daogou}",trim(rec("T_DaoGouDetail")))
		tmp=replace(tmp,"{$C_gift}",trim(rec("T_Giftdetail")))
		tmp=replace(tmp,"{$C_brand}",trim(rec("T_Branddetail")))
		tmp=replace(tmp,"{$C_feel}",trim(rec("T_FeelDetail")))
		tmp=replace(tmp,"{$C_Benefit}",trim(rec("T_BenefitDetail")))
	end if
	rem set path
	folderpath=folderexist("../../inc")
	path="../../inc/config.asp"
	call save_file(tmp,path)
	rec.close : set rec=nothing		
  End Function
'###########################
'+ js路径配置
'#############################
 Function Createallajax()
'生成ajax
	tmp=GetFileContent("..\..\template\Web_All_Ajax.tpl")
	tmp=replace(tmp,"{$rootpath}",Web_C_setupfolder)
	folderpath=folderexist("../../ajax")
	path="../../ajax/Web_All_Ajax.js"
	call save_file(tmp,path)
'生成浮动对联广告js
	tmp_js=GetFileContent("..\..\template\doublefloat.tpl")
	tmp_js=replace(tmp_js,"{$rootpath}",Web_C_setupfolder)
	folderpath_js=folderexist("../../systemad/CreateJs")
	path_js="../../systemad/CreateJs/doublefloat.js"
	call save_file(tmp_js,path_js)
'生成对比js
	tmp_c_js=GetFileContent("..\..\template\ProductCompare.tpl")
	tmp_c_js=replace(tmp_c_js,"{$rootpath}",Web_C_setupfolder)
	folderpath_c_js=folderexist("../../js")
	path_c_js="../../js/ProductCompare.js"
	call save_file(tmp_c_js,path_c_js)
'生成css
	tmp_css=GetFileContent("..\..\template\lightbox.tpl")
	tmp_css=replace(tmp_css,"{$rootpath}",Web_C_setupfolder)
	folderpath_css=folderexist("../../js/photojs/pic-css")
	path_css="../../js/photojs/pic-css/lightbox.css"
	call save_file(tmp_css,path_css)
'生成评论调用
	tmp_css=GetFileContent("..\..\template\usermsgajax.tpl")
	tmp_css=replace(tmp_css,"{$rootpath}",Web_C_setupfolder)
	folderpath_css=folderexist("../../ajax")
	path_css="../../ajax/usermsgajax.js"
	call save_file(tmp_css,path_css)
'生成留言
	tmp_css=GetFileContent("..\..\template\msgajax.tpl")
	tmp_css=replace(tmp_css,"{$rootpath}",Web_C_setupfolder)
	folderpath_css=folderexist("../../ajax")
	path_css="../../ajax/msgajax.js"
	call save_file(tmp_css,path_css)
	call create_webad()
 End Function
'################
'更新模版
'################
 sub web_set(sitepath)
	sitepath=Web_Get_RootDir(sitepath)
	conndb
	setupfolder=getonevalue("web_webconfig","W_setupfolder","id=1")
	if setupfolder<>sitepath then
			set rs_tp=server.createobject("adodb.recordset")
			rs_sql="select * from Web_Template where T_UseFlag=1"
			rs_tp.open rs_sql,conn,1,3
			if rs_tp.eof then
				call Web_C_ReMessage("没有默认模版",3,"")
			end if
		if sitepath="" or sitepath="/" then
				rs_tp("T_site")=replace(trim(rs_tp("T_site")),""&setupfolder&"template","/template")
				rs_tp("T_ms")=replace(trim(rs_tp("T_ms")),""&setupfolder&"template","/template")
				rs_tp("T_proclass")=replace(trim(rs_tp("_proclass")),""&setupfolder&"template","/template")
				rs_tp("T_bigproclass")=replace(trim(rs_tp("T_bigproclass")),""&setupfolder&"template","/template")
				rs_tp("T_product")=replace(trim(rs_tp("T_product")),""&setupfolder&"template","/template")
				rs_tp("T_gs")=replace(trim(rs_tp("T_site")),""&setupfolder&"template","/template")
				rs_tp("T_gsclass")=replace(trim(rs_tp("T_gsclass")),""&setupfolder&"template","/template")
				rs_tp("T_gsdetail")=replace(trim(rs_tp("T_gsdetail")),""&setupfolder&"template","/template")
				rs_tp("T_gsprovince")=replace(trim(rs_tp("T_gsprovince")),""&setupfolder&"template","/template")
				rs_tp("T_gscity")=replace(trim(rs_tp("T_gscity")),""&setupfolder&"template","/template")
				rs_tp("T_as")=replace(trim(rs_tp("T_as")),""&setupfolder&"template","/template")
				rs_tp("T_Bigarticleclass") =replace(trim(rs_tp("T_Bigarticleclass")),""&setupfolder&"template","/template")
				rs_tp("T_articleclass")=replace(trim(rs_tp("T_articleclass")),""&setupfolder&"template","/template")
				rs_tp("T_article")=replace(trim(rs_tp("T_site")),""&setupfolder&"template","/template")
				rs_tp("T_Notice")=replace(trim(rs_tp("T_Notice")),""&setupfolder&"template","/template")
				rs_tp("T_Help")=replace(trim(rs_tp("T_Help")),""&setupfolder&"template","/template")
				rs_tp("T_Helpclass")=replace(trim(rs_tp("T_Helpclass")),""&setupfolder&"template","/template")
				rs_tp("T_branddetail")=replace(trim(rs_tp("T_branddetail")),""&setupfolder&"template","/template")
				rs_tp("T_DaoGouDetail")=replace(trim(rs_tp("T_DaoGouDetail")),""&setupfolder&"template","/template")
				rs_tp("T_Giftdetail")=replace(trim(rs_tp("T_Giftdetail")),""&setupfolder&"template","/template")
				rs_tp("T_Activedetail")=replace(trim(rs_tp("T_Activedetail")),""&setupfolder&"template","/template")
				rs_tp("T_FeelDetail")=replace(trim(rs_tp("T_FeelDetail")),""&setupfolder&"template","/template")
				rs_tp("T_BenefitDetail")=replace(trim(rs_tp("T_BenefitDetail")),""&setupfolder&"template","/template")
	
		else
				rs_tp("T_site")=replace(trim(rs_tp("T_site")),"/template",""&sitepath&"template")
				rs_tp("T_ms")=replace(trim(rs_tp("T_ms")),"/template",""&sitepath&"template")
				rs_tp("T_proclass")=replace(trim(rs_tp("_proclass")),"/template",""&sitepath&"template")
				rs_tp("T_bigproclass")=replace(trim(rs_tp("T_bigproclass")),"/template",""&sitepath&"template")
				rs_tp("T_product")=replace(trim(rs_tp("T_product")),"/template",""&sitepath&"template")
				rs_tp("T_gs")=replace(trim(rs_tp("T_site")),"/template",""&sitepath&"template")
				rs_tp("T_gsclass")=replace(trim(rs_tp("T_gsclass")),"/template",""&sitepath&"template")
				rs_tp("T_gsdetail")=replace(trim(rs_tp("T_gsdetail")),"/template",""&sitepath&"template")
				rs_tp("T_gsprovince")=replace(trim(rs_tp("T_gsprovince")),"/template",""&sitepath&"template")
				rs_tp("T_gscity")=replace(trim(rs_tp("T_gscity")),"/template",""&sitepath&"template")
				rs_tp("T_as")=replace(trim(rs_tp("T_as")),"/template",""&sitepath&"template")
				rs_tp("T_Bigarticleclass") =replace(trim(rs_tp("T_Bigarticleclass")),"/template",""&sitepath&"template")
				rs_tp("T_articleclass")=replace(trim(rs_tp("T_articleclass")),"/template",""&sitepath&"template")
				rs_tp("T_article")=replace(trim(rs_tp("T_site")),"/template",""&sitepath&"template")
				rs_tp("T_Notice")=replace(trim(rs_tp("T_Notice")),"/template",""&sitepath&"template")
				rs_tp("T_Help")=replace(trim(rs_tp("T_Help")),"/template",""&sitepath&"template")
				rs_tp("T_Helpclass")=replace(trim(rs_tp("T_Helpclass")),"/template",""&sitepath&"template")
				rs_tp("T_branddetail")=replace(trim(rs_tp("T_branddetail")),"/template",""&sitepath&"template")
				rs_tp("T_DaoGouDetail")=replace(trim(rs_tp("T_DaoGouDetail")),"/template",""&sitepath&"template")
				rs_tp("T_Giftdetail")=replace(trim(rs_tp("T_Giftdetail")),"/template",""&sitepath&"template")
				rs_tp("T_Activedetail")=replace(trim(rs_tp("T_Activedetail")),"/template",""&sitepath&"template")
				rs_tp("T_FeelDetail")=replace(trim(rs_tp("T_FeelDetail")),"/template",""&sitepath&"template")
				rs_tp("T_BenefitDetail")=replace(trim(rs_tp("T_BenefitDetail")),"/template",""&sitepath&"template")
			rs.update
			rs.close
			
		end if
		set rs_tmp=conn.execute("select * from Web_Template where T_UseFlag=1")
			conn.execute("update Web_Product set Templet='"&rs_tmp("T_product")&"'")
			conn.execute("update Web_Proclass set Templet='"&rs_tmp("T_bigproclass")&"' where fid=0")
			conn.execute("update Web_Proclass set Templet='"&rs_tmp("T_proclass")&"' where fid<>0")
			conn.execute("update Web_Article set Templet='"&rs_tmp("T_article")&"'")
			conn.execute("update Web_ArticleClass set Templet='"&rs_tmp("T_Bigarticleclass")&"' where fid=0")
			conn.execute("update Web_ArticleClass set Templet='"&rs_tmp("T_articleclass")&"' where fid<>0")
			conn.execute("update Web_Brand set Templet='"&rs_tmp("T_Branddetail")&"'")
			conn.execute("update web_guidepro set Templet='"&rs_tmp("T_DaoGouDetail")&"'")
			conn.execute("update Web_Help set Templet='"&rs_tmp("T_Help")&"'")
			conn.execute("update Web_HelpClass set Templet='"&rs_tmp("T_Helpclass")&"'")
			conn.execute("update Web_Notice set Templet='"&rs_tmp("T_Notice")&"'")
			rs_tmp.close
			call create_webad()
	end if
	

end sub
'################
'重新生成广告
'################
sub create_webad()
	conndb
	set rs=conn.execute("select * from web_ad")
	do while not rs.eof 
		str_AdType=rs("AdType")
		lng_TempAdID=rs("adid")
		if rs("adhdpflag")=1 then
 			call 	gethdpadfunc(str_AdType,lng_TempAdID) 
		else
			 call 	getadfunc(str_AdType,lng_TempAdID)
		end if
	rs.movenext
	loop
	rs.close		
 end sub
%>