<!--#include file="../../p_inc/Include_func.asp"-->
<!--#include file="../inc/classDbPager.asp"-->
<!--#include file="../inc/public.asp"-->
<!--#include file="../inc/openconn.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>网站信息设置</title>
<LINK href="../css/style.css" rel=stylesheet type=text/css>
<style type="text/css">
<!--
.bg66{ color:#666666}

-->
</style>
</head>
<body>
<%

If request.Cookies(Sky_Admin_Cookies_1)("admin_u")="" or request.Cookies(Sky_Admin_Cookies_1)("admin_p")="" or request.Cookies(Sky_Admin_Cookies_1)("admin_m")="" Then
	response.Redirect(Add_Root_Dir("/"&G_ADMIN&"/login.asp"))
	response.End()
End IF
response.Cookies("qingtiandy.cn")=""
If request("action")="" Then
Function Basic_1()
	IF G_IS_SQL_User_DB="1" Then
		Basic_1="(<font color=""#FF0000"">必改</font>)"
	Else
		Basic_1=""
	End IF
End Function

Function Basic_2()
	IF G_IS_SQL_User_DB="1" Then
		Basic_2="style=""color:#FF0000"""
	Else
		Basic_2=""
	End IF
End Function

Function ReadAllTextFile(filespec)
	Dim fso, f
	Set fso = CreateObject(G_FSO)
	Set f = fso.OpenTextFile(server.MapPath(filespec), 1)	
	if Not f.AtEndOfStream then
		ReadAllTextFile = f.ReadAll
	else
		ReadAllTextFile = ""
	end if
	Set f=nothing
	Set fso=nothing
End Function

Function Ghelp(v)
	Ghelp="<a href='"&v&"' target=_blank><img src='../images/help.gif' border=0 alt='查看帮助'></a>"
End Function
Function req(v)
	req=""""&request.Form(v)&""""
End Function
%>
<script src="../js/basicjs.js"></script>
<form action="liuliang_setting.asp?action=save" method="post" name="form">
<TABLE width="98%" border=0 align=center cellPadding=3 cellSpacing=1 class=tableBorder>
  <TBODY>
  <TR>
    <TH width="38%" height=25 class=tableHeaderText onClick="st('b_id_1')">整体参数设置 <span style="cursor:pointer" id="b_id_1_c">[收缩]</span></TH>
	<TH width="62%" height=25 class=tableHeaderText></TH>
  </TR>
  <tr><td colspan="2" id="b_id_1">
		<table width="100%" border="0" cellspacing="0" cellpadding="0">
			<TR>
			<td width="38%" height=23 class="forumRowHighlight"><strong><U>用户Cookies名</u></strong><br>
			  只能是英文数字，不能为空，比如：qingtianName</td>
				<td width="62%" class="forumRowHighlight">
				<input name="hxCacheName" value="<%=hxCacheName%>" size="45">		</td>
			</tr>
			<TR>
			<td width="38%" height=23 class="forumRowHighlight"><strong><U>流量返还比例</u></strong><br>
			  比如1.1等</td>
				<td width="62%" class="forumRowHighlight">
				<input name="maxReBack" value="<%=maxReBack%>" size="45">		</td>
			</tr>
			<TR>
			<td width="38%" height=23 class="forumRowHighlight"><strong><U>前台首页自动更新时间</u></strong><br>
			  单位是秒，请不要设置的太小，比如300，即5分钟为合适</td>
				<td width="62%" class="forumRowHighlight">
				<input name="hxtime" value="<%=hxtime%>" size="45">		</td>
			</tr>	
			<TR>
			<td width="38%" height=23 class="forumRowHighlight"><strong><U>前台用户注册是否需要后台审核</u></strong><br>
			  默认是不需要审核</td>
				<td width="62%" class="forumRowHighlight">
				<select name="hxLook">
					<option value="1" <%IF hxLook="1" Then Response.Write "Selected"%>>不需要审核</option>
					<option value="0" <%IF hxLook="0" Then Response.Write "Selected"%>>需要审核</option>
				</select>	
				</td>
			</tr>			
		</table>
	</td>

	<TR>
	  <td height=23 colspan="2" class="forumRowHighlight" align="center"><input type="submit" name="Submit" value="保存设置" id="Submit_ok">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
	  <input type="reset" name="Submit2" value="重&nbsp;&nbsp;&nbsp;&nbsp;置">&nbsp;&nbsp;&nbsp;&nbsp;
	  <input type="checkbox" name="beifen" checked="checked" value="1">是否备份源文件	  </td>
  </tr>		
</TABLE>
</form>
<%
end if
If request("action")="save" Then
Dim str
str=""
str=str&"<"&chr(37)&chr(10)
str=str&" hxCacheName = "&req("hxCacheName")&chr(13)&chr(10)
str=str&" cneip = """""&chr(13)&chr(10)
str=str&" maxReBack = "&req("maxReBack")&chr(13)&chr(10)
str=str&" hxtime = "&req("hxtime")&chr(13)&chr(10)
str=str&" hxLook = "&req("hxLook")&chr(13)&chr(10)
str=str&chr(37)&">"&chr(13)&chr(10)
'save file-----start
'start copy file
IF request.Form("beifen")="1" Then
	Pa="../../backup"
	Set d_file1=server.CreateObject(G_FSO)
	set d_folder1=d_file1.GetFolder(""&server.mappath(Pa)&"")
	d_file1.CopyFile server.MapPath("../../p_inc/config_dh.asp"),server.MapPath(Pa&"/config_dh_"&FormatDate(now,11)&""&".asp")	
End IF
'end copy file
Path = "../../p_inc"
FileName = "config_dh.asp"
EditFile = Server.MapPath(Path) & "\" & FileName
Dim FsoObj,FileObj,FileStreamObj
Set FsoObj = Server.CreateObject(G_FSO)
Set FileObj = FsoObj.GetFile(EditFile)
	Set FileStreamObj = FileObj.OpenAsTextStream(2)
	FileStreamObj.Write str
	if Err.Number <> 0 then
		'strShowErr = "<li>保存失败</li><li>"& Err.Description &"</li><li>可能是config.asp文件没有写入权限，请开启</li>"
		'Response.Redirect("../error.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=")
		'Response.end
	else
		'strShowErr = "<li>全局变量保存成功</li>"
		'Response.Redirect("../Success.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=&c=back")
		'Response.end
	end if

'''----------------------------


'===开始重新写入文件================
str1=ReadAllTextFile(Add_Root_Dir("/qtUnion/js/1.config"))
IF G_VIRTUAL_ROOT_DIR="" Then
	str1=Replace(str1,"{qt:G_WEBURL}",G_WEBURL)
Else
	str1=Replace(str1,"{qt:G_WEBURL}",G_WEBURL&G_VIRTUAL_ROOT_DIR&"/")
End IF
N_Fso.CreateFolderFile Add_Root_Dir("/qtUnion/js/1.js"),str1

str1=ReadAllTextFile(Add_Root_Dir("/qtUnion/js/2.config"))
IF G_VIRTUAL_ROOT_DIR="" Then
	str1=Replace(str1,"{qt:G_WEBURL}",G_WEBURL)
Else
	str1=Replace(str1,"{qt:G_WEBURL}",G_WEBURL&G_VIRTUAL_ROOT_DIR&"/")
End IF
N_Fso.CreateFolderFile Add_Root_Dir("/qtUnion/js/2.js"),str1

'save file-----end
response.write"<table cellpadding=2 cellspacing=1 border=0 width=400 class=tableBorder align=center>"
response.write"<TR>"
response.write"<TH class=tableHeaderText colSpan=2 height=25>保存网站信息</TH>"
'response.Flush()
'response.write"<TR><tr><td height=85 valign=top class=forumRowHighlight><div align=left><br><br>正在转化可用播放方式，请不要关闭....<br>"
'response.Flush()
'response.Write "先前支持格式："&G_v_type&"<br>"
'response.Write "现在支持格式："&request("G_v_type")&"<br>"
'
'G_v_type_arr=split(G_v_type,",")
'G_v_type_t=G_v_type
'For i=0 To Ubound(G_v_type_arr)
'	IF Instr(request("G_v_type"),G_v_type_arr(i))>0 Then
'		G_v_type_t=replace(G_v_type_t,G_v_type_arr(i),"")
'	End IF
'Next
'G_v_type_t=PrintArray(G_v_type_t,",")
'response.Write "去除格式："&G_v_type_t&"<br>"
'G_v_type_t_arr=Split(G_v_type_t,",")
'For i=0 To Ubound(G_v_type_t_arr)
'	G_v_type_t_1=Trim(G_v_type_t_arr(i))
'	IF G_v_type_t_1<>"" Then
'		conn.execute("update qingtiandy_movie set m_look=0 where m_type3='"&G_v_type_t_1&"'")
'	End IF
'Next
'response.Write"转化完毕!</div></td></tr>"
response.write"<TR><tr><td height=85 valign=top class=forumRowHighlight><div align=center><br><br>流量基本设置保存成功！</div></td></tr>"
response.write"<tr align=center><td height=30 class=forumRowHighlight><a href='liuliang_setting.asp'>&lt;&lt; 返回上一页</a></td>"
response.write"</tr>"
response.write"</table>"
response.write"<br><br>" 
end if



%>
</body>
</html>
