<!--#include file="conn.asp"-->
<%if session(hxCacheName&"_admin")<>"OK" then
    response.redirect("admin_login.asp")
    end if
 if request.cookies(hxCacheName&"_rank")("rank")>1 then
  	response.write "<script language='javascript'>"
	response.write "alert('您的级别不够！');"
	response.write "location.href='javascript:history.go(-1)';"			
	response.write "</script>"
    end if%>

<link href="../style.css" rel="stylesheet" type="text/css">
<BODY background="../images/back.gif">
<script language=javascript src=../images/mouse_on_title.js></script>
<script LANGUAGE=JavaScript>
  function textLimitCheck(thisArea, maxLength){
    if (thisArea.value.length > maxLength){
      alert(maxLength + ' 个字限制. \r超出的将自动去除.');
      thisArea.value = thisArea.value.substring(0, maxLength);
      thisArea.focus();
    }
    /*回写span的值，当前填写文字的数量*/
    messageCount.innerText = thisArea.value.length;
  }
</script>
<style type="text/css">
<!--
body {
	background-color: #dadae9;
}
.style1 {
	color: #FFFFFF;
	font-weight: bold;
}
.style2 {color: #FF0000}
-->
</style>
 <%
if request("action")="config" then
call config
else
call showaddform
end if

sub showaddform
dim rs,sql,id,action,blnerror
id=request("id")

set rs = Server.CreateObject("ADODB.RecordSet")
sql="select * from [tt_config]" 
rs.open sql,conn,1,3

%>
<script language="javascript">
<!--
function form1_onsubmit() {

if (document.form1.WebName.value=="")
	{
	  alert("请填网站名称！")
	  document.form1.WebName.focus()
	  return false
	 }
if (document.form1.Weburl.value=="")
	{
	  alert("请填网址！")
	  document.form1.Weburl.focus()
	  return false
	 }
 
if (document.form1.WebLogo.value=="")
	{
	  alert("请填网站LOGO地址！")
	  document.form1.WebLogo.focus()
	  return false
	 }
if (document.form1.WebAlt.value=="")
	{
	  alert("请填网站说明！")
	  document.form1.WebAlt.focus()
	  return false
	 }
if (document.form1.ChannelName.value=="")
	{
	  alert("请填网站频道名称！")
	  document.form1.ChannelName.focus()
	  return false
	 }
if (document.form1.webemail.value=="")
	{
	  alert("请填网站电子信箱！")
	  document.form1.webemail.focus()
	  return false
	 }
	 	 	 	 	 
if (document.form1.hxCacheName.value=="")
	{
	  alert("请填网站缓存名称！")
	  document.form1.hxCacheName.focus()
	  return false
	 }
	 	 	 	 
	  
}
// --></script>
<table width="100%" border="0" cellpadding="0" cellspacing="0" bordercolor="#111111" style="border-collapse: collapse">
  <tr>
    <td align="center">
      <form name="form1" method="POST" action="admin_config.asp?ok=1&id=<%=request("id")%>&action=config"" language="javascript" onSubmit="return form1_onsubmit()">
        <table border="1" cellspacing="0" cellpadding="0" width="100%" style="border-collapse: collapse" bordercolor="#ADAED6" height="799">
          <tr> 
            <td width="688" height="28" >
            <p class="main_title<%=skin%>"><font size="2">&nbsp;网站基本参数</font></td>
          </tr>
          <tr> 
            <td bgcolor="#FFFFFF" align="center" style="border-left-style: none; border-left-width: medium; border-right-style: none; border-right-width: medium" width="686" height="735"> 
              <table width="100%" border="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111">
              
                <tr> 
                  <td width="26%" style="border-bottom-style: none; border-bottom-width: medium; border-top-style:solid; border-top-width:1" height="27" bgcolor="#FFFFFF">
                  <p style="margin-left: 20">设定网站名称：</td>
                  <td width="84%" style="border-bottom-style: none; border-bottom-width: medium; border-top-style:solid; border-top-width:1" height="27" bgcolor="#FFFFFF"> 
                    <p style="margin-left: 20"> 
                    <input type="text" name="WebName" value="<%=rs("WebName")%>" size="40"> 
                    </td>
                </tr>
                <tr>
                  <td width="26%" style="border-bottom-style: none; border-bottom-width: medium; border-top-style:none; border-top-width:medium" height="27" bgcolor="#FFFFFF">
                  <p style="margin-left: 20">网站访问地址：</td>
                  <td width="84%" style="border-bottom-style: none; border-bottom-width: medium; border-top-style:none; border-top-width:medium" height="27" bgcolor="#FFFFFF"> 
                    <p style="margin-left: 20"> 
                    <input type="text" name="Weburl" value="<%=rs("Weburl")%>" size="40"> &nbsp;&nbsp; <img src=../images/memo.gif alt="前面要带“http://”，后面要带“/”">
                    </td>
                </tr>
                             
                <tr> 
                  <td width="26%" style="border-top-style: none; border-top-width: medium; border-bottom-style: none; border-bottom-width: medium" height="33" bgcolor="#FFFFFF">
                  <p style="margin-left: 20">网站WebLogo：</td>
                  <td width="84%" style="border-top-style: none; border-top-width: medium; border-bottom-style: none; border-bottom-width: medium" height="33" bgcolor="#FFFFFF">
                    <p style="margin-left: 20">
                    <input type="text" name="WebLogo" value="<%=rs("WebLogo")%>" size="40"> 
                    </td>
                </tr>
                <tr> 
                  <td width="26%" style="border-top-style: none; border-top-width: medium; border-bottom-style: none; border-bottom-width: medium" height="33" bgcolor="#FFFFFF">
                  <p style="margin-left: 20">网站说明：</td>
                  <td width="84%" style="border-top-style: none; border-top-width: medium; border-bottom-style: none; border-bottom-width: medium" height="33" bgcolor="#FFFFFF">
                    <p style="margin-left: 20">
                    <input type="text" name="WebAlt" value="<%=rs("WebAlt")%>" size="40"  onkeyUp="textLimitCheck(this, 50);"> <br>限 50 个字符 已输入 <font color="#CC0000"><span id="messageCount">0</span></font> 个字&nbsp;&nbsp; <img src=../images/memo.gif alt="用于超链接alt显示，不宜太多">
                    </td>
                </tr>                
      
                <tr> 
                  <td width="26%" style="border-top-style: none; border-top-width: medium; border-bottom-style: none; border-bottom-width: medium" height="33" bgcolor="#FFFFFF">
                  <p style="margin-left: 20">网站频道名称：</td>
                  <td width="84%" style="border-top-style: none; border-top-width: medium; border-bottom-style: none; border-bottom-width: medium" height="33" bgcolor="#FFFFFF">
                    <p style="margin-left: 20">
                    <input type="text" name="ChannelName" value="<%=rs("ChannelName")%>" size="30"> 
                    </td>
                </tr>
                  <tr>
                  <td width="26%" style="border-top-style: none; border-top-width: medium; border-bottom-style: none; border-bottom-width: medium" height="33" bgcolor="#FFFFFF">
				  <p style="margin-left: 20">网站电子信箱：</td>
                  <td style="border-top-style: none; border-top-width: medium; border-bottom-style: none; border-bottom-width: medium" height="28" bgcolor="#FFFFFF"><p style="margin-left: 20"><input type="text" name="webemail" value="<%=rs("webemail")%>" size="30">
                  </td>
                </tr>
                <tr>
                  <td width="26%" style="border-top-style: none; border-top-width: medium; border-bottom-style: none; border-bottom-width: medium" height="33" bgcolor="#FFFFFF">
	<p style="margin-left: 20">是否使用邮件功能：</td>
                  <td style="border-top-style: none; border-top-width: medium; border-bottom-style: none; border-bottom-width: medium" height="28" bgcolor="#FFFFFF"><p style="margin-left: 20"> <%if rs("emailkg")=1 then%>               
                <input type="radio" name="emailkg" value="1" id="emailkg" checked>
                 使用&nbsp;&nbsp;&nbsp;&nbsp;
                <input type="radio" name="emailkg" value="0" id="emailkg">
                不使用&nbsp;&nbsp; <img src=../images/memo.gif alt="用户注册、系统管理等要用到自动邮件通知功能，建议使用"></td>
                <%else%>                         
                <input type="radio" name="emailkg" value="1" id="emailkg">
                 使用&nbsp;&nbsp;&nbsp;&nbsp;
                <input type="radio" name="emailkg" value="0" id="emailkg" checked>
                不使用&nbsp;&nbsp; <img src=../images/memo.gif alt="用户注册、系统管理等要用到自动邮件通知功能，建议使用"><%end if%>
                  </td>
                </tr>                             
                 <tr> 
                  <td width="26%" style="border-top-style: none; border-top-width: medium; border-bottom-style: none; border-bottom-width: medium" height="33" bgcolor="#FFFFFF">
                  <p style="margin-left: 20">邮件服务器SMTP地址：</td>
                  <td width="84%" style="border-top-style: none; border-top-width: medium; border-bottom-style: none; border-bottom-width: medium" height="33" bgcolor="#FFFFFF">
                    <p style="margin-left: 20">
                    <input type="text" name="servesmtp" value="<%=rs("servesmtp")%>" size="30"> 
                    </td>
                </tr>
                <tr>
                  <td width="26%" style="border-top-style: none; border-top-width: medium; border-bottom-style: none; border-bottom-width: medium" height="33" bgcolor="#FFFFFF">
				  <p style="margin-left: 20">邮件服务器登录帐号：</td>
                  <td style="border-top-style: none; border-top-width: medium; border-bottom-style: none; border-bottom-width: medium" height="28" bgcolor="#FFFFFF"><p style="margin-left: 20"><input type="text" name="servemail" value="<%=rs("servemail")%>" size="30">  &nbsp;&nbsp; <img src=../images/memo.gif alt="必须使用与网站电子信箱相同的邮件服务器<p>如网站电子信箱为admin@126.com，<br>则“邮件服务器SMTP地址”地址为smtp.126.com，<br>“邮件服务器登录帐号”为admin<br>登录密码当然要你才知道啦<p>又如网站电子信箱为myemail@ttdv.cn,<br>“邮件服务器SMTP地址”地址为218.92.161.200<br>“邮件服务器登录帐号”为myemail@ttdv.cn<br>邮件服务器域名为ttdv.cn<br>登录密码当然要你才知道啦">
                  </td>
                </tr>
                 <tr>
                  <td width="26%" style="border-top-style: none; border-top-width: medium; border-bottom-style: none; border-bottom-width: medium" height="33" bgcolor="#FFFFFF">
				  <p style="margin-left: 20">邮件服务器登录密码：</td>
                  <td style="border-top-style: none; border-top-width: medium; border-bottom-style: none; border-bottom-width: medium" height="28" bgcolor="#FFFFFF"><p style="margin-left: 20"><input type="password" name="servekey" value="<%=rs("servekey")%>" size="33">
                  </td>
                </tr>
         
                <tr>
                  <td width="26%" style="border-top-style: none; border-top-width: medium; border-bottom-style: none; border-bottom-width: medium" height="33" bgcolor="#FFFFFF">
				  <p style="margin-left: 20">邮件服务器域名：</td>
                  <td style="border-top-style: none; border-top-width: medium; border-bottom-style: none; border-bottom-width: medium" height="28" bgcolor="#FFFFFF"><p style="margin-left: 20"><input type="text" name="mailuserdomain" value="<%=rs("mailuserdomain")%>" size="30">&nbsp;&nbsp; <img src=../images/memo.gif alt="若用“myemail@ttdv.cn”这样的帐号登录时，请指明ttdv.cn">
                  </td>
                </tr>

                 
                <tr bgcolor="#BDBEDE">
                  <td height="28" colspan="2" style="border-top-style: none; border-top-width: medium; border-bottom-style: solid; border-bottom-width: 1">
                    <span class="main_title<%=skin%>"><font size="2">&nbsp;自定义参数设定</font></span></td>
                </tr>
                <tr>
                  <td style="border-bottom-style: none; border-bottom-width: medium" height="29" bgcolor="#FFFFFF"><span style="margin-left: 20">最多显示多少行：</span></td>
                  <td width="84%" height="29" bgcolor="#FFFFFF" style="border-bottom-style: none; border-bottom-width: medium"><p style="margin-left: 20">
                      <input type="text" name="MaxLine" value="<%=rs("MaxLine")%>" size="20" />
                  <font color="#FF0000">&nbsp;&nbsp; <img src=../images/memo.gif alt="0为不限制，必须大于或等于显示图片链接的行数参数"></p></td>
                </tr>
                
                <tr>
                  <td height="29" bgcolor="#FFFFFF" style="border-bottom-style: none; border-bottom-width: medium"><span style="margin-left: 20">每一行显示网站的个数：</span></td>
                  <td style="border-bottom-style: none; border-bottom-width: medium" height="29" bgcolor="#FFFFFF"><p style="margin-left: 20">
                      <input type="text" name="LineNum" value="<%=rs("LineNum")%>" size="20" /></td>
                </tr>
                <tr>
                  <td height="29" bgcolor="#FFFFFF" style="border-bottom-style: none; border-bottom-width: medium"><span style="margin-left: 20">显示图片链接的行数：</span></td>
                  <td style="border-bottom-style: none; border-bottom-width: medium" height="29" bgcolor="#FFFFFF"><p style="margin-left: 20">
                      <input type="text" name="LineLogo" value="<%=rs("LineLogo")%>" size="20" /></td>
                </tr>
                <tr>
                  <td height="29" bgcolor="#FFFFFF" style="border-bottom-style: none; border-bottom-width: medium"><span  style="margin-left: 20">首页显示条件：</span></td>
                  <td style="border-bottom-style: none; border-bottom-width: medium" height="29" bgcolor="#FFFFFF"><p style="margin-left: 20">
            <input type="text" name="inpc" value="<%=rs("inpc")%>" size="20" />&nbsp;&nbsp; <img src=../images/memo.gif alt="平均每天点入多少次以上的网站才显示链接"></td>
                </tr>
                <tr>
                  <td height="29" bgcolor="#FFFFFF" style="border-bottom-style: none; border-bottom-width: medium"><span  style="margin-left: 20">分页每页显示的记录数：</span></td>
                  
				  
				  <td height="29" bgcolor="#FFFFFF" style="border-bottom-style: none; border-bottom-width: medium"><p style="margin-left: 20">
                      <input name="MaxPageSize" type="text" id="MaxPageSize" value="<%=rs("MaxPageSize")%>" size="20" />&nbsp;&nbsp; <img src=../images/memo.gif alt="分页时每页显示的记录数"></td>
                </tr>
                
                  <tr>
                  <td height="29" bgcolor="#FFFFFF" style="border-bottom-style: none; border-bottom-width: medium"><span style="margin-left: 20">缓存刷新时间：</span></td>
                  <td style="border-bottom-style: none; border-bottom-width: medium" height="29" bgcolor="#FFFFFF"><p style="margin-left: 20">
                      <input type="text" name="CacheTime" value="<%=rs("CacheTime")%>" size="20" />分钟&nbsp;&nbsp; <img src=../images/memo.gif alt="缓存刷新时间，默认为30分钟"></td>
                </tr> 
                  <tr>
                  <td height="29" bgcolor="#FFFFFF" style="border-bottom-style: none; border-bottom-width: medium"><span style="margin-left: 20">同一IP计数间隔时间：</span></td>
                  <td style="border-bottom-style: none; border-bottom-width: medium" height="29" bgcolor="#FFFFFF"><p style="margin-left: 20">
                      <input type="text" name="HitsTime" value="<%=rs("HitsTime")%>" size="20" />小时&nbsp;&nbsp; <img src=../images/memo.gif alt="同一IP隔多少时间后点击才继续计数，单位小时，默认为12小时"></td>
                </tr>
                <tr>
                  <td width="26%" style="border-top-style: none; border-top-width: medium; border-bottom-style: none; border-bottom-width: medium" height="33" bgcolor="#FFFFFF">
	<p style="margin-left: 20">同域名注册限制：</td>
                  <td style="border-top-style: none; border-top-width: medium; border-bottom-style: none; border-bottom-width: medium" height="28" bgcolor="#FFFFFF"><p style="margin-left: 20"> <%if rs("IsDomainLimit")=1 then%>               
                <input type="radio" name="IsDomainLimit" value="1" id="IsDomainLimit" checked>
                 限制&nbsp;&nbsp;&nbsp;&nbsp;
                <input type="radio" name="IsDomainLimit" value="0" id="IsDomainLimit">
                不限制&nbsp;&nbsp; <img src=../images/memo.gif alt="同一域名是否只能注册一次"></td>
                <%else%>                         
                <input type="radio" name="IsDomainLimit" value="1" id="IsDomainLimit">
                 限制&nbsp;&nbsp;&nbsp;&nbsp;
                <input type="radio" name="IsDomainLimit" value="0" id="IsDomainLimit" checked>
                不限制&nbsp;&nbsp; <img src=../images/memo.gif alt="同一域名是否只能注册一次"><%end if%>
                  </td>
                </tr>                       
                <tr>
                  <td width="26%" style="border-top-style: none; border-top-width: medium; border-bottom-style: none; border-bottom-width: medium" height="33" bgcolor="#FFFFFF">
	<p style="margin-left: 20">是否需要审核才能显示：</td>
                  <td style="border-top-style: none; border-top-width: medium; border-bottom-style: none; border-bottom-width: medium" height="28" bgcolor="#FFFFFF"><p style="margin-left: 20"> <%if rs("IsVerify")=1 then%>               
                <input type="radio" name="IsVerify" value="1" id="IsVerify" checked>
                 手工&nbsp;&nbsp;&nbsp;&nbsp;
                <input type="radio" name="IsVerify" value="0" id="IsVerify">
                自动</td>
                <%else%>                         
                <input type="radio" name="IsVerify" value="1" id="IsVerify">
                 手工&nbsp;&nbsp;&nbsp;&nbsp;
                <input type="radio" name="IsVerify" value="0" id="IsVerify" checked>
                自动<%end if%>
                  </td>
                </tr>                
                <tr>
                  <td width="26%" style="border-top-style: none; border-top-width: medium; border-bottom-style: none; border-bottom-width: medium" height="33" bgcolor="#FFFFFF">
	<p style="margin-left: 20">限定点入来源域名：</td>
                  <td style="border-top-style: none; border-top-width: medium; border-bottom-style: none; border-bottom-width: medium" height="28" bgcolor="#FFFFFF"><p style="margin-left: 20"> <%if rs("Isanti")=1 then%>               
                <input type="radio" name="Isanti" value="1" id="Isanti" checked>
                 限定&nbsp;&nbsp;&nbsp;&nbsp;
                <input type="radio" name="Isanti" value="0" id="Isanti">
                不限定&nbsp;&nbsp; <img src=../images/memo.gif alt="是否限定点入来源只能在其登记的网站域名上"></td>
                <%else%>                         
                <input type="radio" name="Isanti" value="1" id="Isanti">
                 限定&nbsp;&nbsp;&nbsp;&nbsp;
                <input type="radio" name="Isanti" value="0" id="Isanti" checked>
                不限定&nbsp;&nbsp; <img src=../images/memo.gif alt="是否限定点入来源只能在其登记的网站域名上"><%end if%>
                  </td>
                </tr>
                <tr>
                  <td width="26%" style="border-top-style: none; border-top-width: medium; border-bottom-style: none; border-bottom-width: medium" height="33" bgcolor="#FFFFFF">
	<p style="margin-left: 20">检测代理服务器点击：</td>
                  <td style="border-top-style: none; border-top-width: medium; border-bottom-style: none; border-bottom-width: medium" height="28" bgcolor="#FFFFFF"><p style="margin-left: 20"> <%if rs("IPanti")=1 then%>               
                <input type="radio" name="IPanti" value="1" id="IPanti" checked>
                 检测&nbsp;&nbsp;&nbsp;&nbsp;
                <input type="radio" name="IPanti" value="0" id="IPanti">
                不检测</td>
                <%else%>                         
                <input type="radio" name="IPanti" value="1" id="IPanti">
                检测&nbsp;&nbsp;&nbsp;&nbsp;
                <input type="radio" name="IPanti" value="0" id="IPanti" checked>
                不检测<%end if%>
                  </td>
                </tr>                                    

                  <tr>
                  <td height="29" bgcolor="#FFFFFF" style="border-bottom-style: none; border-bottom-width: medium"><span style="margin-left: 20">定义要过滤的网站名称：</span></td>
                  <td style="border-bottom-style: none; border-bottom-width: medium" height="29" bgcolor="#FFFFFF"><p style="margin-left: 20">
                      <input type="text" name="FilterWord" value="<%=rs("FilterWord")%>" size="60" />&nbsp;&nbsp; <img src=../images/memo.gif alt="定义要过滤的网站名称，用|隔开"></td>
                </tr>                                                                          
                  <tr>
                  <td height="29" bgcolor="#FFFFFF" style="border-bottom-style: none; border-bottom-width: medium"><span style="margin-left: 20">定义要屏蔽的域名：</span></td>
                  <td style="border-bottom-style: none; border-bottom-width: medium" height="29" bgcolor="#FFFFFF"><p style="margin-left: 20">
                      <input type="text" name="FilterDomain" value="<%=rs("FilterDomain")%>" size="20" />&nbsp;&nbsp; <img src=../images/memo.gif alt="定义要屏蔽的域名，用|隔开,空为不限制"></td>
                </tr>
                  <tr>
                  <td height="29" bgcolor="#FFFFFF" style="border-bottom-style: none; border-bottom-width: medium"><span style="margin-left: 20">默认配色方案：</span></td>
                  <td style="border-bottom-style: none; border-bottom-width: medium" height="29" bgcolor="#FFFFFF"><p style="margin-left: 20">
                      <select name="skin" id="skin">
          <option value="1" selected>蓝天白云</option>
          <option value="2" <%if rs("skin")=2 then response.write("selected")%>>水晶紫色</option>
		  <option value="3" <%if rs("skin")=3 then response.write("selected")%>>秋意盎然</option>
		  <option value="4" <%if rs("skin")=4 then response.write("selected")%>>粉色回忆</option>
		  <option value="5" <%if rs("skin")=5 then response.write("selected")%>>浓浓绿意</option>
		  <option value="6" <%if rs("skin")=6 then response.write("selected")%>>橘子红了</option>
                  <option value="7" <%if rs("skin")=7 then response.write("selected")%>>青青河草</option>		  
		  <option value="8" <%if rs("skin")=8 then response.write("selected")%>>黄金季节</option>
        </select></td>
                </tr>                                           
                                
                
                <tr bgcolor="#BDBEDE">
                  <td height="28" colspan="2" bgcolor="#BDBEDE" style="border-top-style: none; border-top-width: medium; border-bottom-style: solid; border-bottom-width: 1"><span class="main_title<%=skin%>"><font size="2">&nbsp;系统参数设置</font></span></td>
                </tr>
                <tr>
                  <td width="26%" style="border-top-style: none; border-top-width: medium; border-bottom-style: none; border-bottom-width: medium" height="33" bgcolor="#FFFFFF">
	<p style="margin-left: 20">定义运行模式：</td>
                  <td style="border-top-style: none; border-top-width: medium; border-bottom-style: none; border-bottom-width: medium" height="28" bgcolor="#FFFFFF"><p style="margin-left: 20"> <%if rs("IsDeBug")=1 then%>               
                <input type="radio" name="IsDeBug" value="1" id="IsDeBug" checked>
                 输出&nbsp;&nbsp;&nbsp;&nbsp;
                <input type="radio" name="IsDeBug" value="0" id="IsDeBug">
                不输出&nbsp;&nbsp; <img src=../images/memo.gif alt="定义运行模式，数据库操作出错时输出错误信息，方便调试"></td>
                <%else%>                         
                <input type="radio" name="IsDeBug" value="1" id="IsDeBug">
                输出&nbsp;&nbsp;&nbsp;&nbsp;
                <input type="radio" name="IsDeBug" value="0" id="IsDeBug" checked>
                不输出&nbsp;&nbsp; <img src=../images/memo.gif alt="定义运行模式，数据库操作出错时输出错误信息，方便调试"><%end if%>
                  </td>
                </tr> 
                <tr>
                  <td width="26%" style="border-top-style: none; border-top-width: medium; border-bottom-style: none; border-bottom-width: medium" height="33" bgcolor="#FFFFFF">
	<p style="margin-left: 20">定义数据库类别：</td>
                  <td style="border-top-style: none; border-top-width: medium; border-bottom-style: none; border-bottom-width: medium" height="28" bgcolor="#FFFFFF"><p style="margin-left: 20"> <%if rs("IsSqlDataBase")=1 then%>               
                <input type="radio" name="IsSqlDataBase" value="1" id="IsSqlDataBase" checked>
                 SQL数据库&nbsp;&nbsp;&nbsp;&nbsp;
                <input type="radio" name="IsSqlDataBase" value="0" id="IsSqlDataBase">
                Access数据库</td>
                <%else%>                         
                <input type="radio" name="IsSqlDataBase" value="1" id="IsSqlDataBase">
                SQL数据库&nbsp;&nbsp;&nbsp;&nbsp;
                <input type="radio" name="IsSqlDataBase" value="0" id="IsSqlDataBase" checked>
                Access数据库<%end if%>
                  </td>
                </tr>                                                        
                <tr>
                  <td height="29" bgcolor="#FFFFFF" style="border-bottom-style: none; border-bottom-width: medium"><span style="margin-left: 20">缓存名称：</span></td>
                  <td height="29" bgcolor="#FFFFFF" style="border-bottom-style: none; border-bottom-width: medium"><p style="margin-left: 20">
                      <input name="hxCacheName" type="text" value="<%=rs("hxCacheName")%>" size="20" maxlength="10" />
                      <label></label>&nbsp;&nbsp; <img src=../images/memo.gif alt="缓存名称，如果一个空间内放置了多个此系统，请更改此名称"></td>
                </tr>


          <tr>
            <td align="center" width="688" bgcolor="#eeeeee" height="35">            <table width="100%"  border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td><div align="center">
                  <input type="submit" value="确认设置" name="B1">
                </div></td>
                <td><div align="center">
                  <input type="reset" value="取消设置" name="B1">
                </div></td>
              </tr>
            </table></td>
          </tr>
        </table>
<%rs.close
	conn.close
	set rs=nothing
	set conn=nothing
%>
      </form>
    </td>
  </tr>
</table>
<%end sub%>
<%sub config
dim WebName,Weburl,WebLogo,WebAlt,ChannelName,webemail,emailkg,servesmtp,servemail,servekey,mailuserdomain,MaxLine,LineNum,LineLogo,inpc,MaxPageSize,CacheTime,HitsTime,hxCacheName,url1,url2,url3
WebName=request.form("WebName")
Weburl=request.form("Weburl")
WebLogo=request.form("WebLogo")
WebAlt=request.form("WebAlt")
ChannelName=request.form("ChannelName")
webemail=request.form("webemail")
emailkg=request.form("emailkg")
servesmtp=request.form("servesmtp")
servemail=request.form("servemail")
servekey=request.form("servekey")
mailuserdomain=request.form("mailuserdomain")
MaxLine=request.form("MaxLine")
LineNum=request.form("LineNum")
LineLogo=request.form("LineLogo")
inpc=request.form("inpc")
MaxPageSize=request.form("MaxPageSize")
CacheTime=request.form("CacheTime")
HitsTime=request.form("HitsTime")
hxCacheName=request.form("hxCacheName")
url1=Left(Weburl,7)
url2=Left(Weburl,14)
url3=right(Weburl,1)

dim blnerror,strerror,id,rs,sql
blnerror=false

if url1<>"http://" then
	blnerror=true
	strerror="<li>请正确输入网址，必须含'http://'！</li>"
end if
if url2="http://http://" then
	blnerror=true
	strerror="<li>请正确输入网址，必须含'http://'！</li>"
end if
if url3<>"/" then
	blnerror=true
	strerror="<li>网址最后不要加'/'！</li>"
end if
if CInt(request.form("MaxLine"))<CInt(request.form("LineLogo")) then
	blnerror=true
	strerror="<li>显示图片链接的行数必须小于最多显示多少行的行数！</li>"
end if
'增强邮箱和网址的判断
if webemail<>"" and not CheckEmail(webemail) then
	blnerror = true
	strerror = strerror & "<li>联系邮箱不正确！</li>"
end if
'if not CheckUrl(Weburl) then   '取消网址判断，否则使用类似链接系统的用户无法互相申请
'	blnerror = true
'	strerror = strerror & "<li>网址不正确！</li>"
'end if

if emailkg="1" and (servesmtp="" or servemail="" or servekey="") then
	blnerror=true
	strerror="<li>使用邮件功能必须填写邮件服务器SMTP地址、帐号和登录密码！</li>"
end if
if Instr(servemail,"@")<>0 and mailuserdomain="" then
	blnerror=true
	strerror="<li>若用“myemail@ttdv.cn”这样的帐号登录时，请指明邮件服务器域名为“ttdv.cn”！</li>"
end if
if blnerror=true then
	response.write strerror
	response.write "<p><< <a href=""javascript:history.go(-1)"">返回上一页 </a></p>"
else


 id=request("id")
 set rs=server.createobject("adodb.recordset")
sql="select * from [tt_config] "
rs.open sql,conn,1,3

rs("WebName")=request("WebName")
rs("Weburl")=request("Weburl")
rs("WebAlt")=request("WebAlt")
rs("WebLogo")=request("WebLogo")
rs("ChannelName")=request("ChannelName")
rs("webemail")=request("webemail")
rs("emailkg")=request("emailkg")
rs("servesmtp")=request("servesmtp")
rs("servemail")=request("servemail")
rs("servekey")=request("servekey")
rs("mailuserdomain")=request("mailuserdomain")
if trim(request("MaxLine"))="" then
rs("MaxLine")=0
else
rs("MaxLine")=trim(request("MaxLine"))
end if
if trim(request("LineNum"))="" then
rs("LineNum")=0
else
rs("LineNum")=trim(request("LineNum"))
end if
if trim(request("LineLogo"))="" then
rs("LineLogo")=0
else
rs("LineLogo")=trim(request("LineLogo"))
end if
if trim(request("inpc"))="" then
rs("inpc")=0
else
rs("inpc")=request("inpc")
end if
if trim(request("MaxPageSize"))="" then
rs("MaxPageSize")=0
else
rs("MaxPageSize")=trim(request("MaxPageSize"))
end if
if trim(request("CacheTime"))="" then
rs("CacheTime")=0
else
rs("CacheTime")=trim(request("CacheTime"))
end if
if trim(request("HitsTime"))="" then
rs("HitsTime")=0
else
rs("HitsTime")=trim(request("HitsTime"))
end if

rs("Isanti")=request("Isanti")
rs("IPanti")=request("IPanti")
rs("IsVerify")=request("IsVerify")
rs("IsDomainLimit")=request("IsDomainLimit")
rs("FilterWord")=request("FilterWord")
rs("FilterDomain")=request("FilterDomain")
rs("skin")=request("skin")
rs("IsDeBug")=request("IsDeBug")
rs("IsSqlDataBase")=request("IsSqlDataBase")
rs("hxCacheName")=request("hxCacheName")



    rs.update
    response.write "<script language=JavaScript>" & chr(13) & "alert('修改成功！');" &"window.location='admin_config.asp?id=1'" & "</script>"
    response.end
    
    rs.close
	conn.close
	set rs=nothing
	set conn=nothing
 end if
    end sub
'邮箱验证
Function CheckEmail(str)
		Dim re,a
		Set re = New RegExp
		re.IgnoreCase = True
		re.Global = True
		re.Pattern = "\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"
		a = re.Test(str)
		If a then 
			CheckEmail = True
		Else
			CheckEmail = False	
  End If	
end function
'网址验证
Function CheckUrl(str)
  Dim re,a
  Set re = New RegExp
  re.Pattern = "^https?:\/\/[\u4E00-\u9FA5a-zA-Z\.\/0-9]{3,}[\u4E00-\u9FA5a-zA-Z\/0-9]{2,}$" 
  re.IgnoreCase = False 
  a = re.Test(str)
  If a Then
    CheckUrl = true
  Else
    CheckUrl = false
  End If
End Function
%>