<!--#include file="../Inc/Consts.inc" -->
<!--#include file="../Inc/common.Asp" -->
<!--#include file="../Inc/strfunc.Asp" -->
<!--#include file="CheckAdmin.Asp"-->
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" href="Images/Admin_style.css">
<%
' Ss简单网站管理系统-开源版 
'晴天设计www.xxzwz.com
If InStr(SsMasterPurview, "|1,") = 0 Then
    response.Write ("<br /><br /><div align=""center""><font style=""color:red; font-size:9pt; "")>您没有管理该模块的权限！</font></div>")
    response.End
End If
if request.QueryString("Action")="SaveConst" then SaveConstInfo
%>

<table class="tableBorder" width="95%" border="0" align="center" cellpadding="5" cellspacing="1">
  <form name="ConstForm" method="post" action="?Action=SaveConst">
    <tr>
      <th height="22" colspan="2" sytle="line-height:150%">【附加参数设置】</th>
    </tr>
    <tr>
      <td width="20%" align="right" class="forumRow">系统安装目录：</td>
      <td width="80%" class="forumRowHighlight"><input name="SysRootDir" type="text" id="SysRootDir" style="width: 280" value="<%=SysRootDir%>">
        <font color="red">*</font></td>
    </tr>
    <tr>
      <td align="right" class="forumRow">数据库目录：</td>
      <td class="forumRowHighlight"><input name="SiteDataPath" type="text" id="SiteDataPath" style="width: 280" value="<%=SiteDataPath%>">
        <font color="red">*</font></td>
    </tr>
    <tr>
      <td align="right" class="forumRow">是否启用防注入系统：</td>
      <td class="forumRowHighlight"><input name="EnableStopInjection" type="radio" value="True" <%if EnableStopInjection = True then%> checked<%end if%>>
        启用
        <input name="EnableStopInjection" type="radio" value="False" <%if EnableStopInjection = False then%> checked<%end if%>>
        不启用 <font color="red">*</font></td>
    </tr>
    <tr>
      <td align="right" class="forumRow">是否启用管理员认证码：</td>
      <td class="forumRowHighlight"><input name="EnableSiteManageCode" type="radio" value="True" <%if EnableSiteManageCode = True then%> checked<%end if%>>
        启用
        <input name="EnableSiteManageCode" type="radio" value="False" <%if EnableSiteManageCode = False then%> checked<%end if%>>
        不启用 <font color="red">*</font></td>
    </tr>
    <tr>
      <td align="right" class="forumRow">管理员认证码：</td>
      <td class="forumRowHighlight"><input name="SiteManageCode" type="text" id="SiteManageCode" style="width: 80" value="<%=SiteManageCode%>" maxlength="6">
        <font color="red">*</font></td>
    </tr>
    <tr>
      <td align="right" class="forumRow">页面防刷新时间：</td>
      <td class="forumRowHighlight"><input name="Refresh" type="text" id="Refresh" style="width: 80" value="<%=Refresh%>">
        秒 <font color="red">*</font></td>
    </tr>
    <tr>
      <td align="right" class="forumRow">新闻模块单页调用条数：</td>
      <td class="forumRowHighlight"><input name="NewInfo" type="text" id="NewInfo" style="width: 80" value="<%=NewInfo%>">
        <font color="red">*</font></td>
    </tr>
    <tr>
      <td align="right" class="forumRow">作品模块单页调用条数：</td>
      <td class="forumRowHighlight"><input name="ProInfo" type="text" id="ProInfo" style="width: 80" value="<%=ProInfo%>">
        <font color="red">*</font></td>
    </tr>
    <tr>
      <td align="right" class="forumRow">人才模块单页调用条数：</td>
      <td class="forumRowHighlight"><input name="JobInfo" type="text" id="JobInfo" style="width: 80" value="<%=JobInfo%>">
        <font color="red">*</font></td>
    </tr>
    <tr>
      <td align="right" class="forumRow">下载模块单页调用条数：</td>
      <td class="forumRowHighlight"><input name="DownInfo" type="text" id="DownInfo" style="width: 80" value="<%=DownInfo%>">
        <font color="red">*</font></td>
    </tr>
    <tr>
      <td align="right" class="forumRow">其他信息单页调用条数：</td>
      <td class="forumRowHighlight"><input name="OtherInfo" type="text" id="OtherInfo" style="width: 80" value="<%=OtherInfo%>">
        <font color="red">*</font></td>
    </tr>
    <tr>
      <td align="right" class="forumRow">留言模块单页调用条数：</td>
      <td class="forumRowHighlight"><input name="MessageInfo" type="text" id="MessageInfo" style="width: 80" value="<%=MessageInfo%>">
        <font color="red">*</font></td>
    </tr>
     <tr>
      <td align="right" class="forumRow">访客留言设置：</td>
      <td class="forumRowHighlight"><input name="MesViewFlag" type="checkbox" id="MesViewFlag" value="1" <%if MesViewFlag then response.write ("checked")%>>
        无须审核</td>
    </tr>
    <tr>
      <td align="right" class="forumRow">是否生成静态页面：</td>
      <td class="forumRowHighlight"><input name="ISHTML" type="radio" value="1" <%if ISHTML = 1 then%> checked<%end if%>>
        生成静态HTML
        <input name="ISHTML" type="radio" value="0" <%if ISHTML = 0 then%> checked<%end if%>>
        不生成 <font color="red">*</font></td>
    </tr>
    <tr>
      <td align="right" class="forumRow">生成静态页面后缀：</td>
      <td class="forumRowHighlight"><select style="width: 80" name="HTMLName">
          <option value="html" <%if HTMLName="html" then response.write "selected"%>>html</option>
          <option value="htm" <%if HTMLName="htm" then response.write "selected"%>>htm</option>
          <option value="shtml" <%if HTMLName="shtml" then response.write "selected"%>>shtml</option>
          <option value="asp" <%if HTMLName="asp" then response.write "selected"%>>asp</option>
        </select>
        <font color="red">*</font> 如：New.html中“html”即为后缀。可设置如：html、htm、shtml、asp</td>
    </tr>
    <tr>
      <td align="right" class="forumRow">新闻分类生成前缀：</td>
      <td class="forumRowHighlight"><input name="NewSortName" type="text" id="NewSortName" style="width: 180" value="<%=NewSortName%>">
        <font color="red">*</font> 如：New-1.html中“New”即为前缀</td>
    </tr>
    <tr>
      <td align="right" class="forumRow">新闻详细页生成前缀：</td>
      <td class="forumRowHighlight"><input name="NewName" type="text" id="NewName" style="width: 180" value="<%=NewName%>">
        <font color="red">*</font></td>
    </tr>
    <tr>
      <td align="right" class="forumRow">作品分类生成前缀：</td>
      <td class="forumRowHighlight"><input name="ProSortName" type="text" id="ProSortName" style="width: 180" value="<%=ProSortName%>">
        <font color="red">*</font></td>
    </tr>
    <tr>
      <td align="right" class="forumRow">作品详细页生成前缀：</td>
      <td class="forumRowHighlight"><input name="ProName" type="text" id="ProName" style="width: 180" value="<%=ProName%>">
        <font color="red">*</font></td>
    </tr>
    <tr>
      <td align="right" class="forumRow">下载分类生成前缀：</td>
      <td class="forumRowHighlight"><input name="DownSortName" type="text" id="DownSortName" style="width: 180" value="<%=DownSortName%>">
        <font color="red">*</font></td>
    </tr>
    <tr>
      <td align="right" class="forumRow">下载详细页生成前缀：</td>
      <td class="forumRowHighlight"><input name="DownNameDiy" type="text" id="DownNameDiy" style="width: 180" value="<%=DownNameDiy%>">
        <font color="red">*</font></td>
    </tr>
    <tr>
      <td align="right" class="forumRow">其他信息分类生成前缀：</td>
      <td class="forumRowHighlight"><input name="OtherSortName" type="text" id="OtherSortName" style="width: 180" value="<%=OtherSortName%>">
        <font color="red">*</font></td>
    </tr>
    <tr>
      <td align="right" class="forumRow">其他信息详细页生成前缀：</td>
      <td class="forumRowHighlight"><input name="OtherName" type="text" id="OtherName" style="width: 180" value="<%=OtherName%>">
        <font color="red">*</font></td>
    </tr>
    <tr>
      <td align="right" class="forumRow">人才分类生成前缀：</td>
      <td class="forumRowHighlight"><input name="JobSortName" type="text" id="JobSortName" style="width: 180" value="<%=JobSortName%>">
        <font color="red">*</font></td>
    </tr>
    <tr>
      <td align="right" class="forumRow">人才详细页生成前缀：</td>
      <td class="forumRowHighlight"><input name="JobNameDiy" type="text" id="JobNameDiy" style="width: 180" value="<%=JobNameDiy%>">
        <font color="red">*</font></td>
    </tr>
    <tr>
      <td align="right" class="forumRow">单页信息生成前缀：</td>
      <td class="forumRowHighlight"><input name="AboutNameDiy" type="text" id="AboutNameDiy" style="width: 180" value="<%=AboutNameDiy%>">
        <font color="red">*</font></td>
    </tr>
    <tr>
      <td align="right" class="forumRow">分隔符：</td>
      <td class="forumRowHighlight"><input name="Separated" type="text" id="Separated" style="width: 80" value="<%=Separated%>">
        <font color="red">*</font> 如：New-1.html中的“-”即为分隔符</td>
    </tr>
    <tr>
      <th height="22" colspan="2" sytle="line-height:150%">【浮动客户即时咨询参数】</th>
    </tr>
    <tr>
      <td align="right" class="forumRow">是否启用浮动客户咨询：</td>
      <td class="forumRowHighlight"><input name="JMailDisplay" type="radio" value="1" <%if JMailDisplay = 1 then%> checked<%end if%>>
        启用
        <input name="JMailDisplay" type="radio" value="0" <%if JMailDisplay = 0 then%> checked<%end if%>>
        不启用 <font color="red">*</font> 启用后客户咨询问题会自动记录到后台</td>
    </tr>
    <tr>
      <td align="right" class="forumRow">是否启用同步信箱通知：</td>
      <td class="forumRowHighlight"><input name="JMailPubDisplay" type="radio" value="1" <%if JMailPubDisplay = 1 then%> checked<%end if%>>
        启用
        <input name="JMailPubDisplay" type="radio" value="0" <%if JMailPubDisplay = 0 then%> checked<%end if%>>
        不启用 <font color="red">*</font>（须要<font color="red">Jmail组件</font>支持） 开启此功能后，客户的咨询问题在记录到后台的同时，会同步发送到管理员设置好的信箱。</td>
    </tr>
    <tr>
      <td align="right" class="forumRow">SMTP服务器：</td>
      <td class="forumRowHighlight"><input name="JMailSMTP" type="text" id="JMailSMTP" style="width: 180" value="<%=JMailSMTP%>">
        <font color="red">*</font></td>
    </tr>
    <tr>
      <td align="right" class="forumRow">SMTP服务器用户名：</td>
      <td class="forumRowHighlight"><input name="JMailUser" type="text" id="JMailUser" style="width: 180" value="<%=JMailUser%>">
        <font color="red">*</font></td>
    </tr>
    <tr>
      <td align="right" class="forumRow">SMTP服务器密码：</td>
      <td class="forumRowHighlight"><input name="JMailPass" type="text" id="JMailPass" style="width: 180" value="<%=JMailPass%>">
        <font color="red">*</font></td>
    </tr>
    <tr>
      <td align="right" class="forumRow">发送人：</td>
      <td class="forumRowHighlight"><input name="JMailName" type="text" id="JMailName" style="width: 180" value="<%=JMailName%>">
        <font color="red">*</font></td>
    </tr>
    <tr>
      <td align="right" class="forumRow">接收信箱：</td>
      <td class="forumRowHighlight"><input name="JMailInFrom" type="text" id="JMailInFrom" style="width: 180" value="<%=JMailInFrom%>">
        <font color="red">*</font></td>
    </tr>
    <tr>
      <td align="right" class="forumRow">发送信箱：</td>
      <td class="forumRowHighlight"><input name="JMailOutFrom" type="text" id="JMailOutFrom" style="width: 180" value="<%=JMailOutFrom%>">
        <font color="red">*</font></td>
    </tr>
    <tr>
      <td align="right" class="forumRow">反馈标题头：</td>
      <td class="forumRowHighlight"><input name="JMailTitle" type="text" id="JMailTitle" style="width: 200" value="<%=JMailTitle%>">
        <font color="red">*</font></td>
    </tr>
    <tr>
      <td align="right" class="forumRow"></td>
      <td class="forumRowHighlight"><input name="submitSaveEdit" type="submit" id="submitSaveEdit" accesskey="s" value="保存附加参数设置"></td>
    </tr>
  </form>
