
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<%Option explicit
Response.CodePage=936
Response.Charset="gb2312"
Response.ContentType="text/html"%>
<!--#INCLUDE file="inc/main_Function.asp"-->
<!--#INCLUDE file="inc/MD5.asp"-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>程序安装</title>
<style>
body { font-size:12px; line-height:2; font-family:Verdana;}

h1,h2,h3,h4,h5,h6 { margin:0; padding:0; font-weight:normal;}
a { color:#05a; text-decoration:none;}
a:hover { color:#f00; text-decoration:underline;}
#layout { width:598px; margin:30px auto; border:1px solid #ccc; background:url(images/top_bg.gif) 2px 2px no-repeat;}
#layout h5 { height:26px; padding:30px 15px 0 0; font-size:12px; text-align:right; color:#666;}
.box { padding:0 30px 30px 30px;}
.box h2 { font-size:20px; font-family:"microsoft yahei","黑体"; margin:20px 0 10px 0;}
.box h4 { font-size:12px; background:url(images/icon111.gif) 0 5px no-repeat; padding-left:22px; margin-bottom:20px; color:#C63;}
.t_list { color:#666;}
.t_list tr td { padding:5px;}
.btn05 { width:87px; height:32px; border:1px solid #87a3c1; background:url(images/btn01.gif); color:#555; font-size:16px; line-height:180%; cursor:pointer; font-weight:bold;}
.btn06 { width:87px; height:32px; border:1px solid #a2904d; background:url(images/btn01.gif) 　0　-64px; color:#630; font-size:16px; line-height:180%; cursor:pointer; font-weight:bold;}
.input_txt { width:201px; height:18px; padding:5px 0 0 3px; border-top:1px solid #898989; border-left:1px solid #898989; border-right:1px solid #ddd; border-bottom:1px solid #ddd;}
#inst_ok { background:url(images/notify_icon_ok.gif) 170px 65px no-repeat; padding:60px 0 60px 220px;}
#inst_ok h1 { font-size:22px; font-family:"microsoft yahei","黑体"; }
#inst_err{ padding:10px;}
#inst_err h1{padding:10px;font-family:"microsoft yahei","黑体"; line-height:130%; padding-top:50px;}
#inst_err b{ color:#F00}
.errmsgs{background-color:#FCF;height:65px;text-align:center;line-height:30px;border:1px solid #F00;position:absolute;top:0;}
</style>
</head>

<body>
<div id="layout">
<h5>智能标签 1.0 如家连锁版 2012-2-8</h5>
<%Dim MsgStr,CheckErr,FU,Action,v,mshttp,webpath,webpathB,dom,root,note,nowstep,checkobjs,checkstrs
mshttp="MSXML2.ServerXMLHTTP"
nowstep="0"
checkobjs=false
const odebug=false
const oiscache=false
Set dom=new XMLClass
if not dom.OpenXml("step.xml") then
	set root=dom.CreateNew("data")
	set note=dom.AddNode("step",root)
	dom.AddAttribute "s",1,note
	dom.AddAttribute "v",0,note
	set note=dom.AddNode("step",root)
	dom.AddAttribute "s",2,note
	dom.AddAttribute "v",0,note
	set note=dom.AddNode("step",root)
	dom.AddAttribute "s",3,note
	dom.AddAttribute "v",0,note
	dom.SaveAsXML server.MapPath("step.xml")
else
	dim i,Rst
	set Rst=dom.FindNodes("step")
	for i=0 to dom.Length-1
		if dom.GetAtt("v",Rst(i))="1" Then
			nowstep=dom.GetAtt("s",Rst(i))
		End If
	Next
End If
checkstrs="FSO文件读写删除:"&ObjectTest("Scripting.FileSystemObject")&"&nbsp;&nbsp;ADO 数据库访问对象:"&ObjectTest("adodb.connection")&"&nbsp;&nbsp;数据库操作:"&ObjectTest("ADOX.Catalog")&"&nbsp;&nbsp;无组件上传支持:"&ObjectTest("Adodb.Stream")&"&nbsp;&nbsp;HTTP 组件:"&ObjectTest("Microsoft.XMLHTTP")
if checkobjs Then response.Write("<div class=""errmsgs"">"&checkstrs&"<br>以上组件必须全部支持才可以运行本程序！请联系空间提供商或者从新配置服务器</div><style>#layout{margin:80px auto;</style>")
webpath = Left(LCase(Request.ServerVariables("SCRIPT_NAME")), InStrRev(LCase(Request.ServerVariables("SCRIPT_NAME")), "/") )
webpathB = Left(webpath, InStrRev(webpath, "/"))
webpath = server.MapPath(webpathB)
Action=request.QueryString("action")
Set v=new Validator
Set FU=new Main_function

If Action="" Then
	select case nowstep
	case "1":Action="StepTwo"
	case "2":Action="StepThree"
	End Select
End If

CheckErr = False
Select Case Action
Case "StepTwo":Call StepTwo()
Case "StepThree":Call StepThree()

Case "one":Call Do_StepOne()
Case "two":Call Do_StepTwo()
Case "three":Call Do_StepThree()
Case "four":Call Do_StepFour()
Case Else:Call StepOne()
End Select

If CheckErr Then
	Response.Write("<script>alert('"&MsgStr&"');history.back();</script>")
	Response.End()
ElseIf MsgStr<>"" Then
	Response.Redirect(MsgStr)
End If
Set v=Nothing
set fu=nothing
set dom=nothing
Sub StepOne()
%>
<div class="box">
<form name="myform" method="post" action="?action=one">
<h2>第一步：数据库安装</h2><h4>如果您不懂下面所设置的是什么，使用默认值，按下一步就可以了,此设置不影响您日常后台操作</h4>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="t_list">
  <tr>
    <td width="169" align="right">设置基本数据库名称：</td>
    <td width="217">
      <input name="data(0)" type="text" class="input_txt" value="<%=makePassword(20)%>" />
    </td>
    <td width="150">&nbsp;</td>
  </tr>
    <tr>
    <td width="169" align="right">设置酒店数据库名称：</td>
    <td width="217">
      <input name="data(6)" type="text" class="input_txt" value="<%=makePassword(20)%>" />
    </td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td align="right">设置表名称</td>
    <td>&nbsp;<font color="red">每个表名不能相同！</font></td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td align="right">会员表：</td>
    <td><input name="data(1)" type="text" class="input_txt" value="<%=makePassword(10)%>" /></td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td align="right">文章表：</td>
    <td><input name="data(2)" type="text" class="input_txt" value="<%=makePassword(10)%>" /></td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td align="right">友情链接表：</td>
    <td><input name="data(3)" type="text" class="input_txt" value="<%=makePassword(10)%>" /></td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td align="right">广告表：</td>
    <td><input name="data(5)" type="text" class="input_txt" value="<%=makePassword(10)%>" /></td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td align="right">网站设置表：</td>
    <td><input name="data(4)" type="text" class="input_txt" value="<%=makePassword(10)%>" /></td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td align="right">热点搜索表：</td>
    <td><input name="data(7)" type="text" class="input_txt" value="<%=makePassword(10)%>" /></td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td align="right">页面关键字表：</td>
    <td><input name="data(8)" type="text" class="input_txt" value="<%=makePassword(10)%>" /></td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td align="right">&nbsp;</td>
    <td align="center"><input name="submit2" class="btn05" onMouseOver="this.className='btn06'" onMouseOut="this.className='btn05'" type="submit" value=" 下一步 " /></td>
    <td>&nbsp;</td>
  </tr>
</table>
</form>
</div>
  <%End Sub
Sub Do_StepOne()
	Dim dbStr,i
	For i=0 To 8
		If Request("data("&i&")")="" Or v.Islaw(Request("data(0)"))=false Then CheckErr=True:MsgStr="请您输入合法的数据库和表名称！长度为5-20位！\n数字或字母或下划线或中横线."
		dbStr=dbStr&Trim(Request("data("&i&")"))&","
	Next
	If CheckErr=False Then
		CreatDB(dbStr)
		MsgStr="?action=StepTwo"
	End If
End Sub

Sub StepTwo()
Dim installpath,weburl
		installpath = Left(LCase(Request.ServerVariables("SCRIPT_NAME")), InStrRev(LCase(Request.ServerVariables("SCRIPT_NAME")), "/") )
		installpath = Left(installpath, InStrRev(installpath, "/"))
		weburl = "http://"& LCase(Request.ServerVariables("HTTP_HOST"))
		If not installpath="/" Then 
			If not v.Islaws(replace(installpath,"/","")) Then 
				response.Write("您的网站路径文件夹名称不合法,请您修改文件夹名称为字母或数字组成.")
				response.End()
			End If
		End If
		%>
<script type="text/javascript">
function check(){
var myform=document.myform;
for(var i=0;i<=6;i++){
if(myform[i]==""){alert("请您填写全部内容！");return false;}
}
myform[9].disabled=true;
return true;
}
</script>
<div class="box"><form name="myform" id="myform" method="post" action="?action=two" onSubmit="return check();">
<h2>第二步：网站设置</h2><h4>此页内容必填，默认伪静态为关闭状态，您安装完毕后可以进入后台开启伪静态功能.<br />
  如果您在此页面点击下一步长时间没有反应，请再耐心等待一会，因为系统会自动验证您的联盟id和联盟加密字符串。</h4>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="t_list">
    <tr>
      <td width="100" align="right">联盟ID：</td>
      <td width="210">
        <input name="data(0)" type="text" class="input_txt" id="data(0)" />
      </td>
      <td>请登录<a href="http://union.zhuna.cn/r.asp?sxid=256664" target="_blank">联盟会员中心</a>→API[XML]接口→联盟ID</td>
    </tr>
    <tr>
      <td align="right">联盟加密字符串：</td>
      <td>
        <input name="data(1)" type="text" class="input_txt" id="data(1)" />
      </td>
      <td>请登录<a href="http://union.zhuna.cn/r.asp?sxid=256664" target="_blank">联盟会员中心</a>→API[XML]接口→联盟加密字符串</td>
    </tr>
    <tr>
      <td align="right">订单保存KEY：</td>
      <td>
        <input name="data(6)" type="text" class="input_txt" id="data(6)" />
      </td>
      <td>请登录<a href="http://union.zhuna.cn/r.asp?sxid=256664" target="_blank">联盟会员中心</a>→API[XML]接口→订单保存KEY</td>
    </tr>
    <tr>
      <td align="right">设置网站名称：</td>
      <td>
        <input name="data(2)" type="text" class="input_txt" />
      </td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td align="right">网站路径：</td>
      <td>
      <input name="installpath" type="hidden" class="input_txt" value="<%=installpath%>" />
        <input name="data(3)" type="text" class="input_txt" value="<%=installpath%>" />
      </td>
      <td>根目录下请直接用/</td>
    </tr>
    <tr>
      <td align="right">网站域名：</td>
      <td>
        <input name="data(4)" type="text" class="input_txt" value="<%=weburl%>" />
      </td>
      <td>本地测试填写http://127.0.0.1/</td>
    </tr>
    <tr>
      <td align="right">默认城市：</td>
      <td><select name="data(5)">
<option value="53|北京">BJ
北京</option>
<option value="321|上海">SH
上海</option>
<option value="383|杭州">HZ
杭州</option>
<option value="80|广州">GZ
广州</option>
<option value="324|成都">CD
成都</option>
<option value="91|深圳">SZ
深圳</option>
<option value="317|西安">XA
西安</option>
<option value="226|苏州">SZ
苏州</option>
<option value="224|南京">NJ
南京</option>
<option value="61|厦门">XM
厦门</option>
<option value="292|青岛">QD
青岛</option>
<option value="133|三亚">SY
三亚</option>
<option value="192|武汉">WH
武汉</option>
<option value="394|重庆">CQ
重庆</option>
<option value="343|天津">TJ
天津</option>
<option value="374|丽江">LJ
丽江</option>
<option value="199|长沙">CS
长沙</option>
<option value="388|宁波">NB
宁波</option>
<option value="385|嘉兴">JX
嘉兴</option>
<option value="163|郑州">ZZ
郑州</option>
<option value="248|大连">DL
大连</option>
<option value="287|济南">JN
济南</option>
<option value="229|无锡">WX
无锡</option>
<option value="256|沈阳">SY
沈阳</option>
<option value="170|哈尔滨">HEB
哈尔滨</option>
<option value="395|香港">XG
香港</option>
<option value="102|桂林">GL
桂林</option>
<option value="42|合肥">HF
合肥</option>
<option value="78|东莞">DG
东莞</option>
<option value="373|昆明">KM
昆明</option>
<option value="221|常州">CZ
常州</option>
<option value="297|烟台">YT
烟台</option>
<option value="108|南宁">NN
南宁</option>
<option value="391|温州">WZ
温州</option>
<option value="97|珠海">ZH
珠海</option>
<option value="239|南昌">NC
南昌</option>
<option value="146|石家庄">SJZ
石家庄</option>
<option value="307|太原">TY
太原</option>
<option value="45|黄山">HS
黄山</option>
<option value="386|金华">JH
金华</option>
<option value="214|长春">CC
长春</option>
<option value="114|贵阳">GY
贵阳</option>
<option value="232|扬州">YZ
扬州</option>
<option value="225|南通">NT
南通</option>
<option value="392|舟山">ZS
舟山</option>
<option value="127|海口">HK
海口</option>
<option value="274|银川">YC
银川</option>
<option value="54|福州">FZ
福州</option>
<option value="79|佛山">FS
佛山</option>
<option value="364|乌鲁木齐">WLMQ
乌鲁木齐</option>
<option value="264|呼和浩特">HHHT
呼和浩特</option>
<option value="389|绍兴">SX
绍兴</option>
<option value="295|威海">WH
威海</option>
<option value="155|洛阳">LY
洛阳</option>
<option value="69|兰州">LZ
兰州</option>
<option value="281|西宁">XN
西宁</option>
<option value="330|乐山">LS
乐山</option>
<option value="59|泉州">QZ
泉州</option>
<option value="82|惠州">HZ
惠州</option>
<option value="96|中山">ZS
中山</option>
<option value="83|江门">JM
江门</option>
<option value="145|秦皇岛">QHD
秦皇岛</option>
<option value="384|湖州">HZ
湖州</option>
<option value="390|台州">TZ
台州</option>
<option value="230|徐州">XZ
徐州</option>
<option value="369|大理">DL
大理</option>
<option value="294|泰安">TA
泰安</option>
<option value="296|潍坊">WF
潍坊</option>
<option value="288|济宁">JN
济宁</option>
<option value="303|晋中">JZ
晋中</option>
<option value="265|呼伦贝尔">HLBE
呼伦贝尔</option>
<option value="241|上饶">SR
上饶</option>
<option value="99|北海">BH
北海</option>
<option value="223|连云港">LYG
连云港</option>
<option value="299|淄博">ZB
淄博</option>
<option value="197|宜昌">YC
宜昌</option>
<option value="228|泰州">TZ
泰州</option>
<option value="261|包头">BT
包头</option>
<option value="206|湘西">XX
湘西</option>
<option value="293|日照">RZ
日照</option>
<option value="147|唐山">TS
唐山</option>
<option value="238|九江">JJ
九江</option>
<option value="333|绵阳">MY
绵阳</option>
<option value="346|拉萨">LS
拉萨</option>
<option value="139|保定">BD
保定</option>
<option value="222|淮安">HA
淮安</option>
<option value="186|荆州">JZ
荆州</option>
<option value="291|临沂">LY
临沂</option>
<option value="154|开封">KF
开封</option>
<option value="396|澳门">AM
澳门</option>
<option value="62|漳州">ZZ
漳州</option>
<option value="210|张家界">ZJJ
张家界</option>
<option value="301|大同">DT
大同</option>
<option value="50|芜湖">WH
芜湖</option>
<option value="233|镇江">ZJ
镇江</option>
<option value="95|肇庆">ZQ
肇庆</option>
<option value="68|酒泉">JQ
酒泉</option>
<option value="236|吉安">JA
吉安</option>
<option value="387|丽水">LS
丽水</option>
<option value="141|承德">CD
承德</option>
<option value="393|衢州">QZ
衢州</option>
<option value="49|铜陵">TL
铜陵</option>
<option value="90|韶关">SG
韶关</option>
<option value="149|张家口">ZJK
张家口</option>
<option value="235|赣州">GZ
赣州</option>
<option value="94|湛江">ZJ
湛江</option>
<option value="120|遵义">ZY
遵义</option>
<option value="211|株洲">ZZ
株洲</option>
<option value="201|衡阳">HY
衡阳</option>
<option value="231|盐城">YC
盐城</option>
<option value="284|德州">DZ
德州</option>
<option value="87|清远">QY
清远</option>
<option value="88|汕头">ST
汕头</option>
<option value="237|景德镇">JDZ
景德镇</option>
<option value="380|西双版纳">XSBN
西双版纳</option>
<option value="205|湘潭">XT
湘潭</option>
<option value="175|牡丹江">MDJ
牡丹江</option>
<option value="209|岳阳">YY
岳阳</option>
<option value="249|丹东">DD
丹东</option>
<option value="263|鄂尔多斯">EEDS
鄂尔多斯</option>
<option value="322|阿坝">AB
阿坝</option>
<option value="331|凉山">LS
凉山</option>
<option value="371|迪庆">DQ
迪庆</option>
<option value="47|马鞍山">MAS
马鞍山</option>
<option value="142|邯郸">HD
邯郸</option>
<option value="56|南平">NP
南平</option>
<option value="116|黔东">QD
黔东</option>
<option value="144|廊坊">LF
廊坊</option>
<option value="182|恩施">ES
恩施</option>
<option value="198|常德">CD
常德</option>
<option value="285|东营">DY
东营</option>
<option value="367|保山">BS
保山</option>
<option value="107|柳州">LZ
柳州</option>
<option value="258|营口">YK
营口</option>
<option value="215|吉林">JL
吉林</option>
<option value="220|延边">YB
延边</option>
<option value="290|聊城">LC
聊城</option>
<option value="150|安阳">AY
安阳</option>
<option value="189|十堰">SY
十堰</option>
<option value="81|河源">HY
河源</option>
<option value="153|焦作">JZ
焦作</option>
<option value="183|黄冈">HG
黄冈</option>
<option value="194|咸宁">XN
咸宁</option>
<option value="319|延安">YA
延安</option>
<option value="339|宜宾">YB
宜宾</option>
<option value="140|沧州">CZ
沧州</option>
<option value="167|濮阳">PY
濮阳</option>
<option value="168|大庆">DQ
大庆</option>
<option value="177|齐齐哈尔">QQHE
齐齐哈尔</option>
<option value="273|吴忠">WZ
吴忠</option>
<option value="316|渭南">WN
渭南</option>
<option value="318|咸阳">XY
咸阳</option>
<option value="283|滨州">BZ
滨州</option>
<option value="298|枣庄">ZZ
枣庄</option>
<option value="302|晋城">JC
晋城</option>
<option value="58|莆田">PT
莆田</option>
<option value="310|运城">YC
运城</option>
<option value="334|南充">NC
南充</option>
<option value="92|阳江">YJ
阳江</option>
<option value="111|玉林">YL
玉林</option>
<option value="117|黔南">QN
黔南</option>
<option value="200|郴州">CZ
郴州</option>
<option value="227|宿迁">SQ
宿迁</option>
<option value="253|锦州">JZ
锦州</option>
<option value="326|德阳">DY
德阳</option>
<option value="55|龙岩">LY
龙岩</option>
<option value="160|新乡">XX
新乡</option>
<option value="213|白山">BS
白山</option>
<option value="37|蚌埠">BB
蚌埠</option>
<option value="66|嘉峪关">JYG
嘉峪关</option>
<option value="86|梅州">MZ
梅州</option>
<option value="262|赤峰">CF
赤峰</option>
<option value="286|菏泽">HZ
菏泽</option>
<option value="289|莱芜">LW
莱芜</option>
<option value="336|攀枝花">PZH
攀枝花</option>
<option value="44|淮南">HN
淮南</option>
<option value="46|六安">LA
六安</option>
<option value="77|潮州">CZ
潮州</option>
<option value="156|南阳">NY
南阳</option>
<option value="245|鞍山">AS
鞍山</option>
<option value="338|雅安">YA
雅安</option>
<option value="57|宁德">ND
宁德</option>
<option value="101|防城港">FCG
防城港</option>
<option value="162|许昌">XC
许昌</option>
<option value="252|葫芦岛">HLD
葫芦岛</option>
<option value="312|宝鸡">BJ
宝鸡</option>
<option value="327|甘孜">GZ
甘孜</option>
<option value="51|宣城">XC
宣城</option>
<option value="85|茂名">MM
茂名</option>
<option value="128|乐东">LD
乐东</option>
<option value="203|娄底">LD
娄底</option>
<option value="342|泸州">LZ
泸州</option>
<option value="38|巢湖">CH
巢湖</option>
<option value="118|黔西">QX
黔西</option>
<option value="135|万宁">WN
万宁</option>
<option value="243|宜春">YC
宜春</option>
<option value="269|锡林郭勒">XLGLM
锡林郭勒</option>
<option value="300|长治">CZ
长治</option>
<option value="304|临汾">LF
临汾</option>
<option value="74|天水">TS
天水</option>
<option value="89|汕尾">SW
汕尾</option>
<option value="109|钦州">QZ
钦州</option>
<option value="157|平顶山">PDS
平顶山</option>
<option value="161|信阳">XY
信阳</option>
<option value="172|黑河">HH
黑河</option>
<option value="174|佳木斯">JMS
佳木斯</option>
<option value="184|黄石">HS
黄石</option>
<option value="207|益阳">YY
益阳</option>
<option value="218|松原">SY
松原</option>
<option value="244|鹰潭">YT
鹰潭</option>
<option value="279|海西">HX
海西</option>
<option value="110|梧州">WZ
梧州</option>
<option value="112|安顺">AS
安顺</option>
<option value="159|商丘">SQ
商丘</option>
<option value="164|周口">ZK
周口</option>
<option value="313|汉中">HZ
汉中</option>
<option value="353|巴音郭楞">BYGLM
巴音郭楞</option>
<option value="358|喀什">KS
喀什</option>
<option value="366|伊犁">YL
伊犁</option>
<option value="40|滁州">CZ
滁州</option>
<option value="148|邢台">XT
邢台</option>
<option value="165|驻马店">ZMD
驻马店</option>
<option value="202|怀化">HH
怀化</option>
<option value="320|榆林">YL
榆林</option>
<option value="347|林芝">LZ
林芝</option>
<option value="368|楚雄">CX
楚雄</option>
<option value="39|池州">CZ
池州</option>
<option value="52|亳州">BZ
亳州</option>
<option value="84|揭阳">JY
揭阳</option>
<option value="98|百色">BS
百色</option>
<option value="152|济源">JY
济源</option>
<option value="185|荆门">JM
荆门</option>
<option value="332|眉山">MS
眉山</option>
<option value="41|阜阳">FY
阜阳</option>
<option value="43|淮北">HB
淮北</option>
<option value="103|贵港">GG
贵港</option>
<option value="105|贺州">HZ
贺州</option>
<option value="131|琼海">QH
琼海</option>
<option value="166|漯河">LH
漯河</option>
<option value="190|随州">SZ
随州</option>
<option value="196|孝感">XG
孝感</option>
<option value="242|新余">XY
新余</option>
<option value="250|抚顺">FS
抚顺</option>
<option value="255|盘锦">PJ
盘锦</option>
<option value="267|乌海">WH
乌海</option>
<option value="305|吕梁">LL
吕梁</option>
<option value="329|广元">GY
广元</option>
<option value="335|内江">NJ
内江</option>
<option value="337|遂宁">SN
遂宁</option>
<option value="341|自贡">ZG
自贡</option>
<option value="381|玉溪">YX
玉溪</option>
<option value="93|云浮">YF
云浮</option>
<option value="100|崇左">CZ
崇左</option>
<option value="113|毕节">BJ
毕节</option>
<option value="143|衡水">HS
衡水</option>
<option value="178|双鸭山">SYS
双鸭山</option>
<option value="240|萍乡">PX
萍乡</option>
<option value="246|本溪">BX
本溪</option>
<option value="311|安康">AK
安康</option>
<option value="325|达州">DZ
达州</option>
<option value="377|曲靖">QJ
曲靖</option>
<option value="104|河池">HC
河池</option>
<option value="115|六盘水">LPS
六盘水</option>
<option value="122|保亭">BT
保亭</option>
<option value="137|五指山">WZS
五指山</option>
<option value="158|三门峡">SMX
三门峡</option>
<option value="181|鄂州">EZ
鄂州</option>
<option value="219|通化">TH
通化</option>
<option value="257|铁岭">TL
铁岭</option>
<option value="266|通辽">TL
通辽</option>
<option value="272|石嘴山">SZS
石嘴山</option>
<option value="306|朔州">SZ
朔州</option>
<option value="309|阳泉">YQ
阳泉</option>
<option value="372|红河">HH
红河</option>
<option value="136|文昌">WC
文昌</option>
<option value="138|儋州">DZ
儋州</option>
<option value="151|鹤壁">HB
鹤壁</option>
<option value="171|鹤岗">HG
鹤岗</option>
<option value="188|神农架">SNJ
神农架</option>
<option value="234|抚州">FZ
抚州</option>
<option value="247|朝阳">CY
朝阳</option>
<option value="254|辽阳">LY
辽阳</option>
<option value="260|巴彦淖尔">BYNEM
巴彦淖尔</option>
<option value="328|广安">GA
广安</option>
<option value="351|阿克苏">AKS
阿克苏</option>
<option value="363|吐鲁番">TLF
吐鲁番</option>
<option value="370|德宏">DH
德宏</option>
<option value="76|张掖">ZY
张掖</option>
<option value="119|铜仁">TR
铜仁</option>
<option value="169|大兴安岭">DXAL
大兴安岭</option>
<option value="193|仙桃">XT
仙桃</option>
<option value="204|邵阳">SY
邵阳</option>
<option value="340|资阳">ZY
资阳</option>
<option value="355|昌吉">CJ
昌吉</option>
<option value="359|克拉玛依">KLMY
克拉玛依</option>
<option value="36|安庆">AQ
安庆</option>
<option value="48|宿州">SZ
宿州</option>
<option value="63|白银">BY
白银</option>
<option value="130|陵水">LS
陵水</option>
<option value="179|绥化">SH
绥化</option>
<option value="208|永州">YZ
永州</option>
<option value="314|商洛">SL
商洛</option>
<option value="349|日喀则">RKZ
日喀则</option>
<option value="356|哈密">HM
哈密</option>
<option value="378|思茅">SM
思茅</option>
<option value="75|武威">WW
武威</option>
<option value="125|定安县">DAX
定安县</option>
<option value="126|东方">DF
东方</option>
<option value="173|鸡西">JX
鸡西</option>
<option value="180|伊春">YC
伊春</option>
<option value="212|白城">BC
白城</option>
<option value="259|阿拉善盟">ALSM
阿拉善盟</option>
<option value="271|固原">GY
固原</option>
<option value="308|忻州">XZ
忻州</option>
<option value="315|铜川">TC
铜川</option>
<option value="323|巴中">BZ
巴中</option>
<option value="345|昌都">CD
昌都</option>
<option value="357|和田">HT
和田</option>
<option value="361|石河子">SHZ
石河子</option>
<option value="379|文山">WS
文山</option>
<option value="382|昭通">ZT
昭通</option>
<option value="60|三明">SM
三明</option>
<option value="67|金昌">JC
金昌</option>
<option value="72|平凉">PL
平凉</option>
<option value="73|庆阳">QY
庆阳</option>
<option value="106|来宾">LB
来宾</option>
<option value="187|潜江">QJ
潜江</option>
<option value="191|天门">TM
天门</option>
<option value="216|辽源">LY
辽源</option>
<option value="217|四平">SP
四平</option>
<option value="268|乌兰察布">WLCBS
乌兰察布</option>
<option value="270|兴安盟">XAM
兴安盟</option>
<option value="278|海南">HN
海南</option>
<option value="282|玉树">YS
玉树</option>
<option value="354|博尔塔拉">BETLM
博尔塔拉</option>
<option value="375|临沧">LC
临沧</option>
</select></td>
      <td>首页将显示该城市酒店</td>
    </tr>
    <tr>
      <td align="right">&nbsp;</td>
      <td><input type="button" class="btn05" onMouseOver="this.className='btn06'" onMouseOut="this.className='btn05'" onClick="window.location.href='install.asp?action=StepOne';" value=" 上一步 " />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  <input name="submit" class="btn05" onMouseOver="this.className='btn06'" onMouseOut="this.className='btn05'" type="submit" value=" 下一步 " /></td>
      <td>&nbsp;</td>
    </tr>
  </table>
  </form></div>
<p>

  <%End Sub%>
<%Sub Do_StepTwo()
	Dim dbStr,i,DBandTable,cityid,cityname,defaultcity,dbStrTemp
	For i=0 To 6
		If Request("data("&i&")")="" Then CheckErr=True:MsgStr="请您填写完整的内容！\n"
		dbStrTemp=dbStrTemp&Trim(Request("data("&i&")"))&","
	Next
	If CheckErr=False Then
		If v.IsNum(Request("data(0)"))=false Then CheckErr=True:MsgStr=MsgStr+"请您输入您的网盟ID！必须为数字！且不能有空格\n"
		If v.IsUrl(Request("data(4)"))=false Then CheckErr=True:MsgStr=MsgStr+"您输入的网站域名不正确！\n"
	End If
	'Function getweb(url,pagecode)
   
	
	If CheckErr=False Then
		If checkcityid(Request("data(0)"),Request("data(1)"))=1 Then CheckErr=True:MsgStr=MsgStr+"您输入的网盟ID或者加密字符串不正确，请检查！"
	End If
	defaultcity="53|北京,321|上海,80|广州,383|杭州,91|深圳,192|武汉,317|西安,224|南京,324|成都,"
	if instr(defaultcity,Trim(Request("data(5)")))>=1 then
		defaultcity=Trim(Request("data(5)"))&","&replace(defaultcity,Trim(Request("data(5)"))&",","")
		defaultcity=left(defaultcity,len(defaultcity)-1)
	else
		defaultcity=Trim(Request("data(5)"))&","&defaultcity
		defaultcity=left(defaultcity,len(defaultcity)-1)
	end if
	If CheckErr=False Then
		cityid=split(FU.Checkbadstr(Trim(Request("data(5)"))),"|")(0)
		If cityid=0 Then CheckErr=True:MsgStr=MsgStr+"找不到您输入的默认城市！"
	End If
	
	for i=0 to dom.Length-1
		if dom.GetAtt("s",Rst(i))="1" Then
			DBandTable=dom.GetNodeText(Rst(i))
		End If
	Next
	If DBandTable="" Then CheckErr=True:MsgStr=MsgStr+"创建数据库失败，请您从新执行上一步操作并删除根目录下的step.xml文件！或者联系联盟专员"
	
	If CheckErr=False Then
	Dim InstallPath,WebUrl,BaseConfig,Hotel,cachename,objconnDatabase
		dbStr=split(DBandTable,",")
		InstallPath=FU.Checkbadstr(Trim(Request("data(3)")))
		WebUrl=FU.Checkbadstr(Trim(Request("data(4)")))
		BaseConfig=FU.Checkbadstr(Trim(Request("data(2)")))&"-_-超低价预订全国1000多家如家快捷酒店 全国160个城市-_-<p>版权：艺程酒店预订网 Copyright 2009-2010 Corporation, All Rights Reserved</p><p>备案序号：备案信息提交审查中</p>-_-0-_-网站维护中-_-妈妈的=哈哈哈|我靠=呵呵|fuck=****|bitch=*****|他妈的=***|性爱=**|法轮=**|falundafa=*********|falun=*****|江泽民=***|操你妈=***|三级片=***|我操=呵呵|干你娘=***|日你妈=***|操你=**|混账=**|发票=fapiao-_-"
		Hotel=FU.Checkbadstr(Trim(Request("data(0)")))&"-_-"&FU.Checkbadstr(Trim(Request("data(1)")))&"-_-"&split(FU.Checkbadstr(Trim(Request("data(5)"))),"|")(1)&"-_-"&cityid&"-_-"&FU.Checkbadstr(Trim(defaultcity))&"-_--_-5-_-0-_-[ISAPI_Rewrite]"&vbcrlf&_
"# Defend your computer from some worm attacks"&vbcrlf&_
"RewriteRule .*(?:global.asa|default\.ida|root\.exe|\.\.).* . [F,I,O]"&vbcrlf&_
"#API静态版规则"&vbcrlf&_
"RewriteRule ^(.*)/([A-Za-z0-9]+)-c(\d+)-x(\d*)-(.*)-(.*)-a(\d+)-e(\d+).html(?:\?(.*))? $1/hotellist\.asp\?cityid=$3&rank=$4&hn=$5&key=$6&px=$7&pg=$8&$9 [I,L]"&vbcrlf&_
"RewriteRule ^(.*)/index\.html(?:\?(.*))? $1/index\.asp\?$2 [I,L]"&vbcrlf&_
"RewriteRule ^(.*)/searchlist\.html(?:\?(.*))? $1/searchlist\.asp\?$2 [I,L]"&vbcrlf&_
"RewriteRule ^(.*)/Hotel_map\.html(?:\?(.*))? $1/Hotel_map\.asp\?$2 [I,L]"&vbcrlf&_
"RewriteRule ^(.*)/liansuo\.html(?:\?(.*))? $1/liansuo\.asp\?$2 [I,L]"&vbcrlf&_
"RewriteRule ^(.*)/city\.html(?:\?(.*))? $1/city\.asp\?$2 [I,L]"&vbcrlf&_
"RewriteRule ^(.*)/dianping\.html(?:\?(.*))? $1/dianping\.asp\?$2 [I,L]"&vbcrlf&_
"RewriteRule ^(.*)/question\.html(?:\?(.*))? $1/question\.asp\?$2 [I,L]"&vbcrlf&_
"RewriteRule ^(.*)/map\.html(?:\?(.*))? $1/map\.asp\?$2 [I,L]"&vbcrlf&_
"RewriteRule ^(.*)/news\.html(?:\?(.*))? $1/news\.asp\?$2 [I,L] "&vbcrlf&_
"RewriteRule ^(.*)/news_(\d+)_(\d+)_(\d+)\.html(?:\?(.*))? $1/news\.asp\?classid=$2&cityid=$3&page=$4 [I,L] "&vbcrlf&_
"RewriteRule ^(.*)/lable\.html(?:\?(.*))? $1/lable\.asp\?$2 [I,L] "&vbcrlf&_
"RewriteRule ^(.*)/order\.html(?:\?(.*))? $1/order\.asp\?$2 [I,L] "&vbcrlf&_
"RewriteRule ^(.*)/lsjd_(\d+)_(\d+)\.html $1/hotellist\.asp\?cityid=$2&lsid=$3 [I,L]"&vbcrlf&_
"RewriteRule ^(.*)/lable_(\d+)_(\d+)\.html  $1/lable\.asp\?classid=$2&provinceid=$3 [I,L]"&vbcrlf&_
"RewriteRule ^(.*)/lable_(\d+)_(\d+)_(\d+)\.html  $1/lable\.asp\?page=$2&cityid=$3&classid=$4 [I,L]"&vbcrlf&_
"RewriteRule ^(.*)/index(\d+)\.html $1/index_i\.asp\?cityid=$2 [I,L]"&vbcrlf&_
"RewriteRule ^(.*)/searchlist(\d+)\.html(?:\?(.*))? $1/searchlist\.asp\?page=$2&$3 [I,L]"&vbcrlf&_
"RewriteRule ^(.*)/xing_(\d+)_(\d+)\.html $1/hotellist\.asp\?cityid=$2&xingji=$3 [I,L]"&vbcrlf&_
"RewriteRule ^(.*)/hotellist(\d+)\.html(?:\?(.*))? $1/hotellist\.asp\?cityid=$2&$3 [I,L]"&vbcrlf&_
"RewriteRule ^(.*)/key_(\d+)_(.*) $1/hotellist\.asp\?cityid=$2&key=$3 [I,L]"&vbcrlf&_
"RewriteRule ^(.*)/liansuo(\d+)\.html $1/liansuohotel\.asp\?lsid=$2 [I,L]"&vbcrlf&_
"RewriteRule ^(.*)/cbd_(\d+)_(\d+)\.html $1/hotellist\.asp\?cityid=$2&cid=$3 [I,L]"&vbcrlf&_
"RewriteRule ^(.*)/dianping_(\d+)_(\d+)\.html $1/dianping\.asp\?cityid=$2&page=$3 [I,L]"&vbcrlf&_
"RewriteRule ^(.*)/question_(\d+)_(\d+)\.html $1/question\.asp\?cityid=$2&page=$3 [I,L]"&vbcrlf&_
"RewriteRule ^(.*)/h(\d+)\.html $1/hotelinfo\.asp\?id=$2&types=0 [I,L]"&vbcrlf&_
"RewriteRule ^(.*)/htp(\d+)\.html $1/hotelinfo\.asp\?id=$2&types=1 [I,L]"&vbcrlf&_
"RewriteRule ^(.*)/hdp(\d+)\.html $1/hotelinfo\.asp\?id=$2&types=2 [I,L]"&vbcrlf&_
"RewriteRule ^(.*)/hdt(\d+)\.html $1/hotelinfo\.asp\?id=$2&types=3 [I,L]"&vbcrlf&_
"RewriteRule ^(.*)/hwd(\d+)\.html $1/hotelinfo\.asp\?id=$2&types=4 [I,L]"&vbcrlf&_
"RewriteRule ^(.*)/hjd(\d+)\.html $1/hotelinfo\.asp\?id=$2&types=5 [I,L]"&vbcrlf&_
"RewriteRule ^(.*)/friendlink\.html(?:\?(.*))? $1/friendlink\.asp\?$2 [I,L]"&vbcrlf&_
"RewriteRule ^(.*)/newsinfo_(\d+)\.html $1/newsinfo\.asp\?id=$2 [I,L]"&vbcrlf&_
"RewriteRule ^(.*)/help\.html(?:\?(.*))? $1/help\.asp\?$2 [I,L]"&vbcrlf&_
"RewriteRule ^(.*)/user\.html(?:\?(.*))? $1/user\.asp\?$2 [I,L]"&vbcrlf&_
"RewriteRule ^(.*)/ls_(\d+)_(\d+)\.html $1/liansuoxx\.asp\?cityid=$2&lsid=$3 [I,L]-_-http://un.api.zhuna.cn/api/gbk/-_-search-_-hotel-_-1-_-1-_-1-_-1-_-"&FU.Checkbadstr(Trim(Request("data(6)")))&"-_-rujia"
		cachename=makePassword(20)
		
'设置默认信息！
		Set objconnDatabase =Server.CreateObject("ADODB.Connection")
		objconnDatabase.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
	"Data Source="&webpath&"\Database\"&dbStr(0)&".asa"
	
		if objconnDatabase.Execute("Select count(*) From ZN_"&dbStr(4)&"")(0)=0 Then
			objconnDatabase.Execute("INSERT INTO ZN_"&dbStr(4)&" (Config_InstallPath,Config_WebUrl,Config_BaseConfig,Config_Hotel,Config_cachename) VALUES ('"&InstallPath&"','"&WebUrl&"','"&BaseConfig&"','"&Hotel&"','"&cachename&"')")
		Else
			objconnDatabase.Execute("UPDATE ZN_"&dbStr(4)&" SET Config_InstallPath='"&InstallPath&"',Config_WebUrl='"&WebUrl&"',Config_BaseConfig='"&BaseConfig&"',Config_Hotel='"&Hotel&"',Config_cachename='"&cachename&"'")
		End If
		
		if objconnDatabase.Execute("Select count(*) From ZN_"&dbStr(5)&"")(0)=0 Then
		   objconnDatabase.Execute("INSERT INTO ZN_"&dbStr(5)&" (AD_Title,AD_Link,AD_SizeWidth,AD_SizeHeight,AD_Type_radio,AD_Externallinks,AD_State_radio,AD_Adddate,AD_Area) VALUES ('广州亚运会酒店预订','#',950,70,3,'<div style=""margin-bottom:5px;""><a title=""酒店广告"" target=""_blank"" href=""{webpath}special/olympic/""><img width=""950"" height=""50"" border=""0"" alt=""广州亚运会酒店预订"" src=""images/yayun.jpg""></a></div>',2,'"&now()&"','通栏')")
		   objconnDatabase.Execute("INSERT INTO ZN_"&dbStr(5)&" (AD_Title,AD_Link,AD_SizeWidth,AD_SizeHeight,AD_Type_radio,AD_UploadFile,AD_State_radio,AD_Adddate,AD_Area) VALUES ('酒店广告','{webpath}help.asp',658,60,2,'images/top_ad.gif',2,'"&now()&"','头部')")
		    objconnDatabase.Execute("INSERT INTO ZN_"&dbStr(5)&" (AD_Title,AD_Link,AD_SizeWidth,AD_SizeHeight,AD_Type_radio,AD_UploadFile,AD_State_radio,AD_Adddate,AD_Area) VALUES ('首页幻灯片a','{webpath}',428,198,2,'template/rujia/images/index_1.jpg',2,'"&now()&"','首页幻灯片a')")
			objconnDatabase.Execute("INSERT INTO ZN_"&dbStr(5)&" (AD_Title,AD_Link,AD_SizeWidth,AD_SizeHeight,AD_Type_radio,AD_UploadFile,AD_State_radio,AD_Adddate,AD_Area) VALUES ('首页幻灯片b','{webpath}',428,198,2,'template/rujia/images/index_2.jpg',2,'"&now()&"','首页幻灯片b')")
		End If
		
		if objconnDatabase.Execute("Select count(*) From ZN_"&dbStr(5)&"_Flash")(0)=0 Then
			objconnDatabase.Execute("INSERT INTO ZN_"&dbStr(5)&"_Flash (ADFlash_Title,ADFlash_Link,ADFlash_UploadFile) VALUES ('23000家酒店','#','images/s_pic1.gif')")
			objconnDatabase.Execute("INSERT INTO ZN_"&dbStr(5)&"_Flash (ADFlash_Title,ADFlash_Link,ADFlash_UploadFile) VALUES ('手机订酒店','/3g/','images/s_pic2.gif')")
			objconnDatabase.Execute("INSERT INTO ZN_"&dbStr(5)&"_Flash (ADFlash_Title,ADFlash_Link,ADFlash_UploadFile) VALUES ('广州亚运会','special/olympic/','images/s_pic3.gif')")
		End If
		
		if objconnDatabase.Execute("Select count(*) From ZN_"&dbStr(3)&"")(0)=0 Then
		   objconnDatabase.Execute("INSERT INTO ZN_"&dbStr(3)&" (FriendLink_Title,FriendLink_Link,FriendLink_Type_radio,FriendLink_State_radio,FriendLink_Externallinks,FriendLink_Order) VALUES ('住哪网','http://www.zhuna.cn',3,2,'images/zhuna2.gif',999999)")
		   objconnDatabase.Execute("INSERT INTO ZN_"&dbStr(3)&" (FriendLink_Title,FriendLink_Link,FriendLink_Type_radio,FriendLink_State_radio,FriendLink_Externallinks,FriendLink_Order) VALUES ('住哪联盟','http://un.zhuna.cn',3,2,'images/zhuna.gif',999998)")
		   objconnDatabase.Execute("INSERT INTO ZN_"&dbStr(3)&" (FriendLink_Title,FriendLink_Link,FriendLink_Type_radio,FriendLink_State_radio,FriendLink_Order) VALUES ('住哪网','http://www.zhuna.cn',1,2,999997)")
		   objconnDatabase.Execute("INSERT INTO ZN_"&dbStr(3)&" (FriendLink_Title,FriendLink_Link,FriendLink_Type_radio,FriendLink_State_radio,FriendLink_Order) VALUES ('住哪联盟','http://un.zhuna.cn',1,2,999996)")
		End If
		
		if objconnDatabase.Execute("Select count(*) From ZN_"&dbStr(2)&"_Class")(0)=0 Then
		   objconnDatabase.Execute("INSERT INTO ZN_"&dbStr(2)&"_Class (ClassID,ClassName,ParentID,ParentStr,Depth,RootID,Child,orderid,readme) VALUES (1,'出行资讯',0,0,0,1,0,0,'无')")
		End If
		'-------------------------
		'-------------------------
		Dim keysetstr:keysetstr="('首页','index.asp','如家快捷酒店_如家快捷酒店价格_如家酒店网上预订_{doname}','如家快捷酒店 如家快捷酒店价格 如家酒店网上预订','{doname}为您提供如家快捷酒店 如家快捷酒店价格 如家酒店网上预订','"&now&"','{doname}=网站名称')______"&_
		"('城市酒店','city.asp','如家快捷酒店城市分布 如家快捷酒店预订 如家快捷酒店官网','如家快捷酒店,如家快捷酒店分布,国内如家快捷酒店','{doname}为您提供国内如家快捷酒店城市分布 如家快捷酒店预订 如家快捷酒店官网','"&now&"','{doname}=网站名称')______"&_
		"('如家快捷酒店点评','dianping.asp','{cityname}如家快捷酒店点评_{cityname}哪个如家快捷酒店好？{cityname}哪个如家快捷酒店价格便宜？_{cityname}如家快捷酒店怎么样？{doname}','如家快捷酒店预订,如家快捷酒店点评,{cityname}哪个如家快捷酒店好','{doname}为您提供最权威,最新的如家快捷酒店点评数据','"&now&"','{cityname}=城市名"&vbcrlf&"{doname}=网站名')______"&_
		"('如家快捷酒店问答','question.asp','{cityname}如家快捷酒店问答_{cityname}如家快捷酒店提问_{doname}','如家快捷酒店提问,如家快捷酒店问答','{doname}为您提供最权威,最新的如家快捷酒店问答数据、免费如家快捷酒店价格、预定等服务','"&now&"','{cityname}=城市名"&vbcrlf&"{doname}=网站名')______"&_
		"('如家快捷酒店电子地图','map.asp','{cityname}如家快捷酒店电子地图_{cityname}如家快捷酒店地图_{cityname}如家快捷酒店地图_{doname}','如家快捷酒店地图,{cityname}如家快捷酒店地图','{doname}为您提供最权威的{cityname}如家快捷酒店电子地图','"&now&"','{cityname}=城市名"&vbcrlf&"{doname}=网站名')______"&_
		"(' 如家快捷酒店新闻资讯','news.asp',' 如家快捷酒店新闻资讯',' 如家快捷酒店新闻资讯','{doname}为您提供最权威的 如家快捷酒店新闻资讯','"&now&"','{classname}=类别名称"&vbcrlf&"{doname}=网站名称')______"&_
		"('专题活动','special.asp','专题-{doname}','酒店专题','{doname}酒店专题','"&now&"','{doname}=网站名')______"&_
"('城市连锁酒店详细','liansuoxx.asp','{cityname}如家快捷连锁酒店_{cityname{liansuoname}酒店查询_{cityname{liansuoname}酒店预订_{cityname{liansuoname}酒店预订网_{doname}','{cityname}连锁酒店,{cityname{liansuoname}连锁酒店查询','{doname}为您提供最好,最权威的{cityname}连锁酒店,{liansuoname}连锁酒店查询,{liansuoname}连锁酒店预订,{liansuoname}酒店预订网','"&now&"','{cityname}=城市名"&vbcrlf&"{liansuoname}=连锁名称"&vbcrlf&"{doname}=网站名称')______"&_
		"('如家快捷酒店','liansuo.asp','全国如家快捷酒店_{doname}','如家快捷酒店,如家快捷酒店','{doname}为您提供如家快捷酒店,快捷酒店等酒店信息,经济型如家快捷酒店','"&now&"','{doname}=网站名称')______"&_
	"('如家快捷酒店详细','liansuohotel.asp','连锁酒店_{liansuoname}连锁酒店查询_{liansuoname}连锁酒店预订_{liansuoname}酒店预订网_{doname}','{{liansuoname}连锁酒店查询','{doname}为您提供最好,最权威的{liansuoname}连锁酒店,{liansuoname}连锁酒店查询,{liansuoname}连锁酒店预订,{liansuoname}酒店预订网','"&now&"','{cityname}=城市名"&vbcrlf&"{liansuoname}=连锁名称"&vbcrlf&"{doname}=网站名称')______"&_
	"('如家快捷酒店搜索','hotellist.asp','{cityname}{key?附近}{bidname}如家快捷酒店_{cityname}{key?附近}{bidname}如家快捷酒店预订_{cityname}{key?附近}{bidname}如家快捷酒店价格_{pg}_{doname}','{cityname}{key?附近}{bidname}{lsname}{star?星级}{minjiage?元}{maxjiage?元}{hn}如家快捷酒店预订,{cityname}如家快捷酒店价格，{cityname}如家快捷酒店住宿','{doname}为您提供最可信,最权威的{cityname}{key?附近}{bidname}{lsname}{star?星级}{minjiage?元}{maxjiage?元}{hn}如家快捷酒店预订,{cityname}{key}{bidname}{lsname}{star?星级}{minjiage?元}{maxjiage?元}{hn}酒店预订,{cityname}{key}{bidname}{lsname}{star?如家快捷酒店}{minjiage?元}{maxjiage?元}{hn}如家快捷酒店住宿等服务','"&now&"','{doname}=网站名称"&vbcrlf&"{key}=搜索关键字"&vbcrlf&"{bidname}=商业区名称"&vbcrlf&"{lsname}=连锁名称"&vbcrlf&"{cityname}=城市名称"&vbcrlf&"{pg}=页数"&vbcrlf&"{star}=星级"&vbcrlf&"{minjiage}=最低价"&vbcrlf&"{maxjiage}=最高价"&vbcrlf&"{hn}=酒店名')______"&_
"('如家快捷酒店详细页面','hotelinfo.asp','{Hotelnames}免费预订_点评_怎么样_价格_地图_{doname}','{Hotelnames}酒店预定,{Hotelnames}酒店价格, {Hotelnames}酒店酒店信息, {cityname}酒店预订','{doname}为您提供最好的,最权威的{Hotelnames}酒店预定,{cityname}宾馆查询,{cityname}酒店','"&now&"','{hotelnames}=酒店名称"&vbcrlf&"{doname}=网站名称"&vbcrlf&"{cityname}=城市名称')______"&_
		"('酒店图片','hotelinfo.asp?id={id}&types=1','{hotelnames}酒店图片_{cityname}酒店预订_{cityname}酒店价格_{doname}','{hotelnames}酒店图片,{cityname}酒店预订','{doname}为您提供最可信,最权威的{hotelnames}酒店图片,{cityname}酒店预订','"&now&"','{hotelnames}=酒店名称"&vbcrlf&"{doname}=网站名称"&vbcrlf&"{cityname}=城市名称')______"&_
		"('客人点评','hotelinfo.asp?id={id}&types=2','{hotelnames}酒店评论_{cityname}酒店预订_{cityname}酒店价格_{doname}','{hotelnames}酒店评论,{cityname}酒店预订','{doname}为您提供最可信,最权威的{hotelnames}酒店评论,{cityname}酒店预订','"&now&"','{hotelnames}=酒店名称"&vbcrlf&"{doname}=网站名称"&vbcrlf&"{cityname}=城市名称')______"&_
		"('交通地图','hotelinfo.asp?id={id}&types=3','{hotelnames}酒店地图_{cityname}酒店预订_{cityname}酒店价格_{doname}','{hotelnames}酒店地图,{cityname}酒店预订','{doname}为您提供最可信,最权威的{hotelnames}酒店地图,{cityname}酒店预订','"&now&"','{hotelnames}=酒店名称"&vbcrlf&"{doname}=网站名称"&vbcrlf&"{cityname}=城市名称')______"&_
		"('酒店问答','hotelinfo.asp?id={id}&types=4','{hotelnames}酒店问答_{cityname}酒店预订_{cityname}酒店价格_{doname}','{hotelnames}酒店问答,{cityname}酒店预订','{doname}为您提供最可信,最权威的{hotelnames}酒店问答,{cityname}酒店预订','"&now&"','{hotelnames}=酒店名称"&vbcrlf&"{doname}=网站名称"&vbcrlf&"{cityname}=城市名称')______"&_
		"('周边酒店','hotelinfo.asp?id={id}&types=5','{hotelnames}酒店附近酒店_{cityname}酒店预订_{cityname}酒店价格_{doname}','{hotelnames}酒店附近酒店,{cityname}酒店预订','{doname}为您提供最可信,最权威的{hotelnames}附近酒店,{cityname}酒店预订','"&now&"','{hotelnames}=酒店名称"&vbcrlf&"{doname}=网站名称"&vbcrlf&"{cityname}=城市名称')______"&_
		"('城市首页','index_i.asp','{cityname}酒店预订_{cityname}特价宾馆_{cityname}酒店怎么样？_{cityname}哪些酒店不错？_{cityname}酒店点评_{doname}','{cityname}酒店,{cityname}酒店预订','{doname}为您提供最可信,最权威的{cityname}酒店预订,{cityname}特价宾馆','"&now&"','{cityname}=城市名称"&vbcrlf&"{doname}=网站名称')______"&_
		"('出行资讯详细','newsinfo.asp','{title}_{classname}_{cityname}如家快捷酒店_{doname}','{classname},{cityname}如家快捷酒店','{doname}为您提供信息量最大,信心最可信的{classname}信息:{title};{cityname}如家快捷酒店','"&now&"','{title}=文章标题"&vbcrlf&"{doname}=网站名称"&vbcrlf&"{cityname}=城市名称"&vbcrlf&"{classname}=文章类别名')"

		if objconnDatabase.Execute("Select count(*) From ZN_"&dbStr(8)&"")(0)=0 Then
			for i=0 to ubound(split(keysetstr,"______"))
				objconnDatabase.Execute("INSERT INTO ZN_"&dbStr(8)&" (KeySet_PageName,KeySet_page,KeySet_Title,KeySet_keywords,KeySet_description,KeySet_updatedate,KeySet_rule) VALUES "&split(keysetstr,"______")(i)&"")
			next
		End If
		'-------------------------
		'-------------------------
		if objconnDatabase.Execute("Select count(*) From ZN_"&dbStr(2)&"")(0)=0 Then
		dim conn2,rs2
			set conn2=server.CreateObject("ADODB.Connection") 
			conn2.Open "Provider=Microsoft.Jet.OLEDB.4.0;Jet OLEDB:Database Password=;Extended properties=Excel 5.0;Data Source="&Server.MapPath("Database/news.xls")
			Set rs2 = Server.CreateObject("ADODB.Recordset")
			rs2.open "SELECT * FROM [news$]",conn2,1,3
			while not rs2.eof
			IF rs2(1) <> "" Then
				objconnDatabase.execute("insert into ZN_"&dbStr(2)&" ([Article_ClassID],[Article_Title],[Article_content],[Article_Author],[Article_Order],[Article_State_Radio],[Article_AddDate],[Article_ViewNum],[Article_ViewImg],[Article_CityID_select] , [Article_small_content]) values("& rs2(0) &",'"& rs2(1) &"','"& rs2(2) &"','"& rs2(3) &"',"& rs2(4) &","& rs2(5) &",'"&now&"',"& rs2(7) &",'"& rs2(8) &"',"& rs2(9) &",'"&rs2(10)&"')") 
			End If
			rs2.movenext
			wend 
			rs2.close:set rs2=nothing
			conn2.close:set conn2=nothing
		End If
		objconnDatabase.close:set objconnDatabase=Nothing
'结束
		Dim setupstr
		setupstr="<%"&vbcrlf&_
"Set D=Server.CreateObject(""Scripting.Dictionary"")"&vbcrlf&_
"D.Add ""DBName"","""&dbStr(0)&""""&vbcrlf&_
"D.Add ""Manage"","""&dbStr(1)&""""&vbcrlf&_
"D.Add ""Article"","""&dbStr(2)&""""&vbcrlf&_
"D.Add ""FriendLink"","""&dbStr(3)&""""&vbcrlf&_
"D.Add ""AD"","""&dbStr(5)&""""&vbcrlf&_
"D.Add ""DBHName"",""#"&dbStr(6)&""""&vbcrlf&_
"D.Add ""KeySet"","""&dbStr(8)&""""&vbcrlf&_
"D.Add ""SearchList"","""&dbStr(7)&""""&vbcrlf&_
"D.Add ""Config"","""&dbStr(4)&""""&vbcrlf&_
"D.Add ""Cachename"","""&Cachename&""""&vbcrlf&_
"D.Add ""DBPath"","""&FU.Checkbadstr(Trim(request("InstallPath")))&""""&vbcrlf&chr(37)&_
">"
	dim objXMLx
    set objXMLx=createobject("MSXML2.SERVERXMLHTTP.3.0")  '调用XMLHTTP组件，测试空间是否支持XMLHTTP
    objXMLx.open "GET","http://union.api.zhuna.cn/index.php?m=count.setup&v=asp_v1&var=1.0&uid="&Request("data(0)")&"&mk="&Request("data(1)")&"&host="&Request("data(4)"),false 'false表示以同步的方式获取网页代码，了解什么是同步？什么是异步？
    objXMLx.send() '发送
    set objXMLx=nothing'关闭
		call CreatFile("SETUP.ASP",setupstr)
		call CreatFile("INC/SETUP.ASP.Bak",setupstr)
		for i=0 to dom.Length-1
			if dom.GetAtt("s",Rst(i))="2" Then
				dom.AddAttribute "v","1",Rst(i)
				dom.AddText dbStrTemp,true,Rst(i)
			End If
		Next
		dom.SaveXML()
		MsgStr=("?action=StepThree")
	End If
	
	
	
End Sub

Sub StepThree()%>

<div class="box"><form name="myform" method="post" action="?action=three">
<h2>第三步：设置登录信息</h2>
<h4>系统给出了默认值，建议您修改为不容易被猜到的！</h4>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="t_list">
  <tr>
    <td width="100" align="right">后台路径：</td>
    <td width="210"><input name="data(0)" type="text" class="input_txt" value="admin_"/></td>
    <td>网站管理后台登录路径，建议修改</td>
  </tr>
  <tr>
    <td align="right">用户名：</td>
    <td><input name="data(1)" type="text" class="input_txt" value="admin" /></td>
    <td>网站管理登录用户名，建议修改</td>
  </tr>
  <tr>
    <td align="right">密码：</td>
    <td><input name="data(2)" type="password" class="input_txt" value="" /></td>
    <td>登录密码，建议修改</td>
  </tr>
  <tr>
    <td align="right">&nbsp;</td>
    <td><input type="button" onClick="window.location.href='install.asp?action=StepTwo';" class="btn05" onMouseOver="this.className='btn06'" onMouseOut="this.className='btn05'" value="上一步" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  <input name="submit" type="submit" class="btn05" onMouseOver="this.className='btn06'" onMouseOut="this.className='btn05'" value="下一步" /></td>
    <td>&nbsp;</td>
  </tr>
</table>
</form>
</div>
<%End Sub
Sub Do_StepThree()
	Dim dbStr,i,dbStrsplit
	For i=0 To 2
		If Request("data("&i&")")="" or v.Islaw(Request("data("&i&")"))=false Then CheckErr=True:MsgStr="请您填写完整的内容！长度为5-20位！\n数字或字母或下划线或中横线"
		dbStr=dbStr&Trim(Request("data("&i&")"))&","
	Next
	If Len(Trim(Request("data(2)")))<5 Then CheckErr=True:MsgStr="密码必须为5位以上！"
	dbStrsplit=split(dbStr,",")
	If CheckErr=False Then
%>
<div class="box">
<h2>第四步：确认信息</h2>
<h4>再次请您牢记，如果您觉得不方便记忆，请返回上一步修改。</h4>
<form name="myform" method="post" action="?action=four">
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="t_list">
  <tr>
    <td width="100" align="right">后台路径：</td>
    <td width="210"><%=dbStrsplit(0)%></td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td align="right">用户名：</td>
    <td><%=dbStrsplit(1)%></td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td align="right">密码：</td>
    <td><%=left(dbStrsplit(2),len(dbStrsplit(2))-3)&"***"%></td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td align="right">&nbsp;</td>
    <td><input type="button" class="btn05" onMouseOver="this.className='btn06'" onMouseOut="this.className='btn05'" onClick="history.back(1);" value="上一步" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
      <input name="submit" type="submit" class="btn05" onMouseOver="this.className='btn06'" onMouseOut="this.className='btn05'" value="确认" /></td>
    <td>&nbsp;</td>
  </tr>
</table>
  <input name="data(0)" type="hidden" value="<%=dbStr%>"/>
</form></div>
<%End If
End Sub%>

<%
Function checkhotelasa()
On Error Resume Next
	Dim objconnDatabase
	Set objconnDatabase =Server.CreateObject("ADODB.Connection")
		objconnDatabase.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
	"Data Source="&webpath&"\Database\hotel.asa"
	objconnDatabase.close:set objconnDatabase=Nothing
	if err<>0 then 
	err.clear
	checkhotelasa=false
	else
	checkhotelasa=true
	end if
End function

Sub Do_StepFour()
Dim dbStr,objconnDatabase,DBandTable,bakpath,http,url
dbStr=FU.checkbadstr(request("data(0)"))
If dbStr="" Then CheckErr=True:MsgStr="数据丢失！"
If CheckErr=False Then
	dbStr=split(dbStr,",")
	bakpath=dbStr(0)
	for i=0 to dom.Length-1
		if dom.GetAtt("s",Rst(i))="1" Then
			DBandTable=dom.GetNodeText(Rst(i))
		End If
	Next
	If DBandTable="" Then CheckErr=True:MsgStr="数据丢失,请从新安装！"
	If CheckErr=False Then
		if not checkhotelasa then
			 CheckErr=True:MsgStr="检测到您数据库文件（DataBase/hotel.asa）没有上传完整！请您重新上传此文件！"
		end if
	End if
	If CheckErr=False Then
	DBandTable=split(DBandTable,",")
	Set objconnDatabase =Server.CreateObject("ADODB.Connection")
		objconnDatabase.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
	"Data Source="&webpath&"\Database\"&DBandTable(0)&".asa"
		if objconnDatabase.Execute("Select count(*) From ZN_"&DBandTable(1)&" Where Manage_ID=1")(0)=0 Then
			objconnDatabase.Execute("INSERT INTO ZN_"&DBandTable(1)&" (Manage_UserName,Manage_Password,Manage_Adminflag_select,Manage_Name,Manage_Adddate) VALUES ('"&dbStr(1)&"','"&md5(dbStr(2),16)&"',3,'默认管理员','"&now()&"')")
		Else
			objconnDatabase.Execute("UPDATE ZN_"&DBandTable(1)&" SET Manage_UserName='"&dbStr(1)&"',Manage_Password='"&md5(dbStr(2),16)&"',Manage_Adminflag_select=3,Manage_Name='默认管理员',Manage_Adddate='"&now()&"' Where Manage_ID=1")
		End If
	objconnDatabase.close:set objconnDatabase=Nothing
	
	Dim Teststr
	Teststr=ExeFSOTEST
	If cbool(Teststr(0))<>True or cbool(Teststr(1))<>True Then
		dim errmsgs
		errmsgs="<div class='box' id='inst_err'><h1>安装过程由于您的服务器权限问题而无法进行！请阅读下面提示通过FTP进行<b>必要操作</b>后才可访问！</h1>"&_
		"1.删除以下文件<br>"&webpathb&"INC/SETUP.ASP<br>"&webpathb&"INC/loop.txt<br>"&webpathb&"INC/deletetest.txt<br>"&webpathb&"DataBase/news.xls<br>"&webpathb&"install.asp<br>"&webpathb&"step.xml。<br>"&_
		"2.将"&webpathb&"SETUP.ASP文件移到到"&webpathb&"INC下！<br>"&_
		"3.将"&webpathb&"database目录下的hotel.asa改为#"&DBandTable(6)&".asa"&_
		"4.将"&webpathb&"sys_admin目录名称改为"&webpathb&""&bakpath&"."&_
		"</div>"
		Response.Write errmsgs
	Else
		if IsFile("inc/SETUP.ASP") then
			Call deletefiles("inc/SETUP.ASP")
		end if
		Call filrename("database/hotel.asa","database/#"&DBandTable(6)&".asa")
		Call filrename("SETUP.ASP","inc/SETUP.ASP")
		Call RenameFolderOrFile("sys_admin",dbStr(0),1)
		if IsFile("SETUP.ASP") then
			Call deletefiles("SETUP.ASP")
		end if
		Call deletefiles("inc/loop.txt")
		Call deletefiles("step.xml")
		Call deletefiles("Database/news.xls")
		Call deletefiles("install.asp")
		Response.Write "<div class='box' id='inst_ok'><h1>安装已经完成！</h1><a href=""index.asp"" target=""_blank"">开始浏览网站</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="""&bakpath&"/index.asp""  target=""_blank"">登录后台</a></div>"
	End If
	End If
End If
End Sub
%>
</div>
</body>
</html>
<%
Function CreatDB(dbStr)
dbStr=split(dbStr,",")
	Dim objADOXDatabase,objTable
		
	Set objADOXDatabase =Server.CreateObject("ADOX.Catalog")
	objADOXDatabase.Create "Provider=Microsoft.Jet.OLEDB.4.0;" & _
	"Data Source="&webpath&"\Database\#"&dbStr(0)&".asa"
	'会员表
	Set objTable = CreateObject("ADOX.Table")
		objTable.Name = "ZN_"&dbStr(1)
		With objTable.Columns
			.Append "Manage_Id", 3
			.Append "Manage_UserName", 202, 255
			.Append "Manage_Password", 202, 32
			.Append "Manage_LoginTime", 7
			.Append "Manage_Loginip", 202, 255
			.Append "Manage_Adminflag_select", 2
			.Append "Manage_Name", 202, 255
			.Append "Manage_Adddate", 7
			.Append "Manage_Modifydate", 7
			.Append "Manage_ChangeIp", 202, 255
		End With
		objTable.Keys.Append "Manage_Id", 1, "Manage_Id"
		Set objTable.ParentCatalog=objADOXDatabase
		objTable.Columns("Manage_Id").Properties("Autoincrement")=True
		objTable.Columns("Manage_Adminflag_select").Properties("default")=0
		objTable.Columns("Manage_LoginTime").Properties("default")="Now()"
		objTable.Columns("Manage_Adddate").Properties("default")="Now()"
		objTable.Columns("Manage_Modifydate").Properties("default")="Now()"
		objTable.Columns("Manage_Loginip").Properties("Jet OLEDB:Allow Zero Length") = True
		objTable.Columns("Manage_Name").Properties("Jet OLEDB:Allow Zero Length") = True
		objTable.Columns("Manage_ChangeIp").Properties("Jet OLEDB:Allow Zero Length") = True
		objADOXDatabase.Tables.Append objTable
	Set objTable=Nothing
	'文章表
	Set objTable = CreateObject("ADOX.Table")
		objTable.Name = "ZN_"&dbStr(2)
		With objTable.Columns
			.Append "Article_ID", 3
			.Append "Article_ClassID", 3
			.Append "Article_Title", 202, 255
			.Append "Article_content", 203
			.Append "Article_Author", 202, 255
			.Append "Article_Order", 3
			.Append "Article_State_Radio", 2
			.Append "Article_AddDate", 7
			.Append "Article_ViewNum", 3
			.Append "Article_ViewImg", 202,255
			.Append "Article_CityID_select", 3
			.Append "Article_small_content", 202,255
		End With
		objTable.Keys.Append "Article_ID", 1, "Article_ID"
		Set objTable.ParentCatalog=objADOXDatabase
		objTable.Columns("Article_ID").Properties("Autoincrement")=True
		objTable.Columns("Article_Order").Properties("default")=0
		objTable.Columns("Article_State_Radio").Properties("default")=0
		objTable.Columns("Article_ViewNum").Properties("default")=0
		objTable.Columns("Article_CityID_select").Properties("default")=0
		objTable.Columns("Article_AddDate").Properties("default")="Now()"
		objTable.Columns("Article_Title").Properties("Jet OLEDB:Allow Zero Length") = True
		objTable.Columns("Article_Author").Properties("Jet OLEDB:Allow Zero Length") = True
		objTable.Columns("Article_content").Properties("Jet OLEDB:Allow Zero Length") = True
		objTable.Columns("Article_ViewImg").Properties("Jet OLEDB:Allow Zero Length") = True
		objTable.Columns("Article_small_content").Properties("Jet OLEDB:Allow Zero Length") = True
		objADOXDatabase.Tables.Append objTable
	Set objTable=Nothing
	'文章类表
	Set objTable = CreateObject("ADOX.Table")
		objTable.Name = "ZN_"&dbStr(2)&"_Class"
		With objTable.Columns
			.Append "ClassID", 3
			.Append "ClassName", 202,50
			.Append "ParentID", 3
			.Append "ParentStr", 202,255
			.Append "Depth", 2
			.Append "RootID", 3
			.Append "Child", 3
			.Append "orderid", 3
			.Append "readme", 202,255
			.Append "indexIMG", 202,255
			.Append "Board_Setting", 203
			.Append "Board_Ads", 203
			.Append "nextid", 3
		End With
		objTable.Keys.Append "ClassID", 1, "ClassID"
		Set objTable.ParentCatalog=objADOXDatabase
		objTable.Columns("ClassID").Properties("default")=0
		objTable.Columns("ParentID").Properties("default")=0
		objTable.Columns("RootID").Properties("default")=0
		objTable.Columns("Child").Properties("default")=0
		objTable.Columns("orderid").Properties("default")=0
		objTable.Columns("nextid").Properties("default")=0
		
		objTable.Columns("ClassName").Properties("Jet OLEDB:Allow Zero Length") = True
		objTable.Columns("ParentStr").Properties("Jet OLEDB:Allow Zero Length") = True
		objTable.Columns("readme").Properties("Jet OLEDB:Allow Zero Length") = True
		objTable.Columns("indexIMG").Properties("Jet OLEDB:Allow Zero Length") = True
		objTable.Columns("Board_Setting").Properties("Jet OLEDB:Allow Zero Length") = True
		objTable.Columns("Board_Ads").Properties("Jet OLEDB:Allow Zero Length") = True
		objADOXDatabase.Tables.Append objTable
	Set objTable=Nothing
	
	'友情链接表
	Set objTable = CreateObject("ADOX.Table")
		objTable.Name = "ZN_"&dbStr(3)
		With objTable.Columns
			.Append "FriendLink_ID", 3
			.Append "FriendLink_Title", 202,255
			.Append "FriendLink_Link", 202,255
			.Append "FriendLink_Type_radio", 3
			.Append "FriendLink_UploadFile", 202,255
			.Append "FriendLink_Order", 3
			.Append "FriendLink_BeginTime", 7
			.Append "FriendLink_EndTime", 7
			.Append "FriendLink_State_radio", 3
			.Append "FriendLink_Adddate", 7
			.Append "FriendLink_AddUserName", 202,255
			.Append "FriendLink_Externallinks", 202,255
		End With
		objTable.Keys.Append "FriendLink_ID", 1, "FriendLink_ID"
		Set objTable.ParentCatalog=objADOXDatabase
		objTable.Columns("FriendLink_ID").Properties("Autoincrement")=True
		objTable.Columns("FriendLink_Type_radio").Properties("default")=1
		objTable.Columns("FriendLink_Order").Properties("default")=0
		objTable.Columns("FriendLink_Adddate").Properties("default")="now()"
		
		objTable.Columns("FriendLink_Title").Properties("Jet OLEDB:Allow Zero Length") = True
		objTable.Columns("FriendLink_Link").Properties("Jet OLEDB:Allow Zero Length") = True
		objTable.Columns("FriendLink_UploadFile").Properties("Jet OLEDB:Allow Zero Length") = True
		objTable.Columns("FriendLink_AddUserName").Properties("Jet OLEDB:Allow Zero Length") = True
		objTable.Columns("FriendLink_BeginTime").Properties("Jet OLEDB:Allow Zero Length") = True
		objTable.Columns("FriendLink_EndTime").Properties("Jet OLEDB:Allow Zero Length") = True
		objTable.Columns("FriendLink_Externallinks").Properties("Jet OLEDB:Allow Zero Length") = True
		objADOXDatabase.Tables.Append objTable
	Set objTable=Nothing

	'网站设置表
	Set objTable = CreateObject("ADOX.Table")
		objTable.Name = "ZN_"&dbStr(4)
		With objTable.Columns
			.Append "Config_Id", 3
			.Append "Config_InstallPath", 202,50
			.Append "Config_WebUrl", 202,255
			.Append "Config_BaseConfig", 203
			.Append "Config_Hotel", 203
			.Append "Config_cachename", 202,255
		End With
		objTable.Keys.Append "Config_Id", 1, "Config_Id"
		Set objTable.ParentCatalog=objADOXDatabase
		objTable.Columns("Config_Id").Properties("Autoincrement")=True
		objADOXDatabase.Tables.Append objTable
	Set objTable=Nothing
	
	'网站防止下载表.
	Dim stm,str,rss,rs,tablename
	tablename=makePassword(8)
	Set objTable = CreateObject("ADOX.Table")
 		objTable.Name = "ZN_NotNown"&tablename
		objTable.Columns.Append "ZN_NotNown"&tablename, 205
		objADOXDatabase.Tables.Append objTable
	Set objTable=Nothing
	Set stm = server.CreateObject("adodb.stream")
		stm.Type = 1 'adTypeBinary=1 adTypeText=2
		stm.Mode = 3
		stm.Open
		stm.loadfromfile server.MapPath("inc/loop.txt")
		str = stm.read
		stm.Close
	Set stm = Nothing
	set rss=server.createobject("Adodb.Connection")
	rss.Open objADOXDatabase.ActiveConnection
	set rs=server.createobject("ADODB.recordset")
	rs.open "SELECT * FROM ZN_NotNown"&tablename,rss,3,3
	rs.addnew
	rs("ZN_NotNown"&tablename).AppendChunk str
	rs.update
	rs.close
	set rs=nothing
	set rss=nothing
	
	'广告表
	Set objTable = CreateObject("ADOX.Table")
		objTable.Name = "ZN_"&dbStr(5)
		With objTable.Columns
			.Append "AD_ID", 3
			.Append "AD_Title", 202,255
			.Append "AD_Link", 202,255
			.Append "AD_SizeWidth", 3
			.Append "AD_SizeHeight", 3
			.Append "AD_Type_radio", 3
			.Append "AD_UploadFile", 202,255
			.Append "AD_Order", 3
			.Append "AD_BeginTime", 7
			.Append "AD_EndTime", 7
			.Append "AD_State_radio", 3
			.Append "AD_Adddate", 7
			.Append "AD_AddUserName", 202,255
			.Append "AD_Externallinks", 203
			.Append "AD_Area", 202,255
		End With
		objTable.Keys.Append "AD_ID", 1, "AD_ID"
		Set objTable.ParentCatalog=objADOXDatabase
		objTable.Columns("AD_ID").Properties("Autoincrement")=True
		objTable.Columns("AD_Type_radio").Properties("default")=1
		objTable.Columns("AD_Order").Properties("default")=0
		objTable.Columns("AD_SizeWidth").Properties("default")=0
		objTable.Columns("AD_SizeHeight").Properties("default")=0
		objTable.Columns("AD_Adddate").Properties("default")="now()"
		
		objTable.Columns("AD_Title").Properties("Jet OLEDB:Allow Zero Length") = True
		objTable.Columns("AD_Link").Properties("Jet OLEDB:Allow Zero Length") = True
		objTable.Columns("AD_UploadFile").Properties("Jet OLEDB:Allow Zero Length") = True
		objTable.Columns("AD_AddUserName").Properties("Jet OLEDB:Allow Zero Length") = True
		objTable.Columns("AD_BeginTime").Properties("Jet OLEDB:Allow Zero Length") = True
		objTable.Columns("AD_EndTime").Properties("Jet OLEDB:Allow Zero Length") = True
		objTable.Columns("AD_Externallinks").Properties("Jet OLEDB:Allow Zero Length") = True
		objTable.Columns("AD_Area").Properties("Jet OLEDB:Allow Zero Length") = True
		objADOXDatabase.Tables.Append objTable
	Set objTable=Nothing
	
	'Flash广告表
	Set objTable = CreateObject("ADOX.Table")
		objTable.Name = "ZN_"&dbStr(5)&"_Flash"
		With objTable.Columns
			.Append "ADFlash_ID", 3
			.Append "ADFlash_Title", 202,255
			.Append "ADFlash_Link", 202,255
			.Append "ADFlash_UploadFile", 202,255
			.Append "ADFlash_Order", 3
			.Append "ADFlash_AddDate", 7
		End With
		objTable.Keys.Append "ADFlash_ID", 1, "ADFlash_ID"
		Set objTable.ParentCatalog=objADOXDatabase
		objTable.Columns("ADFlash_ID").Properties("Autoincrement")=True
		objTable.Columns("ADFlash_Order").Properties("default")=0
		objTable.Columns("ADFlash_AddDate").Properties("default")="now()"
		
		objTable.Columns("ADFlash_Title").Properties("Jet OLEDB:Allow Zero Length") = True
		objTable.Columns("ADFlash_Link").Properties("Jet OLEDB:Allow Zero Length") = True
		objTable.Columns("ADFlash_UploadFile").Properties("Jet OLEDB:Allow Zero Length") = True
		objADOXDatabase.Tables.Append objTable
	Set objTable=Nothing
	
	'热门查询表
	Set objTable = CreateObject("ADOX.Table")
		objTable.Name = "ZN_"&dbStr(7)
		With objTable.Columns
			.Append "searchlist_id", 3
			.Append "searchlist_title", 202,255
			.Append "searchlist_url", 202,255
			.Append "searchlist_key", 202,255
			.Append "searchlist_hn", 202,255
			.Append "searchlist_cityid", 3
			.Append "searchlist_updatetime", 7
			.Append "searchlist_count", 3
		End With
		objTable.Keys.Append "searchlist_id", 1, "searchlist_id"
		Set objTable.ParentCatalog=objADOXDatabase
		objTable.Columns("searchlist_id").Properties("Autoincrement")=True
		objTable.Columns("searchlist_count").Properties("default")=0
		objTable.Columns("searchlist_updatetime").Properties("default")="now()"

		objTable.Columns("searchlist_title").Properties("Jet OLEDB:Allow Zero Length") = True
		objTable.Columns("searchlist_url").Properties("Jet OLEDB:Allow Zero Length") = True
		objTable.Columns("searchlist_key").Properties("Jet OLEDB:Allow Zero Length") = True
		objTable.Columns("searchlist_hn").Properties("Jet OLEDB:Allow Zero Length") = True
		objTable.Columns("searchlist_cityid").Properties("Jet OLEDB:Allow Zero Length") = True
		objADOXDatabase.Tables.Append objTable
	Set objTable=Nothing
	
	'网站关键字设置表
	Set objTable = CreateObject("ADOX.Table")
		objTable.Name = "ZN_"&dbStr(8)
		With objTable.Columns
			.Append "KeySet_ID", 3
			.Append "KeySet_PageName", 202,255
			.Append "KeySet_page", 202,255
			.Append "KeySet_Title", 203
			.Append "KeySet_keywords", 203
			.Append "KeySet_description", 203
			.Append "KeySet_updatedate", 7
			.Append "KeySet_rule", 203
		End With
		objTable.Keys.Append "KeySet_ID", 1, "KeySet_ID"
		Set objTable.ParentCatalog=objADOXDatabase
		objTable.Columns("KeySet_ID").Properties("Autoincrement")=True
		objTable.Columns("KeySet_updatedate").Properties("default")="now()"

		objTable.Columns("KeySet_PageName").Properties("Jet OLEDB:Allow Zero Length") = True
		objTable.Columns("KeySet_page").Properties("Jet OLEDB:Allow Zero Length") = True
		objTable.Columns("KeySet_Title").Properties("Jet OLEDB:Allow Zero Length") = True
		objTable.Columns("KeySet_keywords").Properties("Jet OLEDB:Allow Zero Length") = True
		objTable.Columns("KeySet_description").Properties("Jet OLEDB:Allow Zero Length") = True
		objTable.Columns("KeySet_rule").Properties("Jet OLEDB:Allow Zero Length") = True
		objADOXDatabase.Tables.Append objTable
	Set objTable=Nothing

	Dim DBandTable,Teststr
	for i=0 to dom.Length-1
		if dom.GetAtt("s",Rst(i))="1" Then
			If dom.GetAtt("v",Rst(i))="1" Then
				DBandTable=dom.GetNodeText(Rst(i))
				If IsFile(""&webpathB&"Database\"&split(DBandTable,",")(0)&".asa") Then
				Teststr=ExeFSOTEST
				If cbool(Teststr(0))=True or cbool(Teststr(1))=True Then
					deletefiles(""&webpathB&"Database\"&split(DBandTable,",")(0)&".asa")
				End if
				End If
				Rst(i).text=""
			End If
			dom.AddText "#"&dbStr(0)&","&dbStr(1)&","&dbStr(2)&","&dbStr(3)&","&dbStr(4)&","&dbStr(5)&","&dbStr(6)&","&dbStr(7)&","&dbStr(8),true,Rst(i)
			dom.AddAttribute "v","1",Rst(i)
		End If
	Next
	dom.SaveXML()
	Set objADOXDatabase=Nothing
End Function

'=================================
'生成随机字符串函数
function makePassword(byVal maxLen)
Dim strNewPass
Dim whatsNext, upper, lower, intCounter
Randomize
For intCounter = 1 To maxLen
whatsNext = Int(2*Rnd)
If whatsNext = 0 Then
upper = 90
lower = 65
Else
upper = 57
lower = 48
End If
strNewPass = strNewPass & Chr(Int((upper - lower + 1) * Rnd + lower))
Next
makePassword = strNewPass
end function

Class Validator
Private Re

Private Sub Class_Initialize()
	Set Re = New RegExp
	Re.IgnoreCase = True
	Re.Global = True
End Sub

Private Sub Class_Terminate()
	Set Re = Nothing
End Sub

Public Function Islaw(ByVal Str)
Islaw = Test("^[a-zA-Z0-9_-]{4,20}$", Str)
End Function

Public Function Islaws(ByVal Str)
Islaws = Test("^[a-zA-Z0-9_-]{0,20}$", Str)
End Function

Public Function IsUrl(ByVal Str)
IsUrl = Test("^[a-zA-z]+://[^\s]*$", Str)
End Function

Public Function IsNum(ByVal Str)
IsNum= Test("^\d+$", Str)
End Function

Public Function IsChinese(ByVal Str)
IsChinese = Test("^[^u4e00-u9fa5]+$", Str)
End Function

Public Function IsEnglish(ByVal Str)
IsEnglish = Test("^[A-Za-z]+$", Str)
End Function

Private Function Test(ByVal Pattern, ByVal Str)
	If IsNull(Str) Or IsEmpty(Str) Then
		Test = False
	Else
		Re.Pattern = Pattern
		Test = Re.Test(CStr(Str))
	End If
End Function

End Class


Class XMLClass 
Private objXml 
Private xmlDoc 
Private xmlPath 
'//============================================================ 
' 
Sub Class_initialize 
	Set objXml = Server.CreateObject("MSXML2.DOMDocument") 
	objXml.preserveWhiteSpace = true 
	objXml.async = false 
End Sub 

Sub Class_Terminate 
	Set objXml = Nothing 
End Sub 
'//============================================================ 
' 
Public Function CreateNew(sName) 
Dim tmpNode
	Set tmpNode = objXml.createElement(sName) 
	objXml.appendChild(tmpNode) 
	Set CreateNew = tmpNode 
End Function 
' 
Public Function OpenXml(sPath) 
	OpenXml=False 
	sPath=Server.MapPath(sPath) 
	'Response.Write(sPath) 
	xmlPath = sPath 
		If objXml.load(sPath) Then 
			Set xmlDoc = objXml.documentElement 
			OpenXml=True 
		End If 
End Function 
' 
Public Sub LoadXml(sStr) 
	objXml.loadXML(sStr) 
	Set xmlDoc = objXml.documentElement 
End Sub 

Public Sub InceptXml(xObj) 
	Set objXml = xObj 
	Set xmlDoc = xObj.documentElement 
End Sub 
'//============================================================ 
' 
Public Function AddNode(sNode,rNode) 
' sNode STRING 节点名称 
' rNode OBJECT 增加节点的上级节点引用 
'============================================================= 
	Dim TmpNode 
	Set TmpNode = objXml.createElement(sNode) 
	rNode.appendChild TmpNode 
	Set AddNode = TmpNode 
End Function 
' 
Public Function AddAttribute(sName,sValue,oNode) 
' sName STRING 属性名称 
' sValue STRING 属性值 
' oNode OBJECT 增加属性的对象 
'============================================================= 
	oNode.setAttribute sName,sValue 
End Function 
' 
Public Function AddText(FStr,cdBool,oNode) 
	Dim tmpText 
	If cdBool Then 
		Set tmpText = objXml.createCDataSection(FStr) 
	Else 
		Set tmpText = objXml.createTextNode(FStr) 
	End If 
	oNode.appendChild tmpText 
End Function 
'======================================================================================================== 
' 
Public Function GetAtt(aName,oNode) 
' aName STRING 属性名称 
' oNode OBJECT 节点引用 
'============================================================= 
	dim tmpValue 
	tmpValue = oNode.getAttribute(aName) 
	GetAtt = tmpValue 
End Function 
' 
Public Function GetNodeName(oNode) 
' oNode OBJECT 节点引用 
	GetNodeName = oNode.nodeName 
End Function 
' 
Public Function GetNodeText(oNode) 
' oNode OBJECT 节点引用 
	GetNodeText = oNode.childNodes(0).nodeValue 
End Function 
' 
Public Function GetNodeType(oNode) 
' oNode OBJECT 节点引用 
	GetNodeType = oNode.nodeValue 
End Function 
' 
Public Function FindNodes(sNode) 
	Dim tmpNodes 
	Set tmpNodes = objXml.getElementsByTagName(sNode) 
	Set FindNodes = tmpNodes 
End Function 
' 
Public Function FindNode(sNode) 
	Dim TmpNode 
	Set TmpNode=objXml.selectSingleNode(sNode) 
	Set FindNode = TmpNode 
End Function 
' 
Public Function DelNode(sNode) 
	Dim TmpNodes,Nodesss 
	Set TmpNodes=objXml.selectSingleNode(sNode) 
	Set Nodesss=TmpNodes.parentNode 
	Nodesss.removeChild(TmpNodes) 
End Function 
' 
Public Function ReplaceNode(sNode,sText,cdBool) 
'replaceChild 
	Dim TmpNodes,tmpText 
	Set TmpNodes=objXml.selectSingleNode(sNode) 
	'AddText sText,cdBool,TmpNodes 
	If cdBool Then 
		Set tmpText = objXml.createCDataSection(sText) 
	Else 
		Set tmpText = objXml.createTextNode(sText) 
	End If 
	TmpNodes.replaceChild tmpText,TmpNodes.firstChild 
End Function 

Private Function ProcessingInstruction 
'//--创建XML声明 
	Dim objPi 
	Set objPi = objXML.createProcessingInstruction("xml", "version="&chr(34)&"1.0"&chr(34)&" encoding="&chr(34)&"gb2312"&chr(34)) 
'//--把xml生命追加到xml文档 
	objXML.insertBefore objPi, objXML.childNodes(0) 
End Function 
'//============================================================================= 
' 
Public Function SaveXML() 
'ProcessingInstruction() 
	objXml.save(xmlPath) 
End Function 
' 
Public Function SaveAsXML(sPath) 
	ProcessingInstruction() 
	objXml.save(sPath) 
End Function 
'//================================================================================== 
'相关统计 
' 
Property Get Root 
	Set Root = xmlDoc 
End Property 
' 
Property Get Length 
	Length = xmlDoc.childNodes.length 
End Property 
'//================================================================================== 
'相关测试 
Property Get TestNode 
	TestNode = xmlDoc.childNodes(0).text 
End Property 

End Class

Function ExeFSOTEST()
	On Error Resume Next
	Dim DBandTable,Rst
	Dim tfile,TestObj,Fdate(2),i
	Fdate(0)=True
	Fdate(1)=True
	set Rst=dom.FindNodes("step")
	for i=0 to dom.Length-1
		if dom.GetAtt("s",Rst(i))="3" Then
			If Rst(i).text="" Then
				Set TestObj = Server.CreateObject("Scripting.FileSystemObject")
				if TestObj.FileExists(server.MapPath("test.txt")) then TestObj.DeleteFile(server.MapPath("test.txt"))
				set tfile=TestObj.CreateTextFile(server.MapPath("test.txt"),true,true)
				tfile.WriteLine("测试")
				tfile.close
				set tfile=nothing
					err=0
				if TestObj.FileExists(server.mappath("inc/deletetest.txt")) Then
					TestObj.DeleteFile(server.MapPath("inc/deletetest.txt"))
					if err<>0 then Fdate(0)=False:err=0
				end if
				TestObj.DeleteFile(server.MapPath("test.txt"))
				if err<>0 then Fdate(1)=False:err=0
				dom.AddText cstr(Fdate(0))&"|"&cstr(Fdate(1)),False,Rst(i)
				Set TestObj=Nothing
			Else
				DBandTable=split(dom.GetNodeText(Rst(i)),"|")
				Fdate(0)=DBandTable(0)
				Fdate(1)=DBandTable(1)
			End If
		End If
	Next
	dom.SaveXML()
	ExeFSOTEST=Fdate
End Function
'测试组件支持情况
Function ObjectTest(strObj)
	On Error Resume Next
	Dim TestObj,Teststr
	ObjectTest = "<font color=red>不支持</font>"
	Err = 0
	Set TestObj = Server.CreateObject(strObj)
	If lcase(strObj)=lcase("Scripting.FileSystemObject") Then
		Teststr=ExeFSOTEST
		Err=0
		If cbool(Teststr(0))<>True or cbool(Teststr(1))<>True Then
			Err=1
		End if
	End If
	If 0 = Err Then
		ObjectTest = "<font color=green>支持</font>"
	Else
		checkobjs=true
	End If
	Set TestObj=Nothing
	If Err.Number <> 0 Then Err.Clear
End Function

'验证是否为联盟会员
Function checkcityid(agent_id,agent_md)
	dim apiUrl,xml,root
	apiUrl="http://un.api.zhuna.cn/api/gbk/usercheck.asp?u="&agent_id&"&m="&agent_md
	set xml=GetXml(apiUrl,"")
	if xml.xml<>"" then
		set root=xml.documentElement
		if root is nothing then
			checkcityid=1
		else
			checkcityid =root.text
		end if
	else
		checkcityid=1
	end if
	set xml=nothing
End Function

'获取城市对于的id号
Function getcityid(agent_id,agent_md,cityname)
	dim apiUrl,xml,root,objNodes
	apiUrl="http://un.api.zhuna.cn/api/gbk/cityname.asp?city="&ec(cityname)&""
	set xml=GetXml(apiUrl,"")
	if xml.xml<>"" then
		set root=xml.documentElement
		Set objNodes = root.selectSingleNode("city[@name='"&cityname&"']")
		if objNodes is nothing then
		getcityid=0
		else
		getcityid =objNodes.getAttribute("ID")
		end if
	else
		getcityid=0
	end if
	set xml=nothing
End Function

'生成城市列表
Function CreatcityList()
	dim apiUrl,xml,root,creathlisturl,objNodes,strs,i
	apiUrl="http://un.api.zhuna.cn/api/gbk/city.asp"
	set xml=GetXml(apiUrl,"")
	if xml.xml<>"" then
		set root=xml.documentElement
		Set objNodes = root.childNodes
		If objNodes.Length>0 Then
			strs="<select name=""data(5)"">"&vbCrlf
			For i=0 to objNodes.Length-1
				strs=strs&"<option  value='"&objNodes.item(i).getAttribute("ID")&"|"&objNodes.item(i).getAttribute("name")&"'>"&objNodes.item(i).getAttribute("suoxie")&chr(13)&objNodes.item(i).getAttribute("name")&"</option>"&vbCrlf
			Next
			strs=strs&"</select>"
		End If
		CreatcityList=strs
	else
		CreatcityList=""
	end if
	set xml=nothing
End Function
%>
