<%@language=VBScript codepage=936 %>
<!--#include file="you.asp"-->
<!--#include file="conn.asp"-->
<!--#include file="zcm.asp"-->
<!--#include file="admin.asp"-->
<!-- #include file="Inc/Head.asp" -->
<!--#include file="../inc/config.asp"-->
<!--#include file="inc/function.asp"-->
<%
dim ObjInstalled,Action,FoundErr,ErrMsg
ObjInstalled=IsObjInstalled("Scripting.FileSystemObject")
Action=trim(request("Action"))
if Action="" then
	Action="ShowInfo"
end if
%>
<html>
<head>
<title>网站配置</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<body leftmargin="2" topmargin="0" marginwidth="0" marginheight="0"> 
<%
if Action="SaveConfig" then
	call SaveConfig()
	Response.Redirect "SiteConfig.asp" 
else
	call ShowConfig()
end if
if FoundErr=True then
	call WriteErrMsg()
end if
call CloseConn()

sub ShowConfig()
%>
<form method="POST" action="SiteConfig.asp" id="form" name="form">
  <table width="650" border="0" align="center" cellpadding="2" cellspacing="1" bgcolor="#000000" >
    <tr> 
      <td height="24" colspan="4" class="back_southidc"> <div align="center"><strong>网 
          站 配 置</strong></div></td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td colspan="4" class="topbg"> <strong>网站信息配置</strong></td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td width="224" class="tdbg"><strong>网站标题：</strong></td>
      <td colspan="3" class="tdbg"> <input name="SiteTitle" type="text" id="SiteTitle" value="<%=SiteTitle%>" size="40" maxlength="50">      </td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td width="224" class="tdbg"><strong>网站名称：</strong></td>
      <td colspan="3" class="tdbg"> <input name="SiteName" type="text" id="SiteName" value="<%=SiteName%>" size="40" maxlength="50">      </td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td width="224" class="tdbg"><strong>网站域名：</strong></td>
      <td colspan="3" class="tdbg"> <input name="SiteUrl" type="text" id="SiteUrl" value="<%=SiteUrl%>" size="40" maxlength="255">      </td>
    </tr>
    <tr bgcolor="#FFFFFF">
      <td class="tdbg" style="font-weight: bold">网站关键字：keywords</td>
      <td colspan="3" class="tdbg"><input name="Sitekey" type="text" id="Sitekey" value="<%=Sitekey%>" size="40" maxlength="255"></td>
    </tr>
    <tr bgcolor="#FFFFFF">
      <td class="tdbg"><span class="tdbg" style="font-weight: bold">网站描述：description</span></td>
      <td colspan="3" class="tdbg"><input name="Sitedes" type="text" id="Sitedes" value="<%=Sitedes%>" size="40" maxlength="255"></td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td class="tdbg"><strong>图片ALT标签：</strong></td>
      <td colspan="3" class="tdbg"> <input name="EnterpriseMail" type="text" id="EnterpriseMail" value="<%=EnterpriseMail%>" size="40" maxlength="255"></td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td width="224" class="tdbg"><span style="color: #FF0000"><strong>QQ在线客服：</strong></span><br> </td>
      <td colspan="3" class="tdbg"> <input name="LogoUrl" type="text" id="LogoUrl" value="<%=LogoUrl%>" size="40" maxlength="255">      </td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td width="224" height="20" class="tdbg"><strong>首页Banner地址：</strong><br>
        图片格式为：jpg,gif,bmp,png,swf <br> </td>
      <td width="186" class="tdbg"> <input name="BannerUrl" type="text" id="BannerUrl" value="<%=BannerUrl%>" size="25" maxlength="255">      </td>
      <td width="42" class="tdbg">高度：</td>
      <td width="127" class="tdbg"> <input name="High" type="text" id="High" value="<%=High%>" size="6" maxlength="5"></td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td class="tdbg"><strong>首页Banner地址：</strong><br>
        图片格式为：jpg,gif,bmp,png,swf <strong>(英文版)：</strong></td>
      <td colspan="3" class="tdbg"><input name="EnBannerUrl" type="text" id="EnBannerUrl" value="<%=EnBannerUrl%>" size="25" maxlength="255"></td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td height="23" class="tdbg"><strong>是否为FLASH：</strong></td>
      <td colspan="3" class="tdbg"> <input name="IsFlash" type="radio" value="Yes" <%if IsFlash="Yes" then response.write "checked"%>>
        是&nbsp;&nbsp;&nbsp;&nbsp; <input name="IsFlash" type="radio" value="No" <%if IsFlash="No" then response.write "checked"%>>
        否</td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td width="224" class="tdbg"><strong>站长姓名：</strong></td>
      <td colspan="3" class="tdbg"> <input name="WebmasterName" type="text" id="WebmasterName" value="<%=WebmasterName%>" size="40" maxlength="20">      </td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td class="tdbg"><p><strong>版权信息：</strong><br>
          <span style="color: #FF0000">支持HTML标记，不能使用双引号</span></p>
        <p style="color: #FF0000">不支持Enter换行，如前台需要显示换行，请在需要换行的文字前加 <span style="color: #000000">&lt;br&gt;</span></p></td>
      <td colspan="3" class="tdbg"><textarea name="Copyright" cols="50" rows="8" id="Copyright"><%=Copyright%></textarea></td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td width="224" class="tdbg"><strong>邮箱：</strong></td>
      <td colspan="3" class="tdbg"> <input name="WebmasterEmail" type="text" id="WebmasterEmail" value="<%=WebmasterEmail%>" size="40" maxlength="100">      </td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td class="tdbg"><strong>电话：</strong></td>
      <td colspan="3" class="tdbg"><input name="EnSiteTitle" type="text" id="EnSiteTitle" value="<%=EnSiteTitle%>" size="40" maxlength="50"></td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td class="tdbg"><strong>手机：</strong></td>
      <td colspan="3" class="tdbg"><input name="EnSiteName" type="text" id="EnSiteName" value="<%=EnSiteName%>" size="40" maxlength="50"></td>
    </tr>  
    <tr bgcolor="#FFFFFF"> 
      <td width="224" class="tdbg"><strong>地址：</strong></td>
      <td colspan="3" class="tdbg"><textarea name="EnCopyright" cols="50" rows="4" id="EnCopyright"><%=EnCopyright%></textarea>      </td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td colspan="4" class="topbg"><strong>网站选项配置</strong></td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td class="tdbg"><strong>首页每页产品或文章数：</strong></td>
      <td colspan="3" class="tdbg"> <input name="MaxPerPage_Default" type="text" id="MaxPerPage_Default" value="<%=MaxPerPage_Default%>" size="6" maxlength="5"></td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td class="tdbg"><strong>首页新闻资讯条数：</strong></td>
      <td colspan="3" class="tdbg"> <input name="New_count" type="text" id="New_count" value="<%=New_count%>" size="6" maxlength="5"></td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td class="tdbg"><strong>首页产品列表数：</strong></td>
      <td colspan="3" class="tdbg"> <input name="Product_count" type="text" id="Product_count" value="<%=Product_count%>" size="6" maxlength="5"></td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td class="tdbg"><strong>产品搜索页每页文章数：</strong></td>
      <td colspan="3" class="tdbg"> <input name="MaxPerPage_Search" type="text" id="MaxPerPage_Search" value="<%=MaxPerPage_Search%>" size="6" maxlength="5"></td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td class="tdbg"><strong>每页显示大约字符数：</strong></td>
      <td colspan="3" class="tdbg"> <input name="MaxPerPage_Content" type="text" id="MaxPerPage_Content" value="<%=MaxPerPage_Content%>" size="6" maxlength="5"></td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td class="tdbg"><strong>是否启用新闻评论功能：</strong></td>
      <td colspan="3" class="tdbg"> <input type="radio" name="NewsComment" value="Yes" <%if NewsComment="Yes" then response.write "checked"%>>
        是 &nbsp;&nbsp;&nbsp;&nbsp; <input type="radio" name="NewsComment" value="No" <%if NewsComment="No" then response.write "checked"%>>
        否</td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td class="tdbg"><strong>是否启用产品审核功能：</strong></td>
      <td colspan="3" class="tdbg"> <input type="radio" name="EnableProductCheck" value="Yes" <%if EnableProductCheck="Yes" then response.write "checked"%>>
        是 &nbsp;&nbsp;&nbsp;&nbsp; <input type="radio" name="EnableProductCheck" value="No" <%if EnableProductCheck="No" then response.write "checked"%>>
        否</td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td class="tdbg"><strong>是否开放文件上传：</strong></td>
      <td colspan="3" class="tdbg"> <input type="radio" name="EnableUploadFile" value="Yes" <%if EnableUploadFile="Yes" then response.write "checked"%>>
        是 &nbsp;&nbsp;&nbsp;&nbsp; <input type="radio" name="EnableUploadFile" value="No" <%if EnableUploadFile="No" then response.write "checked"%>>
        否</td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td class="tdbg"><strong>是否显示公告：</strong></td>
      <td colspan="3" class="tdbg"> <input type="radio" name="PopAnnounce" value="Yes" <%if PopAnnounce="Yes" then response.write "checked"%>>
        是 &nbsp;&nbsp;&nbsp;&nbsp; <input type="radio" name="PopAnnounce" value="No" <%if PopAnnounce="No" then response.write "checked"%>>
        否</td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td class="tdbg"><strong>热门新闻点击数：</strong></td>
      <td colspan="3" class="tdbg"> <input name="HitsOfHot" type="text" id="HitsOfHot" value="<%=HitsOfHot%>" size="6" maxlength="5"></td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td class="tdbg"><strong>上传文件大小限制：</strong><br>
        建议不要超过1024K，以免影响服务器性能<strong>：</strong></td>
      <td colspan="3" class="tdbg"> <input name="MaxFileSize" type="text" id="MaxFileSize" value="<%=MaxFileSize%>" size="6" maxlength="5">
        K</td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td class="tdbg"><strong>存放上传文件的目录：</strong><br>
        请输入相对于首页（Default.asp）的相对路径</td>
      <td colspan="3" class="tdbg"> <input name="SaveUpFilesPath" type="text" id="SaveUpFilesPath" value="<%=SaveUpFilesPath%>" size="30" maxlength="100"></td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td class="tdbg"><strong>允许的上传文件类型：</strong><br>
        只输入扩展名。每种文件类型用“|”号分开。</td>
      <td colspan="3" class="tdbg"> <input name="UpFileType" type="text" id="UpFileType2" value="<%=UpFileType%>" size="50" maxlength="255"></td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td class="tdbg"><strong>删除文章时是否同时删除文章中的上传文件：</strong><br>
        此功能需要FSO支持。</td>
      <td colspan="3" class="tdbg"> <input type="radio" name="DelUpFiles" value="Yes" <%if DelUpFiles="Yes" then response.write "checked"%>>
        是 &nbsp;&nbsp;&nbsp;&nbsp; <input type="radio" name="DelUpFiles" value="No" <%if DelUpFiles="No" then response.write "checked"%>>
        否</td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td class="tdbg"><strong>Session会话的保持时间：</strong><br>
        主要用于后台管理员登录，为了安全，请不要将时间设得太长。建议设为10分钟</td>
      <td colspan="3" class="tdbg"> <input name="SessionTimeout" type="text" id="SessionTimeout" value="<%=SessionTimeout%>" size="6" maxlength="5">
        分钟</td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td class="tdbg">&nbsp;</td>
      <td colspan="3" class="tdbg">&nbsp;</td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td colspan="4" class="topbg"><strong>邮件服务器选项</strong></td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td width="224" class="tdbg"><strong>邮件发送组件：</strong><br>
        请一定要选择服务器上已安装的组件</td>
      <td colspan="3" class="tdbg"> <select name="MailObject" id="MailObject">
          <option value="Jmail" selected>Jmail</option>
        </select> </td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td width="224" class="tdbg"><strong>SMTP服务器地址：</strong><br>
        用来发送邮件的SMTP服务器<br>
        如果你不清楚此参数含义，请联系你的空间商 </td>
      <td colspan="3" class="tdbg"> <input name="MailServer" type="text" id="MailServer" value="<%=MailServer%>" size="40">      </td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td width="224" class="tdbg"><strong>SMTP登录用户名：</strong><br>
        当你的服务器需要SMTP身份验证时还需设置此参数</td>
      <td colspan="3" class="tdbg"> <input name="MailServerUserName" type="text" id="MailServerUserName" value="<%=MailServerUserName%>" size="40">      </td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td width="224" class="tdbg"><strong>SMTP登录密码：</strong><br>
        当你的服务器需要SMTP身份验证时还需设置此参数 </td>
      <td colspan="3" class="tdbg"> <input name="MailServerPassWord" type="password" id="MailServerPassWord" value="<%=MailServerPassWord%>" size="40">      </td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td width="224" class="tdbg"><strong>SMTP域名</strong>：<br>
        如果用“name@domain.com”这样的用户名登录时，请指明domain.com</td>
      <td colspan="3" class="tdbg"> <input name="MailDomain" type="text" id="MailDomain" value="<%=MailDomain%>" size="40">      </td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td colspan="4" align="center" class="tdbg"> <input name="Action" type="hidden" id="Action" value="SaveConfig"> 
        <input name="cmdSave" type="submit" id="cmdSave" value=" 保存设置 " <% If ObjInstalled=false Then response.write "disabled" %>>      </td>
    </tr>
    <%
