<!--#include file="../../../inc/cms_admin.asp" -->
<%
dim act,LID,SiteTitle,AdditionTitle,SitePcLogo,SiteWapLogo,SiteWapUrl,CompanyName,CompanyAddress,CompanyPostCode,companyMapPoint,CompanyContact,companyTel,CompanyMobile,CompanyFax,CompanyEmail,CompanyICP,StatisticalCode,CopyRight,SiteKeys,SiteDesc,IsDefault,qq,webUrl,sql,weixin,textphone
act=getForm("act","get")
LID=getForm("LID","get")
textphone=getForm("textphone","get")
select case act	
	Case "setconfig"	:	setconfig
	Case "editsite"		:	editsite
	Case "editsystem"	:	editsystem
	case "tryemail"		:	echo sendmail(Receive_email,"这是一封发自启点在线系统的测试邮件","启点在线是国内一款非常优秀的建站系统,致力于打造最棒的asp建站系统")
	case "trysms"		:	echo sendsms(textphone,"这是一封发自启点在线系统的测试短信")
	case "changeqqkf"	:	changeqqkf
	case "saveid"		:	saveid
	case "disupdata"	:	disupdata	
end select

sub disupdata
	dim verstr:verstr= loadfile(sitepath&"inc/cms_version.asp")
	if ifstrin(verstr,"cms_verdistime") then
		verstr=regExpReplace(verstr,"cms_verdistime=""([\s\S]*)""","cms_verdistime="""&sqltime&"""")
	elseif ifstrin(verstr,"cms_verdistime") then
		verstr=regExpReplace(verstr,"cms_verbbsurl=""www.kelvinvt.com""","cms_verdistime="""&sqltime&"""")		
	end if
	savefile sitepath&"inc/cms_version.asp",verstr
End Sub

sub changeqqkf
	dim id,foothtml,qqkfid
	id=getForm("ID","get")
	foothtml=loadfile(sitepath&"template/pc/"&zset.PcTemplate&zset.PchtmlPath&"foot.html")
	  if ifstrin(foothtml,"{cms:qqkf") then
		  qqkfid=mid(foothtml,InStr(foothtml,"{cms:qqkf")+9,1)
		  if id>0 then
		  foothtml=replacestr(foothtml,"{cms:qqkf"&qqkfid&"}","{cms:qqkf"&id&"}")
		  else
		  foothtml=replacestr(foothtml,"{cms:qqkf"&qqkfid&"}","")
		  end if
	  else
		  foothtml=foothtml&"{cms:qqkf"&id&"}"
	  end if	
	savefile sitepath&"template/pc/"&zset.PcTemplate&zset.PchtmlPath&"foot.html",foothtml	
End Sub

Sub saveid
	dim colval	,colname
	colname=getForm("colname","post")	
	if colname="statisticalCode" or colname="wapkf" then
	  colval=encode(request.form("colval"))
	else
	  colval=getForm("colval","post")
	end if
	if colname="wapkf" then
		savefile sitepath&"plugins/qqkf/wapqq.html",colval
	else
		dbconn "update [dbpre]Language Set "&colname&"='"&colval&"'"
	end if
End Sub

sub editsite
SiteTitle=getForm("SiteTitle","post")
AdditionTitle=getForm("AdditionTitle","post")
SitePcLogo=getForm("SitePcLogo","post")
SiteWapLogo=getForm("SiteWapLogo","post")
webUrl=getForm("SiteUrl","post")
SiteWapUrl=getForm("SiteWapUrl","post")
CompanyName=getForm("CompanyName","post")
CompanyAddress=getForm("CompanyAddress","post")
companyMapPoint=getForm("companyMapPoint","post")
CompanyPostCode=getForm("CompanyPostCode","post")
CompanyContact=getForm("CompanyContact","post")
companyTel=getForm("companyTel","post")
CompanyMobile=getForm("CompanyMobile","post")
CompanyFax=getForm("CompanyFax","post")
CompanyEmail=getForm("CompanyEmail","post")
CompanyICP=getForm("CompanyICP","post")
StatisticalCode=encode(request.form("StatisticalCode"))	
CopyRight=getForm("CopyRight","post")
SiteKeys=getForm("SiteKeys","post")
SiteDesc=getForm("SiteDesc","post")
qq=getForm("qq","post")
weixin=getForm("weixin","post")
sql="update [dbpre]Language Set SiteTitle='"&SiteTitle&"',AdditionTitle='"&AdditionTitle&"',SitePcLogo='"&SitePcLogo&"',SiteWapLogo='"&SiteWapLogo&"',SiteUrl='"&webUrl&"',SiteWapUrl='"&SiteWapUrl&"',CompanyName='"&CompanyName&"',CompanyAddress='"&CompanyAddress&"',companyMapPoint='"&companyMapPoint&"',CompanyPostCode='"&CompanyPostCode&"',CompanyContact='"&CompanyContact&"',companyTel='"&companyTel&"',CompanyMobile='"&CompanyMobile&"',CompanyFax='"&CompanyFax&"',CompanyEmail='"&CompanyEmail&"',CompanyICP='"&CompanyICP&"',StatisticalCode='"&StatisticalCode&"',CopyRight='"&CopyRight&"',SiteKeys='"&SiteKeys&"',SiteDesc='"&SiteDesc&"',qq='"&qq&"',weixin='"&weixin&"' Where LID="&LID
dbconn sql
layermsggo "保存成功",sitepath&adminpath&"cms_Content/system/site_edit.asp"
end sub

sub setconfig
	dim configStr,configPath,configname,configval
	configname=getform("configname","both")
	configval=getform("configval","both")
	configPath=sitepath&"config/cms_Config.asp"	
	configStr=loadFile(configPath)	
	configStr=regExpReplace(configStr,"Const "&configname&"=(\d?)","Const "&configname&"="&configval&"")
	SaveFile configPath,configStr
	layertrue "保存成功"
end sub

sub editsystem
	if runMode=1 and isnum(getForm("runMode","post"))<>1 then
		if isfile(sitePath&"index.html") then delFile sitePath&"index.html"	'删除首页	
	end if
	dim configStr,configPath
	configPath=sitepath&"config/cms_Config.asp"	
	configStr=loadFile(configPath)
configStr = AddParas("webMode","(\d?)",configStr,false)
configStr = AddParas("webcloseinfo","(\S*?)",configStr,false)
configStr = AddParas("issession","(\d?)",configStr,false)
configStr = AddParas("runMode","(\d?)",configStr,false)
configStr = AddParas("userMark","(\d?)",configStr,false)
configStr = AddParas("ischeckmobile","(\d?)",configStr,false)
configStr = AddParas("ischeckemail","(\d?)",configStr,false)
configStr = AddParas("usercode","(\d?)",configStr,false)
configStr = AddParas("gbookCode","(\d?)",configStr,false)
configStr = AddParas("gbookonoff","(\d?)",configStr,false)
configStr = AddParas("gbookanonymousnum","(\S*?)",configStr,false)
configStr = AddParas("gbookusernum","(\S*?)",configStr,false)
configStr = AddParas("wapmark","(\d?)",configStr,false)
configStr = AddParas("wapPath","(\S*?)",configStr,false)
 if isObjInstalled("Persits.Jpeg") then
configStr = AddParas("waterMark","(\d?)",configStr,false)
else
configStr = AddParas("waterMark","num",configStr,0)
end if
configStr = AddParas("waterType","(\d?)",configStr,false)
configStr = AddParas("waterMarkFont","(\S*?)",configStr,false)
configStr = AddParas("waterMarkPic","(\S*?)",configStr,false)
configStr = AddParas("markPicWidth","(\S*?)",configStr,false)
configStr = AddParas("markPicHeight","(\S*?)",configStr,false)
configStr = AddParas("markPicAlpha","(\S*?)",configStr,false)
configStr = AddParas("waterMarkLocation","(\S*?)",configStr,false)
if isObjInstalled("JMail.SmtpMail") then
configStr = AddParas("mailMark","(\d?)",configStr,false)
else
configStr = AddParas("mailMark","num",configStr,0)
end if
configStr = AddParas("smtp_server","(\S*?)",configStr,false)
configStr = AddParas("smtp_usermail","(\S*?)",configStr,false)
configStr = AddParas("smtp_user","(\S*?)",configStr,false)
configStr = AddParas("smtp_password","(\S*?)",configStr,false)
configStr = AddParas("Receive_email","(\S*?)",configStr,false)
if len(getform("smspw","post"))=32 then
	configStr = AddParas("smsmark","(\d?)",configStr,false)	
else
	configStr = AddParas("smsmark","num",configStr,0)
end if
configStr = AddParas("smsid","(\S*?)",configStr,false)
configStr = AddParas("smspw","(\S*?)",configStr,false)
configStr = AddParas("regsendsms","(\d?)",configStr,false)
configStr = AddParas("forgetsendsms","(\d?)",configStr,false)
if isnul(getform("dataName","post")) then
configStr = AddParas("dbType","num",configStr,0)
else
configStr = AddParas("dbType","(\d?)",configStr,false)
end if
configStr = AddParas("dbfile","(\S*?)",configStr,false)
configStr = AddParas("dbPass","(\S*?)",configStr,false)
configStr = AddParas("dataServer","(\S*?)",configStr,false)
configStr = AddParas("dbPort","(\S*?)",configStr,false)
configStr = AddParas("dataName","(\S*?)",configStr,false)
configStr = AddParas("dataUser","(\S*?)",configStr,false)
configStr = AddParas("datapass","(\S*?)",configStr,false)
configStr = AddParas("logSql","(\S*?)",configStr,false)
configStr = AddParas("dellogSql","(\S*?)",configStr,false)

configStr = AddParas("gbooksendmail","(\d?)",configStr,false)
configStr = AddParas("evalsendmail","(\d?)",configStr,false)
configStr = AddParas("regsendmail","(\d?)",configStr,false)
configStr = AddParas("loginsendmail","(\d?)",configStr,false)
configStr = AddParas("forgetsendmail","(\d?)",configStr,false)
configStr = AddParas("shopcatsendmail","(\d?)",configStr,false)
configStr = AddParas("shopordersendmail","(\d?)",configStr,false)
configStr = AddParas("commentsendmail","(\d?)",configStr,false)
configStr = AddParas("submissionsendmail","(\d?)",configStr,false)
configStr = AddParas("diyformsendmail","(\d?)",configStr,false)

SaveFile configPath,configStr
layermsggo "保存成功",sitepath&adminpath&"cms_Content/system/system_Edit.asp"
end sub
%>