<%@language=vbscript codepage=936%>
<%
Response.Buffer = True
Response.Expires = -1
Response.ExpiresAbsolute = Now() - 1
Response.Expires = 0
Response.CacheControl = "no-cache"
dim dns
dns="../"
%>
<!--#Include file="../Common/Inc_DatConn.asp"-->
<!--#Include file="Common/Inc_Config.asp"-->
<!--#Include file="Common/Inc_Function.asp"-->
<!--#Include file="fy_admin_check.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="images/Admin_Style.Css" rel="stylesheet" type="text/css">
<script src="../common/Admin.js" type="text/javascript"></script>
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<%
if Session("intUserLevel")<2 then
FoundErr=True
ErrMsg=ErrMsg & "<br><li>错误：操作权限出错，您没有权限操作些功能！</li>"
Call Admin_ShowErr(ErrMsg)
end if
bbaction=changechr(request("bbaction"))
Select case bbaction
  	Case "saveconfig"
		call saveconfig
	Case else
Dim InstalledObjects(12)
InstalledObjects(1) = "Adodb.Stream"				'Adodb.Stream
InstalledObjects(2) = "Persits.Upload"				'Aspupload3.0
InstalledObjects(3) = "SoftArtisans.FileUp"			'SA-FileUp 4.0
InstalledObjects(4) = "DvFile.Upload"				'DvFile-Up V1.0
'-----------------------
InstalledObjects(5) = "CreatePreviewImage.cGvbox"	'CreatePreviewImage
InstalledObjects(6) = "Persits.Jpeg"				'AspJpeg
InstalledObjects(7) = "SoftArtisans.ImageGen"		'SoftArtisans ImgWriter V1.21
InstalledObjects(8) = "sjCatSoft.Thumbnail"		'sjCatSoft.Thumbnail V2.6
InstalledObjects(9) = "Scripting.FileSystemObject"		'fso
InstalledObjects(10) = "JMail.Message"				'JMail 4.3
InstalledObjects(11) = "CDONTS.NewMail"				'CDONTS
InstalledObjects(12) = "Persits.MailSender"			'ASPEMAIL