If ObjInstalled=false Then
	Response.Write "<tr class='tdbg'><td height='40' colspan='3'><b><font color=red>你的服务器不支持 FSO(Scripting.FileSystemObject)! 不能使用本功能。<br>请直接修改“Inc/config.asp”文件中的内容。</font></b></td></tr>"
End If
%>
  </table>
<%
end sub
%>
</form>
</body>
</html>
<%
 Function InPutStr(Input)'向数据库中保存字符串时用 
     IF IsEmpty(Input) Then Input="" 
     IF IsNull(Input) Then Input="" 
     IF instr(input,chr(34))>0 Then input=replace(input,chr(34),chr(39))'将"替换成',以便在向数据库里存放 
     InPutStr=input 
End function 
sub SaveConfig()
	If ObjInstalled=false Then
		FoundErr=True
		ErrMsg=ErrMsg & "<br><li>你的服务器不支持 FSO(Scripting.FileSystemObject)! </li>"
		exit sub
	end if
	dim fso,hf
	set fso=Server.CreateObject("Scripting.FileSystemObject")
	set hf=fso.CreateTextFile(Server.mappath("../inc/config.asp"),true)
	hf.write "<" & "%" & vbcrlf
	hf.write "Const SiteName=" & chr(34) & trim(request("SiteName")) & chr(34) & "        '网站名称" & vbcrlf
	hf.write "Const EnSiteName=" & chr(34) & trim(request("EnSiteName")) & chr(34) & "        '网站名称" & vbcrlf
	hf.write "Const SiteTitle=" & chr(34) & trim(request("SiteTitle")) & chr(34) & "        '网站标题" & vbcrlf
	hf.write "Const EnSiteTitle=" & chr(34) & trim(request("EnSiteTitle")) & chr(34) & "        '网站标题" & vbcrlf
	hf.write "Const SiteUrl=" & chr(34) & trim(request("SiteUrl")) & chr(34) & "        '网站地址" & vbcrlf
	hf.write "Const EnterpriseMail=" & chr(34) & trim(request("EnterpriseMail")) & chr(34) & "        '企业邮局" & vbcrlf
	hf.write "Const LogoUrl=" & chr(34) & trim(request("LogoUrl")) & chr(34) & "        'Logo地址" & vbcrlf
	hf.write "Const BannerUrl=" & chr(34) & trim(request("BannerUrl")) & chr(34) & "        'Banner地址" & vbcrlf
	hf.write "Const EnBannerUrl=" & chr(34) & trim(request("EnBannerUrl")) & chr(34) & "        'EnBanner地址" & vbcrlf	
	hf.write "Const Sitekey=" & chr(34) & trim(request("Sitekey")) & chr(34) & "        '网站关键字" & vbcrlf
	hf.write "Const Sitedes=" & chr(34) & trim(request("Sitedes")) & chr(34) & "        '网站描述" & vbcrlf
	hf.write "Const IsFlash=" & chr(34) & trim(request("IsFlash")) & chr(34) & "        '是否为FLASH" & vbcrlf
	hf.write "Const High=" & trim(request("High")) & "        '高度" & vbcrlf
	hf.write "Const WebmasterName=" & chr(34) & trim(request("WebmasterName")) & chr(34) & "        '站长姓名" & vbcrlf
	hf.write "Const WebmasterEmail=" & chr(34) & trim(request("WebmasterEmail")) & chr(34) & "        '站长信箱" & vbcrlf
	hf.write "Const Copyright=" & chr(34) & InPutStr(trim(request("Copyright"))) & chr(34) & "        '版权信息" & vbcrlf
	hf.write "Const EnCopyright=" & chr(34) & InPutStr(trim(request("EnCopyright"))) & chr(34) & "        '版权信息" & vbcrlf	
	hf.write "Const MaxPerPage_Default=" & trim(request("MaxPerPage_Default")) & "        '首页每页产品或文章数" & vbcrlf
	hf.write "Const New_count=" & trim(request("New_count")) &  "        '首面新闻资讯条数" & vbcrlf
	hf.write "Const Product_count=" & trim(request("Product_count")) &  "        '首面产品列表数" & vbcrlf
	hf.write "Const MaxPerPage_Search=" & trim(request("MaxPerPage_Search")) & "        '文章搜索页每页文章数" & vbcrlf
	
	hf.write "Const MaxPerPage_Content=" & trim(request("MaxPerPage_Content")) &  "        '每页显示大约字符数" & vbcrlf
	hf.write "Const NewsComment=" & chr(34) & trim(request("NewsComment")) & chr(34) & "        '是否启用新闻评论功能" & vbcrlf	
	hf.write "Const EnableProductCheck=" & chr(34) & trim(request("EnableProductCheck")) & chr(34) & "        '是否启用文章审核功能" & vbcrlf
	hf.write "Const EnableUploadFile=" & chr(34) & trim(request("EnableUploadFile")) & chr(34) & "        '是否开放文件上传" & vbcrlf
	hf.write "Const PopAnnounce=" & chr(34) & trim(request("PopAnnounce")) & chr(34) & "        '是否弹出公告窗口" & vbcrlf
	hf.write "Const HitsOfHot=" & trim(request("HitsOfHot")) & "        '热门文章点击数" & vbcrlf
	
	hf.write "Const MaxFileSize=" & trim(request("MaxFileSize")) & "        '上传文件大小限制" & vbcrlf
	hf.write "Const SaveUpFilesPath=" & chr(34) & trim(request("SaveUpFilesPath")) & chr(34) & "        '存放上传文件的目录" & vbcrlf
	hf.write "Const UpFileType=" & chr(34) & trim(request("UpFileType")) & chr(34) & "        '允许的上传文件类型" & vbcrlf
	hf.write "Const DelUpFiles=" & chr(34) & trim(request("DelUpFiles")) & chr(34) & "        '删除文章时是否同时删除文章中的上传文件" & vbcrlf
	hf.write "Const SessionTimeout=" & trim(request("SessionTimeout")) & "        'Session会话的保持时间" & vbcrlf
	
	hf.write "Const MailObject=" & chr(34) & trim(request("MailObject")) & chr(34) & "        '邮件发送组件" & vbcrlf
	hf.write "Const MailServer=" & chr(34) & trim(request("MailServer")) & chr(34) & "        '用来发送邮件的SMTP服务器" & vbcrlf
	hf.write "Const MailServerUserName=" & chr(34) & trim(request("MailServerUserName")) & chr(34) & "        '登录用户名" & vbcrlf
	hf.write "Const MailServerPassWord=" & chr(34) & trim(request("MailServerPassWord")) & chr(34) & "        '登录密码" & vbcrlf
	hf.write "Const MailDomain=" & chr(34) & trim(request("MailDomain")) & chr(34) & "        '域名" & vbcrlf
	hf.write "%" & ">"
	hf.close
	set hf=nothing
	set fso=nothing	
end sub
%>