</table>
<%
Function SaveConstInfo()
	Dim ybo
    Set ybo = server.CreateObject("Adod" & "b.St" & "ream")
    ybo.Type = 2
    ybo.mode = 3
    ybo.charset = "utf-8"
    ybo.Open
    ybo.WriteText "<!--#include file=""Charset.Asp"" -->" & vbCrLf
	ybo.WriteText "<!--#include file=""templateurl.Asp"" -->" & vbCrLf
    ybo.WriteText "<" & "%" & vbCrLf
    ybo.WriteText "Const SysRootDir = " & Chr(34) & ReplaceConstChar(Trim(request("SysRootDir"))) & Chr(34) & "" & vbCrLf
	'ybo.WriteText "Const templatepath = " & Chr(34) & ReplaceConstChar(Trim(request("templatepath"))) & Chr(34) & "" & vbCrLf
    ybo.WriteText "Const SiteDataPath = " & Chr(34) & ReplaceConstChar(Trim(request("SiteDataPath"))) & Chr(34) & "" & vbCrLf
    ybo.WriteText "Const EnableStopInjection = " & ReplaceConstChar(Trim(request("EnableStopInjection"))) & "" & vbCrLf
    ybo.WriteText "Const EnableSiteManageCode = " & ReplaceConstChar(Trim(request("EnableSiteManageCode"))) & "" & vbCrLf
    ybo.WriteText "Const SiteManageCode = " & Chr(34) & ReplaceConstChar(Trim(request("SiteManageCode"))) & Chr(34) & "" & vbCrLf
    ybo.WriteText "Const Refresh = " & ReplaceConstChar(Trim(request("Refresh"))) & "" & vbCrLf
    ybo.WriteText "Const NewInfo = " & ReplaceConstChar(Trim(request("NewInfo"))) & "" & vbCrLf
    ybo.WriteText "Const ProInfo = " & ReplaceConstChar(Trim(request("ProInfo"))) & "" & vbCrLf
    ybo.WriteText "Const JobInfo = " & ReplaceConstChar(Trim(request("JobInfo"))) & "" & vbCrLf
    ybo.WriteText "Const DownInfo = " & ReplaceConstChar(Trim(request("DownInfo"))) & "" & vbCrLf
    ybo.WriteText "Const OtherInfo = " & ReplaceConstChar(Trim(request("OtherInfo"))) & "" & vbCrLf
    ybo.WriteText "Const MessageInfo = " & ReplaceConstChar(Trim(request("MessageInfo"))) & "" & vbCrLf
    ybo.WriteText "Const ISHTML = " & ReplaceConstChar(Trim(request("ISHTML"))) & "" & vbCrLf
	if request("ISHTML")=0 then
    ybo.WriteText "Const HTMLName = " & Chr(34) & "asp"& Chr(34) & "" & vbCrLf
	else
	ybo.WriteText "Const HTMLName = " & Chr(34) & ReplaceConstChar(Trim(request("HTMLName"))) & Chr(34) & "" & vbCrLf
	end if
    ybo.WriteText "Const NewSortName = " & Chr(34) & ReplaceConstChar(Trim(request("NewSortName"))) & Chr(34) & "" & vbCrLf
    ybo.WriteText "Const NewName = " & Chr(34) & ReplaceConstChar(Trim(request("NewName"))) & Chr(34) & "" & vbCrLf
    ybo.WriteText "Const ProSortName = " & Chr(34) & ReplaceConstChar(Trim(request("ProSortName"))) & Chr(34) & "" & vbCrLf
    ybo.WriteText "Const ProName = " & Chr(34) & ReplaceConstChar(Trim(request("ProName"))) & Chr(34) & "" & vbCrLf
    ybo.WriteText "Const DownSortName = " & Chr(34) & ReplaceConstChar(Trim(request("DownSortName"))) & Chr(34) & "" & vbCrLf
    ybo.WriteText "Const DownNameDiy = " & Chr(34) & ReplaceConstChar(Trim(request("DownNameDiy"))) & Chr(34) & "" & vbCrLf
    ybo.WriteText "Const OtherSortName = " & Chr(34) & ReplaceConstChar(Trim(request("OtherSortName"))) & Chr(34) & "" & vbCrLf
    ybo.WriteText "Const OtherName = " & Chr(34) & ReplaceConstChar(Trim(request("OtherName"))) & Chr(34) & "" & vbCrLf
    ybo.WriteText "Const JobSortName = " & Chr(34) & ReplaceConstChar(Trim(request("JobSortName"))) & Chr(34) & "" & vbCrLf
    ybo.WriteText "Const JobNameDiy = " & Chr(34) & ReplaceConstChar(Trim(request("JobNameDiy"))) & Chr(34) & "" & vbCrLf
    ybo.WriteText "Const AboutNameDiy = " & Chr(34) & ReplaceConstChar(Trim(request("AboutNameDiy"))) & Chr(34) & "" & vbCrLf
    ybo.WriteText "Const Separated = " & Chr(34) & ReplaceConstChar(Trim(request("Separated"))) & Chr(34) & "" & vbCrLf
    ybo.WriteText "Const JMailDisplay = " & ReplaceConstChar(Trim(request("JMailDisplay"))) & "" & vbCrLf
    ybo.WriteText "Const JMailPubDisplay = " & ReplaceConstChar(Trim(request("JMailPubDisplay"))) & "" & vbCrLf
    ybo.WriteText "Const JMailSMTP = " & Chr(34) & ReplaceConstChar(Trim(request("JMailSMTP"))) & Chr(34) & "" & vbCrLf
    ybo.WriteText "Const JMailUser = " & Chr(34) & ReplaceConstChar(Trim(request("JMailUser"))) & Chr(34) & "" & vbCrLf
    ybo.WriteText "Const JMailPass = " & Chr(34) & ReplaceConstChar(Trim(request("JMailPass"))) & Chr(34) & "" & vbCrLf
    ybo.WriteText "Const JMailName = " & Chr(34) & ReplaceConstChar(Trim(request("JMailName"))) & Chr(34) & "" & vbCrLf
    ybo.WriteText "Const JMailInFrom = " & Chr(34) & ReplaceConstChar(Trim(request("JMailInFrom"))) & Chr(34) & "" & vbCrLf
    ybo.WriteText "Const JMailOutFrom = " & Chr(34) & ReplaceConstChar(Trim(request("JMailOutFrom"))) & Chr(34) & "" & vbCrLf
    ybo.WriteText "Const JMailTitle = " & Chr(34) & ReplaceConstChar(Trim(request("JMailTitle"))) & Chr(34) & "" & vbCrLf
    ybo.WriteText "%" & ">"
    ybo.SaveToFile Server.mappath("../Inc/Consts.inc"), 2
    ybo.flush
    ybo.Close
    Set ybo = Nothing
    If ReplaceConstChar(Trim(request("ISHTML"))) = 0 Then Call FsoDelHtml(ReplaceConstChar(Trim(request("HTMLName"))))
    response.Write "<script language=""javascript"">alert('系统附加参数提交成功！');location.href='Ss_systemset.asp';</script>"
End Function
Sub FsoDelHtml(HTMLName)
    Dim Fso, FsoOut, File
    Set Fso = Server.CreateObject("Scripting.FileSystemObject")
    Set FsoOut = Fso.GetFolder(Server.Mappath(SysRootDir))
    For Each File In FsoOut.Files
        If Right(File.Name, Len(File.Name) - InStrRev(File.Name, ".")) = HTMLName And HTMLName <> "asp" Then
            Response.Write "<span style=""color:red; padding-left: 18px"">" & File.Name & "</span> 成功删除…<br />"
            Fso.DeleteFile File.Path, True
        End If
    Next
    Set FsoOut = Nothing
    Set Fso = Nothing
End Sub
%>