For i=1 to 12
	Response.Write "<div id=""Issubport"&i&""" style=""display:none"">"
	If IsObjInstalled(InstalledObjects(i)) Then Response.Write InstalledObjects(i)&":<font color=red><b>√</b>服务器支持!</font>" Else Response.Write InstalledObjects(i)&"<b>×</b>服务器不支持!" 
	Response.Write "</div>"
Next
%>
<SCRIPT LANGUAGE="JavaScript">
<!--
function chkselect(s,divid)
{
var divname='Issubport';
var chkreport;
	s=Number(s)
	if (divid=="know1")
	{
	s+=9;
	if (s==9){s=999;}
	divname=divname+s;
	}
	if (divid=="know2")
	{
	s+=1;
	if (s==1000){s=999;}
	divname=divname+s;
	}
	if (divid=="know3")
	{
	s+=5;
	if (s==1004){s=999;}
	divname=divname+s;
	}
document.getElementById(divid).innerHTML=divname;
chkreport=document.getElementById(divname).innerHTML;
document.getElementById(divid).innerHTML=chkreport;
}
function Getcolor(img_val,input_val){
	var arr = showModalDialog("../Editor/Dialog/selcolor.htm?action=title", "", "dialogWidth:18.5em; dialogHeight:17.5em; status:0; help:0");
	if (arr != null){
		document.getElementById(input_val).value = arr;
		img_val.style.backgroundColor = arr;
		}
}
//-->
</SCRIPT><div id="Issubport0" style="display:none"></div>
<div id="Issubport999" style="display:none"></div>
<table width="100%" border="0" align="center" cellpadding="2" cellspacing="1" class="border">
  <tr class="title"> 
    <td height="22" colspan="2" align="center"><strong>网站参数设置</strong></td>
  </tr><form method="post" action="?bbaction=saveconfig" name="AddForm">
			  <tr class="tdbg">
			    <td width="25%" height="21" align="right">网站名称：</td>
			    <td width="75%" height="21">&nbsp;<input type="text" name="strSiteName" size="25" class="face" value="<%=strSiteName%>"></td>
			  </tr>
			  <tr class="tdbg">
			    <td height="21" align="right">网站网址：    
				<td height="21">&nbsp;<input type="text" name="strSiteUrl" size="25" class="face" value="<%=strSiteUrl%>">以&quot;/&quot;结尾</td>
			  </tr>
			  <tr class="tdbg">
			    <td height="21" align="right">网站安装路径：</td>
			    <td height="21">&nbsp;<input type="text" name="gqwebdir" size="25" class="face" value="<%=gqwebdir%>">以&quot;/&quot;开头和结尾,如果为根目录改为&quot;/&quot;即可</td>
			  </tr>			  
			  <tr class="tdbg">
			    <td height="21" align="right">存放数据库文件夹：</td>
			    <td height="21">&nbsp;<input type="text" name="bbdbpath" size="25" class="face" value="<%=bbdbpath%>"> </td>
			  </tr>			  
			  <tr class="tdbg">
			    <td height="21" align="right">数据库名称：</td>
			    <td height="21">&nbsp;<input type="text" name="bbdbname" size="25" class="face" value="<%=bbdbname%>"></td>
			  </tr>
			  <tr class="tdbg">
			    <td height="21" align="right">网站模式：</td>
			    <td height="21">&nbsp;<select class="face" size="1" name="ms">
				<option value="0" <%if ms=0 then Response.write("selected")%>>调试</option>
				<option value="1" <%if ms=1 then Response.write("selected")%>>正常使用</option>
				</select>正常使用状态不输出错误信息，以防暴库，建议选择。</td>
			  </tr>
			  <tr class="tdbg">
			    <td height="21" align="right">首页最新信息显示条数：</td>
			    <td height="21">&nbsp;<input type="text" name="intNewInfoCot" size="25" class="face" value="<%=intNewInfoCot%>"></td>
			  </tr>
			  <tr class="tdbg">
			    <td height="21" align="right">首页推荐图片信息条数：</td>
			    <td height="21">&nbsp;<input type="text" name="intNewtjinfo" size="25" class="face" value="<%=intNewtjinfo%>"></td>
			  </tr>
			  <tr class="tdbg">
			    <td height="21" align="right">副页推荐图片信息条数：</td>
			    <td height="21">&nbsp;<input type="text" name="intNewtjinfof" size="25" class="face" value="<%=intNewtjinfof%>"></td>
			  </tr>
			  <tr class="tdbg">
			    <td height="21" align="right">信息每页显示条数：</td>
			    <td height="21">&nbsp;<input type="text" name="intInfoCot" size="25" class="face" value="<%=intInfoCot%>"></td>
			  </tr>
			  <tr class="tdbg">
			    <td height="21" align="right">新闻每页显示条数：</td>
			    <td height="21">&nbsp;<input type="text" name="intNewsCot" size="25" class="face" value="<%=intNewsCot%>"></td>
			  </tr>
			  <tr class="tdbg">
			    <td height="21" align="right">审核信息发送邮件通知：</td>
			    <td height="21">&nbsp;<select class="face" size="1" name="mailinfosh">
				<option value="0" <%if mailinfosh=0 then Response.write("selected")%>>否</option>
				<option value="1" <%if mailinfosh=1 then Response.write("selected")%>>是</option>
				</select></td>
			  </tr>
			  <tr class="title">
			    <td height="21" align="right" colspan="2">
				<p align="center">点数设置</td>
			  </tr>
			  <tr class="tdbg">
			    <td height="21" align="right">会员登录多少次数加点：</td>
			    <td height="21">&nbsp;<input type="text" name="addpoint" size="25" class="face" value="<%=addpoint%>">必须大于1,否则可刷新主页作弊</td>
			  </tr>
			  <tr class="tdbg">
			    <td height="21" align="right">会员每次加点数：</td>
			    <td height="21">&nbsp;<input type="text" name="addpointnum" size="25" class="face" value="<%=addpointnum%>"></td>
			  </tr>
			  <tr class="tdbg">
			    <td height="21" align="right">推荐信息每天扣除的点数：</td>
			    <td height="21">&nbsp;<input type="text" name="addinfopoint" size="25" class="face" value="<%=addinfopoint%>"></td>
			  </tr>
			  <tr class="tdbg">
			    <td height="21" align="right">是否开启信息审核：</td>
			    <td height="21">&nbsp;<select size="1" name="sh">
				<option value="0" <%if sh="0" then Response.write("selected")%>>直接发布</option>
				<option value="1" <%if sh="1" then Response.write("selected")%>>管理员审核</option>
				<option value="2" <%if sh="2" then Response.write("selected")%>>邮件验证</option>
				</select></td>
			  </tr>
			  <tr class="tdbg">
			    <td height="21" align="right">审核信息增加用户点数：</td>
			    <td height="21">&nbsp;<input type="text" name="passpoint" size="5" class="face" value="<%=passpoint%>">点（
				开启审核生效，直接发布无效）</td>
			  </tr>
			  <tr class="title">
			    <td height="23" class="bottom" align="right" colspan="2">
				<p align="center">
				<a target="_blank" href="http://union.alipay.com/alipay/lessons/cooerhelper/index.htm"><font color="#FFFF00">支付宝</font></a> 
				在线支付设置</td>
			  </tr>			  <tr class="tdbg">
			    <td height="20" align="right">支付宝账户：</td>
			    <td height="20">&nbsp;<input type="text" name="fyt2" size="25" class="face" value="<%=fyt2%>"></td>
			  </tr>			  <tr class="tdbg">
			    <td height="21" align="right">md5安全校验码：</td>
			    <td height="21">&nbsp;<input type="text" name="fyt3" size="25" class="face" value="<%=fyt3%>"></td>
			  </tr>
			  <tr class="tdbg">
			    <td height="20" align="right">高级会员价格：</td>
			    <td height="20">&nbsp;<input type="text" name="fys5" size="25" class="face" value="<%=fys5%>">每年</td>
			  </tr>
			  <tr class="title">
			    <td height="21" class="bottom" align="right" colspan="2">
				<p align="center"><span lang="zh-cn">邮件发送设置</span></td>
			  </tr>
			  <tr class="title">
			    <td height="21" class="bottom" align="right" colspan="2">
				<p align="center"><span lang="zh-cn">邮件发送设置</span></td>
			  </tr>
			  <tr>
      <td width="25%" height="25" align=right bgcolor="#DEF0FA"><strong>邮件发送组件：</strong></td>
      <td height="25" bgcolor="#DEF0FA">
        &nbsp;<select name="mailser" id="mailser" onChange="chkselect(options[selectedIndex].value,'know1');">
        <option value="0" <%if mailser="0" then Response.write("selected")%>>不支持
        <option value="1" <%if mailser="1" then Response.write("selected")%>>JMAIL
        <option value="2" <%if mailser="2" then Response.write("selected")%>>CDONTS
        <option value="3" <%if mailser="3" then Response.write("selected")%>>ASPEMAIL
        </select>&nbsp;&nbsp;&nbsp;<font color=#3370CC>请一定要选择服务器上已安装的组件</font><div id=know1></div>
      </td>
    			</tr>

			  <tr class="tdbg">
			    <td height="21" align="right">Smtp服务器：</td>
			    <td height="21">&nbsp;<input type="text" name="smtphost" value="<%=mailsmtp%>" size="20" class="face"></td>
			  </tr>

			  <tr class="tdbg">
			    <td height="21" align="right">邮箱用户名：</td>
			    <td height="21">&nbsp;<input type="text" name="mail" value="<%=mailname%>" size="20" class="face"></td>
			  </tr>

			  <tr class="tdbg">
			    <td height="21" align="right">邮箱密码：</td>
			    <td height="21">&nbsp;<input name="pass" value="<%=mailpass%>" size="20" type="password" class="face"></td>
			  </tr>

			  <tr class="tdbg">
			    <td height="21" align="right">发信人邮箱：</td>
			    <td height="21">&nbsp;<input type="text" name="replyaddress" value="<%=mailform%>" size="20" class="face"></td>
			  </tr>

			  <tr class="tdbg">
			    <td height="21" align="right">更新时间：</td>
			    <td height="21">&nbsp;<input type="text" name="strUpdateTime" size="25" class="face" value="<%=strUpdateTime%>" readonly="ture"> （上次系统更新时间）</td>
			  </tr>
			  <tr class="tdbg">
			    <td height="22" align="right"></td>
			    <td height="22">&nbsp;<input type="submit" value="更 新" name="submit" class="button"  <%If IsObjInstalled(InstalledObjects(9))=false Then response.Write "disabled"%>>&nbsp;&nbsp;&nbsp;&nbsp;<input type="reset" value="取 消" name="reset" class="button"></td>
			  </tr>
			  <tr class="tdbg">
			    <td height="19" align="right" colspan="2">
				<p align="center"><%If IsObjInstalled(InstalledObjects(9))=false  then%><font color="#FF0000">提醒：您的服务器不支持FSO<%end if%></font></td>
			  </tr>
	</form>
</table>
<%
end Select
'======================================
'saveconfig参数设置
'======================================
sub saveconfig
sfso=IsObjInstalled("Scripti"&"ng.File"&"SystemO"&"bject")
gqml1=trim(Request.form("gqml"))
strSysUrl1=gqml1
strSiteName1 =trim(Request.form("strSiteName"))
strSiteUrl1 =trim(Request.form("strSiteUrl"))
intNewsCot1 =trim(Request.form("intNewsCot"))
intNewInfoCot1 =trim(Request.form("intNewInfoCot"))
intInfoCot1 =trim(Request.form("intInfoCot"))
strSysEdition1 =trim(Request.form("strSysEdition"))
sh1 =trim(Request.form("sh"))
addpoint1 =trim(Request.form("addpoint"))
strUpdateTime1 =trim(Request.form("strUpdateTime"))
ms1 =trim(Request.form("ms"))
bbdbpath1 =replace(trim(Request.form("bbdbpath")),"/","")
intNewtjinfo1=trim(Request.form("intNewtjinfo"))
intNewtjinfof1=trim(Request.form("intNewtjinfof"))
maildom1=trim(Request.form("maildom"))
fyt21=trim(Request.form("fyt2"))
dim smtphost,mail,pass,replyaddress,fs,fobj,nPath,filepath
filepath=server.mappath("../mail.asp")
if Instr(request("smtphost"),"=")>0 or Instr(request("smtphost"),"%")>0 or Instr(request("smtphost"),chr(32))>0 or Instr(request("smtphost"),"?")>0 or Instr(request("smtphost"),"&")>0 or Instr(request("smtphost"),";")>0 or Instr(request("smtphost"),",")>0 or Instr(request("smtphost"),"'")>0 or Instr(request("smtphost"),",")>0 or Instr(request("smtphost"),chr(34))>0 or Instr(request("smtphost"),chr(9))>0 or Instr(request("smtphost"),"")>0 or Instr(request("smtphost"),"$")>0 then
	response.write "<br>"+"<li>Smtp服务器地址存在非法字符。"
	response.end
end if
if Instr(request("mail"),"=")>0 or Instr(request("mail"),"%")>0 or Instr(request("mail"),chr(32))>0 or Instr(request("mail"),"?")>0 or Instr(request("mail"),"&")>0 or Instr(request("mail"),";")>0 or Instr(request("mail"),",")>0 or Instr(request("mail"),"'")>0 or Instr(request("mail"),",")>0 or Instr(request("mail"),chr(34))>0 or Instr(request("mail"),chr(9))>0 or Instr(request("mail"),"")>0 or Instr(request("mail"),"$")>0 then
	response.write "<br>"+"<li>有效邮箱地址存在非法字符。"
	response.end
end if
if Instr(request("pass"),"=")>0 or Instr(request("pass"),"%")>0 or Instr(request("pass"),chr(32))>0 or Instr(request("pass"),"?")>0 or Instr(request("pass"),"&")>0 or Instr(request("pass"),";")>0 or Instr(request("pass"),",")>0 or Instr(request("pass"),"'")>0 or Instr(request("pass"),",")>0 or Instr(request("pass"),chr(34))>0 or Instr(request("pass"),chr(9))>0 or Instr(request("pass"),"")>0 or Instr(request("pass"),"$")>0 then
	response.write "<br>"+"<li>访问密码存在非法字符。不能有“等符号！"
	response.end
end if
if Instr(request("replyaddress"),"=")>0 or Instr(request("replyaddress"),"%")>0 or Instr(request("replyaddress"),chr(32))>0 or Instr(request("replyaddress"),"?")>0 or Instr(request("replyaddress"),"&")>0 or Instr(request("replyaddress"),";")>0 or Instr(request("replyaddress"),",")>0 or Instr(request("replyaddress"),"'")>0 or Instr(request("replyaddress"),",")>0 or Instr(request("replyaddress"),chr(34))>0 or Instr(request("replyaddress"),chr(9))>0 or Instr(request("replyaddress"),"")>0 or Instr(request("replyaddress"),"$")>0 then
	response.write "<br>"+"<li>发信人邮箱存在非法字符。"
	response.end
end if
mailser1=request("mailser")
smtphost=request("smtphost")
mail=request("mail")
pass=request("pass")
replyaddress=request("replyaddress")
index_file1=trim(Request.form("index_file"))
gxsj1=trim(Request.form("gxsj"))
addinfopoint1=trim(Request.form("addinfopoint"))
mailinfosh1=request("mailinfosh")


voteincdir = server.mappath("../common/setup.asp")
	Const ForReading =1, ForWriting = 2
	set fs = CreateObject("Scripti"&"ng.File"&"SystemO"&"bject")
	set ts = fs.OpenTextFile(voteincdir,ForWriting, True)
	ts.Write ""
	ts.Write "<"
	ts.Write "%"&chr(10)
	ts.Write " strSiteName= "&""""&strSiteName1&""""&chr(39)&"网站名称"&chr(10)
	ts.Write " strSiteUrl= "&""""&strSiteUrl1&""""&chr(39)&"网站网址"&chr(10)
	ts.Write " gqwebdir= "&""""&trim(Request.form("gqwebdir"))&""""&chr(39)&"以“/”开头和结尾,如果为根目录改为“/”即可"&chr(10)
	ts.Write " bbdbpath= "&""""&bbdbpath1&""""&chr(39)&"存放数据库文件夹"&chr(10)
	ts.Write " bbdbname= "&""""&trim(Request.form("bbdbname"))&""""&chr(39)&"数据库名称"&chr(10)
	ts.Write " intNewsCot= "&""""&intNewsCot1&""""&chr(39)&"新闻每页显示条数"&chr(10)
	ts.Write " intNewInfoCot= "&""""&intNewInfoCot1&""""&chr(39)&"首页最新信息显示条数"&chr(10)
	ts.Write " intInfoCot= "&""""&intInfoCot1&""""&chr(39)&"信息每页显示条数"&chr(10)	
	ts.Write " strSysEdition= "&"""3.6"""&chr(39)&"供求版本"&chr(10)
	ts.Write " sh= "&""""&sh1&""""&chr(39)&"1为 需要审核，0为直接发布"&chr(10)
	ts.Write " addpoint= "&""""&addpoint1&""""&chr(39)&"会员登录多少次数加点"&chr(10)
	ts.Write " addpointnum= "&""""&trim(Request.form("addpointnum"))&""""&chr(39)&"会员每次加点数"&chr(10)
	ts.Write " strUpdateTime= "&""""&date()&""""&chr(39)&"更新时间"&chr(10)
	ts.Write " ms= "&""""&ms1&""""&chr(39)&"网站模式,0输出错误信息(便于调试),1不输出(上传后请改为1)"&chr(10)
	ts.Write " intNewtjinfo= "&""""&intNewtjinfo1&""""&chr(39)&"首页推荐图片信息条数"&chr(10)
	ts.Write " intNewtjinfof= "&""""&intNewtjinfof1&""""&chr(39)&"副页推荐图片信息条数"&chr(10)
	ts.Write " mailinfosh= "&""""&mailinfosh1&""""&chr(39)&"后台审核信息是否发送邮件通知，1为是，0为否"&chr(10)
	ts.Write " mailser= "&""""&mailser1&""""&chr(39)&"发送邮件组件"&chr(10)
	ts.Write " mailname= "&""""&mail&""""&chr(39)&"邮箱用户名"&chr(10)
	ts.Write " mailpass= "&""""&pass&""""&chr(39)&"邮箱密码"&chr(10)
	ts.Write " mailform= "&""""&replyaddress&""""&chr(39)&"发信人邮箱"&chr(10)
	ts.Write " mailsmtp= "&""""&smtphost&""""&chr(39)&"邮箱smtp"&chr(10)
	ts.Write " maildom= "&""""&maildom1&""""&chr(39)&"邮箱smtp"&chr(10)
	ts.Write " addinfopoint= "&""""&addinfopoint1&""""&chr(39)&"推荐信息每天扣除的点数"&chr(10)
	ts.Write " passpoint= "&""""&request("passpoint")&""""&chr(39)&"审核信息增加用户点数"&chr(10)
	ts.Write " fyt2= "&""""&fyt21&""""&chr(39)&"支付宝账户"&chr(10)
	ts.Write " fyt3= "&""""&trim(Request.form("fyt3"))&""""&chr(39)&"md5安全校验码"&chr(10)
	ts.Write " fys5= "&""""&trim(Request.form("fys5"))&""""&chr(39)&"交易价格"&chr(10)
	ts.Write "%"
	ts.Write ">"
	ts.close
response.redirect "sysconfig.asp"
end sub

%>