<?php
# Name: PHP版程氏音乐CMS管理系统 v3.0
# Author: 程氏<web@chshcms.com> [QQ:848769359]
# Homepage:http://www.chshcms.cn/
include_once("../../lib/cs_conn.php");
include_once("../../lib/cs_common.php");
include_once("../loginstate.php");
include_once("../../lib/cs_config_uc.php");
$UC_DBTABLEPRE=explode("`".UC_DBNAME."`.",UC_DBTABLEPRE);
if(!defined('CS_Weboff'))  define('CS_Weboff',0);
if(!defined('CS_Webnoneir'))  define('CS_Webnoneir','网站升级中...');
SystemPer('1_1');
$UC_PASS=substr(UC_DBPW,0,1)."********".substr(UC_DBPW,-1);
$action=CS_Request("a");
?>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<title>chshdjcms management</title>
<link href="../res/css/admin_style.css" rel="stylesheet" />
<script type="text/javascript" src="../res/js/ajax.js"></script>
<script language="javascript" src="../res/js/jquery.js"></script>
<script>
//导航转换
function menu(n) {
   for(var i=1;i<=6;i++){
        var curC=document.getElementById('config_0'+i);
        var curB=document.getElementById('top'+i);
        if(n==i){
             curC.style.height="90px";
          if(n==4){
             document.getElementById('config_07').style.height="210px";
          }
          if(n==5){
             document.getElementById('config_07').style.height="220px";
          }
          if(n==6){
             document.getElementById('config_07').style.height="290px";
          }
          curB.className="current";
        }else{
          if(i!=1){
             curC.style.height="0px";
          }else{
             curC.style.height="70px";
          }
          curB.className=""
        }
   } 
}
</script>
</head>
<body>
<div class="wrap">
<!-- start -->
<div class="top_wrap">
	<div class="top_wrap_pd">
	<div class="nav">
		<ul class="cc">
			<li id="top1" class="current"><a href="#config_01" onclick="menu(1);">站点信息</a></li>
			<li id="top2"><a href="#config_02" onclick="menu(2);">站点状态</a></li>
			<li id="top3"><a href="#config_03" onclick="menu(3);">系统配置设置</a></li>
			<li id="top4"><a href="#config_04" onclick="menu(4);">整合UC设置</a></li>
			<li id="top5"><a href="#config_05" onclick="menu(5);">程序结构设置</a></li>
			<li id="top6"><a href="#config_06" onclick="menu(6);">其它相关设置</a></li>
		</ul>
	</div>
	</div>
</div>
<a name="config_01"></a><div id="config_01" style="height:70px;"></div>
<form method="post" class="J_ajaxForm" action="?a=edit">
<div class="h_a">站点信息设置</div>
<div class="table_full">
	<table width="100%">
		<col class="th" />
		<col width="400" />
		<col />
		<tr>
			<th>站点名称</th>
			<td>
				<input name="CS_WebName" type="text" class="input length_5" value="<?php echo CS_WebName?>">
			</td>
			<td><div class="fun_tips">默认站点名称，如果各个应用没有填写站点名称，则显示这个名称</div></td>
		</tr>
		<tr>
			<th>站点域名</th>
			<td>
				<input name="CS_WebUrl" type="text" class="input length_5" value="<?php echo CS_WebUrl?>">
			</td>
			<td><div class="fun_tips">填写您站点的域名。例如: www.chshcms.com，不要加 (“http://”) </div></td>
		</tr>
		<tr>
			<th>网站路径</th>
			<td>
				<input name="CS_WebPath" type="text" class="input length_5" value="<?php echo CS_WebPath?>">
			</td>
			<td><div class="fun_tips">如：根目录设置为空/，二级目录/Dj/</div></td>
		</tr>
		<tr>
			<th>关键字</th>
			<td>
				<input name="CS_Key" type="text" class="input length_5" value="<?php echo html_entity_decode(stripslashes(CS_Key))?>">
			</td>
			<td><div class="fun_tips">SEO关键字描述</div></td>
		</tr>
		<tr>
			<th>网站描述</th>
			<td>
				<input name="CS_Description" type="text" class="input length_5" value="<?php echo html_entity_decode(stripslashes(CS_Description))?>">
			</td>
			<td><div class="fun_tips">SEO网页内容信息描述</div></td>
		</tr>
		<tr>
			<th>管理员联系QQ</th>
			<td>
				<input name="CS_AdminQQ" type="text" class="input length_5" value="<?php echo CS_AdminQQ?>">
			</td>
			<td><div class="fun_tips">填写站点管理员的联系QQ</div></td>
		</tr>
		<tr>
			<th>管理员联系电话</th>
			<td>
				<input name="CS_Admintel" type="text" class="input length_5" value="<?php echo CS_Admintel?>">
			</td>
			<td><div class="fun_tips">填写站点管理员的联系电话</div></td>
		</tr>
		<tr>
			<th>管理员电子邮箱</th>
			<td>
				<input name="CS_Adminmail" type="text" class="input length_5" value="<?php echo CS_Adminmail?>">
			</td>
			<td><div class="fun_tips">填写站点管理员的邮箱地址</div></td>
		</tr>
		<tr>
			<th>ICP 备案信息</th>
			<td>
				<input name="CS_Webicp" type="text" class="input length_5" value="<?php echo CS_Webicp?>">
			</td>
			<td><div class="fun_tips">填写 ICP 备案的信息，例如: 浙ICP备xxxxxxxx号</div></td>
		</tr>
		<tr>
			<th>热门搜索关键字</th>
			<td>
				<input name="CS_Keywords" type="text" class="input length_5" value="<?php echo CS_Keywords?>">
			</td>
			<td><div class="fun_tips">注意：每个关健词可以使用&quot;逗号,空格,|,下划线,&quot;来隔开</div></td>
		</tr>
		<tr>
			<th>网站公告</th>
			<td>
				<textarea class="length_5" name="CS_WebNotice"><?php echo stripslashes(html_entity_decode(CS_WebNotice))?></textarea>
			</td>
			<td><div class="fun_tips">网站公告，模版调用标签：{csdjcms:notice}。</div></td>
		</tr>
		<tr>
			<th>第三方统计代码</th>
			<td>
				<textarea class="length_5" name="CS_WebCount"><?php echo html_entity_decode(stripslashes(CS_WebCount))?></textarea>
			</td>
			<td><div class="fun_tips">在第三方网站上注册并获得统计代码，并将统计代码粘帖在下面文本框中即可。</div></td>
		</tr>
	</table>
</div>
<a name="config_02"></a><div id="config_02" style="height:0px;"></div>
<div class="h_a">站点状态设置</div>		
<div class="table_full">
<table width="100%">
	<col class="th" />
	<col width="400" />
	<col />
	<tr>
		<th>站点状态</th>
		<td>
			<ul id="J_statuCS_type" class="single_list cc">
				<li><label><input data-title="s1" data-type="" name="CS_Weboff" type="radio" value="0" <?php if(CS_Weboff==0){echo "checked";}?>>完全开放</label></li>
				<li><label><input data-title="s3" data-type="J_statuCS_s2" name="CS_Weboff" type="radio" value="1" <?php if(CS_Weboff==1){echo "checked";}?>>完全关闭</label></li>
			</ul>
		</td>
		<td><div id="J_statuCS_tip" class="fun_tips">完全关闭:不允许访问站点，一般用于站点关闭、系统维护等情况</div></td>
	</tr>
</table>
</div>
<div class="table_full">
<table width="100%" id="J_statuCS_s2" class="J_statuCS_tbody">
	<col class="th" />
	<col width="400" />
	<col />
	<tr>
		<th>站点关闭提示信息</th>
		<td>
			<textarea class="length_5"  name="CS_Webnoneir"><?php echo html_entity_decode(stripslashes(CS_Webnoneir))?></textarea>
		</td>
		<td><div class="fun_tips">当站点处于关闭状态时，界面显示的提示信息</div></td>
	</tr>
</table>
</div>
<a name="config_03"></a><div id="config_03" style="height:0px;"></div>
<div class="h_a">系统配置设置</div>		
<div class="table_full">
	<table width="100%">
		<col class="th" />
		<col width="400" />
		<col />
		<tr>
			<th>会员伪静态开关</th>
			<td>
				<ul class="switch_list cc">
					<li><label><input name="CS_Usermode" type="radio" value="0" <?php if(CS_Usermode==0){echo "checked";}?>><span>开启</span></label></li>
					<li><label><input name="CS_Usermode" type="radio" value="1" <?php if(CS_Usermode==1){echo "checked";}?>><span>关闭</span></label></li>
				</ul>
			</td>
			<td><div class="fun_tips">这里的伪静态指的是Rewrite伪静态</div></td>
		</tr>
		<tr>
			<th>会员二级域名状态</th>
			<td>
				<ul class="switch_list cc">
					<li><label><input name="CS_Uymmode" type="radio" value="0" <?php if(CS_Uymmode==0){echo "checked";}?> onClick="javascript:document.getElementById('opss').style.display=''"><span>开启</span></label></li>
					<li><label><input name="CS_Uymmode" type="radio" value="1" <?php if(CS_Uymmode==1){echo "checked";}?> onClick="javascript:document.getElementById('opss').style.display='none'"><span>关闭</span></label></li>
				</ul>
			</td>
			<td><div class="fun_tips">此功能必须要独立主机才能运行，开启二级域名，域名必须填写，如：chshcms.com，IIS必须绑定您使用的二级域名主机头为空,主目录指向user,默认文档为 i.php,才能运行，否则出错!</div></td>
		</tr>
		<tr id="opss" <?php if(CS_Uymmode==1){echo "style=\"display:none\"";} ?>>
			<th>会员二级域名网址</th>
			<td>
				<input name="CS_Uymurl" type="text" class="input length_5" value="<?php echo CS_Uymurl?>">
			</td>
			<td><div class="fun_tips">填写您的会员二级域名网址</div></td>
		</tr>
		<tr>
			<th>官方歌曲库搜索</th>
			<td>
				<ul class="switch_list cc">
					<li><label><input name="CS_Somode" type="radio" value="0" <?php if(CS_Somode==0){echo "checked";}?> onClick="javascript:document.getElementById('opsso').style.display=''"><span>开启</span></label></li>
					<li><label><input name="CS_Somode" type="radio" value="1" <?php if(CS_Somode==1){echo "checked";}?> onClick="javascript:document.getElementById('opsso').style.display='none'"><span>关闭</span></label></li>
				</ul>
			</td>
			<td><div class="fun_tips">开启官方舞曲库搜索，会将您的站点舞曲信息自动导入官方舞曲库，有利于跟多的人搜索到你站！</div></td>
		</tr>
		<tr id="opsso" <?php if(CS_Somode==1){echo "style=\"display:none\"";} ?>>
			<th>官方授权KEY</th>
			<td>
				<input name="CS_YmKey" type="text" class="input length_5" value="<?php echo CS_YmKey?>" />
			</td>
			<td><div class="fun_tips">填写您的域名授权KEY</div></td>
		</tr>
		<tr>
			<th>网站评论方式</th>
			<td>
				<ul class="switch_list cc">
					<li><label><input name="CS_Plmode" type="radio" value="0" <?php if(CS_Plmode==0){echo "checked";}?> onClick="javascript:document.getElementById('pladd').style.display=''"><span>站内</span></label></li>
					<li><label><input name="CS_Plmode" type="radio" value="1" <?php if(CS_Plmode==1){echo "checked";}?> onClick="javascript:document.getElementById('pladd').style.display='none'"><span>友言</span></label></li>
					<li><label><input name="CS_Plmode" type="radio" value="2" <?php if(CS_Plmode==2){echo "checked";}?> onClick="javascript:document.getElementById('pladd').style.display='none'"><span>关闭</span></label></li>
				</ul>
			</td>
			<td><div class="fun_tips">网站评论方式！</div></td>
		</tr>
		<tr id="pladd" <?php if(CS_Plmode!=0){echo "style=\"display:none\"";} ?>>
			<th>网站评论每页条数</th>
			<td>
				<input name="CS_PlNum" type="text" class="input length_5" value="<?php echo CS_PlNum?>">
			</td>
			<td><div class="fun_tips">评论每页条数</div></td>
		</tr>
		<tr>
			<th>后台登陆认证码</th>
			<td>
				<input name="CS_AdminCode" type="text" class="input length_5" value="<?php echo CS_AdminCode?>">
			</td>
			<td><div class="fun_tips">填写后台登陆认证码</div></td>
		</tr>
	</table>
</div>
<a name="config_04"></a><div id="config_04" style="height:0px;"></div>
<div class="h_a">整合UC设置</div>		
<div class="table_full">
	<table width="100%">
		<col class="th" />
		<col width="400" />
		<col />
		<tr>
			<th>整合UC开关</th>
			<td>
				<ul class="switch_list cc">
					<li><label><input name="CS_Ucmode" type="radio" value="1" <?php if(CS_Ucmode==1){echo "checked";}?> onClick="javascript:document.getElementById('opsss').style.display=''"><span>开启</span></label></li>
					<li><label><input name="CS_Ucmode" type="radio" value="0" <?php if(CS_Ucmode==0){echo "checked";}?> onClick="javascript:document.getElementById('opsss').style.display='none'"><span>关闭</span></label></li>
				</ul>
			</td>
			<td><div class="fun_tips">UCenter开关设置</div></td>
		</tr>
                <table id="opsss" <?php if(CS_Ucmode==0){echo "style=\"display:none\"";} ?>>
		<tr>
			<th>UC数据库服务器</th>
			<td>
				<input name="Uc_Host" type="text" class="input length_5" value="<?php echo UC_DBHOST?>">
			</td>
			<td><div class="fun_tips">UCenter服务器名称或IP地址 </div></td>
		</tr>
		<tr>
			<th>UC数据库用户名</th>
			<td>
				<input name="Uc_User" type="text" class="input length_5" value="<?php echo UC_DBUSER?>">
			</td>
			<td><div class="fun_tips">请填写UCenter 数据库用户</div></td>
		</tr>
		<tr>
			<th>UC数据库密码</th>
			<td>
				<input name="Uc_Pwd" type="text" class="input length_5" value="<?php echo $UC_PASS?>">
			</td>
			<td><div class="fun_tips">填写UCenter 数据库密码,安全考虑，只显示密码的前后两位，中间显示八个 * 号。 </div></td>
		</tr>
		<tr>
			<th>UC数据库名称</th>
			<td>
				<input name="Uc_Name" type="text" class="input length_5" value="<?php echo UC_DBNAME?>">
			</td>
			<td><div class="fun_tips">填写UCenter 数据库名称</div></td>
		</tr>
		<tr>
			<th>UC数据库表前缀</th>
			<td>
				<input name="Uc_Tablepre" type="text" class="input length_5" value="<?php echo $UC_DBTABLEPRE[1]?>">
			</td>
			<td><div class="fun_tips">填写UCenter 数据库表前缀</div></td>
		</tr>
		<tr>
			<th>UC通信通信密钥</th>
			<td>
				<input name="Uc_Key" type="text" class="input length_5" value="<?php echo UC_KEY?>">
			</td>
			<td><div class="fun_tips">填写UCenter 的通信密钥, 要与 UCenter 保持一致</div></td>
		</tr>
		<tr>
			<th>UC访问网址</th>
			<td>
				<input name="Uc_Api" type="text" class="input length_5" value="<?php echo UC_API?>">
			</td>
			<td><div class="fun_tips">填写UCenter 的 URL 地址</div></td>
		</tr>
		<tr>
			<th>UC应用ID</th>
			<td>
				<input name="Uc_Appid" type="text" class="input length_5" value="<?php echo UC_APPID?>">
			</td>
			<td><div class="fun_tips">填写当前应用的 ID，设置CsDjCMS在Ucenter的ID应用</div></td>
		</tr>
                </table>
	</table>
</div>
<a name="config_05"></a><div id="config_05" style="height:0px;"></div>
<div class="h_a">程序结构设置</div>		
<div class="table_full">
	<table width="100%">
		<col class="th" />
		<col width="400" />
		<col />
		<tr>
			<th>程序运行模式</th>
			<td>
				<ul class="switch_list cc">
					<li><label><input name="CS_Webmode" type="radio" value="3" <?php if(CS_Webmode==3){echo "checked";}?> onClick="javascript:document.getElementById('jingtai').style.display=''"><span>静态模式</span></label></li>
					<li><label><input name="CS_Webmode" type="radio" value="1" <?php if(CS_Webmode==1){echo "checked";}?> onClick="javascript:document.getElementById('jingtai').style.display='none'"><span>动态模式</span></label></li>
					<li><label><input name="CS_Webmode" type="radio" value="2" <?php if(CS_Webmode==2){echo "checked";}?> onClick="javascript:document.getElementById('jingtai').style.display='none'"><span>伪静态模式</span></label></li>
				</ul>
			</td>
			<td><div class="fun_tips">这里的伪静态需要主机支持伪静态组建</div></td>
		</tr>
                <!--------------静态模式------------->
                <table id="jingtai" <?php if(CS_Webmode!=3){echo 'style="display:none"';}?>>
		<tr>
			<th>舞曲目录设置</th>
			<td>
				<div class="mb10"><input name="CS_Dname" type="text" class="input length_2" value="<?php echo CS_Dname?>"></div>
			</td>
			<td><div class="fun_tips">这里是舞曲生成目录设置</div></td>
		</tr>
		<tr>
			<th>文章目录设置</th>
			<td>
				<div class="mb10"><input name="CS_Nname" type="text" class="input length_2" value="<?php echo CS_Nname?>"></div>
			</td>
			<td><div class="fun_tips">这里是文章生成目录设置</div></td>
		</tr>
		<tr>
			<th>专集目录设置</th>
			<td>
				<div class="mb10"><input name="CS_Tname" type="text" class="input length_2" value="<?php echo CS_Tname?>"></div>
			</td>
			<td><div class="fun_tips">这里是专集生成目录设置</div></td>
		</tr>
		<tr>
			<th>文件生成选项</th>
			<td>
				<select class="select_3 J_alipay_interface" name="CS_Mark">
                                      <option value="0" <?php if(CS_Mark==0){echo "selected";} ?> >ID排序</option>
                                      <option value="1" <?php if(CS_Mark==1){echo "selected";} ?> >ID目录</option>
                                      <option value="2" <?php if(CS_Mark==2){echo "selected";} ?> >别名目录</option>
                                      <option value="3" <?php if(CS_Mark==3){echo "selected";} ?> >日期目录</option>
				</select>
				.后缀:
				<select name="CS_Suffix">
                                      <option value="htm" <?php if(CS_Suffix=="htm"){echo "selected";} ?>>htm</option>
                                      <option value="php" <?php if(CS_Suffix=="php"){echo "selected";} ?>>php</option>
                                      <option value="html" <?php if(CS_Suffix=="html"){echo "selected";} ?>>html</option>
                                      <option value="shtm" <?php if(CS_Suffix=="shtml"){echo "selected";} ?>>shtml</option>
				</select>
			</td>
			<td><div class="fun_tips">这里是静态模式下文件生成选项</div></td>
		</tr>
		<tr>
			<th>生成每页间隔</th>
			<td>
			<li>
				<span class="span_3"><input name="CS_StopTime" type="text" class="input length_2" value="<?php echo CS_StopTime?>" onkeyup="this.value=this.value.replace(/[^\d]/g,'')" onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))">&nbsp;秒 &nbsp; 每页生成：</span>
				<span class="span_4"><input name="CS_Createpre" type="text" class="input mr15 length_2"  value="<?php echo CS_Createpre?>" onkeyup="this.value=this.value.replace(/[^\d]/g,'')" onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))">条</span>
			</li>
			</td>
			<td><div class="fun_tips">每页生成间隔时间和条数</div></td>
		</tr>
                </table>
	</table>
</div>
<a name="config_06"></a><div id="config_06" style="height:0px;"></div>
<div class="h_a">其他相关设置</div>		
<div class="table_full">
	<table width="100%">
		<col class="th" />
		<col width="400" />
		<col />
		<tr>
			<th>音频播放器大小</th>
			<td>
			<li>
				<span class="span_3">宽度:<input name="CS_Play_w" type="text" class="input length_2" value="<?php echo CS_Play_w?>" onkeyup="this.value=this.value.replace(/[^\d]/g,'')" onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))">&nbsp;</span>
				<span class="span_4">高度:<input name="CS_Play_h" type="text" class="input mr15 length_2"  value="<?php echo CS_Play_h?>" onkeyup="this.value=this.value.replace(/[^\d]/g,'')" onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))"></span>
			</li>
			</td>
			<td><div class="fun_tips">网站音频播放器大小。</div></td>
		</tr>
		<tr>
			<th>视频播放器大小</th>
			<td>
			<li>
				<span class="span_3">宽度:<input name="CS_Play_sw" type="text" class="input length_2" value="<?php echo CS_Play_sw?>" onkeyup="this.value=this.value.replace(/[^\d]/g,'')" onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))">&nbsp;</span>
				<span class="span_4">高度:<input name="CS_Play_sh" type="text" class="input mr15 length_2"  value="<?php echo CS_Play_sh?>" onkeyup="this.value=this.value.replace(/[^\d]/g,'')" onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))"></span>
			</li>
			</td>
			<td><div class="fun_tips">网站视频播放器大小。</div></td>
		</tr>
		<tr>
			<th>网站缓存开关</th>
			<td>
				<ul class="switch_list cc">
					<li><label><input name="CS_IsCache" type="radio" value="1" <?php if(CS_IsCache==1){echo "checked";}?> onClick="javascript:document.getElementById('ops').style.display=''" /><span>开启</span></label></li>
					<li><label><input name="CS_IsCache" type="radio" value="0" <?php if(CS_IsCache==0){echo "checked";}?> onClick="javascript:document.getElementById('ops').style.display='none'" /><span>关闭</span></label></li>
				</ul>
			</td>
			<td><div class="fun_tips">网站缓存开关选择。</div></td>
		</tr>
		<tr id="ops" <?php if(CS_IsCache==0){echo "style=\"display:none\"";} ?>>
			<th>缓存设置</th>
			<td>
				<div class="mb10">缓存目录:&nbsp;<input name="CS_Cachename" type="text" class="input length_2" value="<?php echo CS_Cachename?>"></div>
				<div class="mb10">缓存时间:&nbsp;<input name="CS_CacheTime" type="text" class="input length_2" value="<?php echo CS_CacheTime?>" onkeyup="this.value=this.value.replace(/[^\d]/g,'')" onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))">&nbsp;秒</div>
				<div class="mb10">缓存标识:&nbsp;<input name="CS_CacheMark" type="text" class="input length_2" value="<?php echo CS_CacheMark?>"></div>
			</td>
			<td><div class="fun_tips">网站缓存相关设置。</div></td>
		</tr>
		<tr>
			<th>图片文字水印</th>
			<td>
				<ul class="switch_list cc">
					<li><label><input name="CS_WaterMark" type="radio" value="1" <?php if(CS_WaterMark==1){echo "checked";}?> onClick="javascript:document.getElementById('opps').style.display=''" /><span>开启</span></label></li>
					<li><label><input name="CS_WaterMark" type="radio" value="0" <?php if(CS_WaterMark==0){echo "checked";}?> onClick="javascript:document.getElementById('opps').style.display='none'" /><span>关闭</span></label></li>
				</ul>
			</td>
			<td><div class="fun_tips">图片文字水印开关选择。</div></td>
		</tr>
		<tr id="opps" <?php if(CS_WaterMark==0){echo "style=\"display:none\"";} ?>>
			<th>水印设置</th>
			<td>
				<div class="mb10">水印文字:&nbsp;<input name="CS_WaterFont" type="text" class="input length_2" value="<?php echo CS_WaterFont?>"></div>
				<div class="mb10">字体大小:&nbsp;<input name="CS_WaterFontSize" type="text" class="input length_2" value="<?php echo CS_WaterFontSize?>" onkeyup="this.value=this.value.replace(/[^\d]/g,'')" onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))"></div>
				<div>字体颜色:&nbsp;
				    <select name="CS_WaterFontColor">
			    	            <option style="background-color:<?php echo CS_WaterFontColor?>;color: <?php echo CS_WaterFontColor?>" value="<?php echo CS_WaterFontColor?>"></option>
                			    <option style="background-color:#00FF00;color: #00FF00" value="#00FF00">绿色</option>
                			    <option style="background-color:#0000CC;color: #0000CC" value="#0000CC">深蓝</option>
                			    <option style="background-color:#FFFF00;color: #FFFF00" value="#FFFF00">黄色</option>
                			    <option style="background-color:#FF33CC;color: #FF33CC" value="#FF33CC">粉红</option>
                			    <option style="background-color:#FF0000;color: #FF0000" value="#FF0000">红色</option>
                			    <option style="background-color:#660099;color: #660099" value="#660099">紫色</option>
				    </select>
                                </div>
				<div>水印位置:&nbsp;
				    <select name="CS_WaterLocation">
                			    <option value="0" <?php if(CS_WaterLocation==0){echo "selected";} ?>>随机位置</option>
                			    <option value="1" <?php if(CS_WaterLocation==1){echo "selected";} ?>>顶端居左</option>
                			    <option value="2" <?php if(CS_WaterLocation==2){echo "selected";} ?>>顶端居中</option>
                			    <option value="3" <?php if(CS_WaterLocation==3){echo "selected";} ?>>顶端居右</option>
                			    <option value="4" <?php if(CS_WaterLocation==4){echo "selected";} ?>>中部居左</option>
                			    <option value="5" <?php if(CS_WaterLocation==5){echo "selected";} ?>>中部居中</option>
                			    <option value="6" <?php if(CS_WaterLocation==6){echo "selected";} ?>>中部居右</option>
               			            <option value="7" <?php if(CS_WaterLocation==7){echo "selected";} ?>>底端居左</option>
                			    <option value="8" <?php if(CS_WaterLocation==8){echo "selected";} ?>>底端居中</option>
                			    <option value="9" <?php if(CS_WaterLocation==9){echo "selected";} ?>>底端居右</option>
				    </select>
                                </div>
			</td>
			<td><div class="fun_tips">图片文字水印相关设置。</div></td>
		</tr>
		<tr>
	</table>
</div><input type="hidden" name="CS_Templateurl" value="<?php echo CS_Templateurl?>"/>
<div id="config_07" style="height:0px;">&nbsp;</div>
<div class="btn_wrap">
	<div class="btn_wrap_pd">
		<button class="btn btn_submit mr10 J_ajax_submit_btn" type="submit">提交保存</button>
                <div class="tips_error" id="Msg"></div>
	</div>
</div></form>
<!-- end -->
</div>
<?php
if ($action=="edit"){
@header("Content-type: text/html;charset=utf-8");
   	$nCS_WebName=CS_Request("CS_WebName");
   	$nCS_WebUrl=CS_Request("CS_WebUrl");
   	$nCS_AdminCode=CS_Request("CS_AdminCode");
   	$nCS_WebPath=CS_Request("CS_WebPath");
   	$nCS_Key=CS_Request("CS_Key");
   	$nCS_Description=CS_Request("CS_Description");
   	$nCS_Weboff=CS_Request("CS_Weboff");
   	$nCS_Webnoneir=CS_Request("CS_Webnoneir");
   	$nCS_Webmode=CS_Request("CS_Webmode");
   	$nCS_Usermode=CS_Request("CS_Usermode");
   	$nCS_Uymmode=CS_Request("CS_Uymmode");
   	$nCS_Ucmode=CS_Request("CS_Ucmode");
   	$nCS_Uymurl=CS_Request("CS_Uymurl");
   	$nCS_Somode=CS_Request("CS_Somode");
   	$nCS_YmKey=CS_Request("CS_YmKey");
   	$nCS_Mark=CS_Request("CS_Mark");
   	$nCS_Dname=CS_Request("CS_Dname");
   	$nCS_Nname=CS_Request("CS_Nname");
   	$nCS_Tname=CS_Request("CS_Tname");
   	$nCS_Suffix=CS_Request("CS_Suffix");
   	$nCS_StopTime=CS_Request("CS_StopTime");
   	$nCS_Createpre=CS_Request("CS_Createpre");
   	$nCS_Webicp=CS_Request("CS_Webicp");
   	$nCS_AdminQQ=CS_Request("CS_AdminQQ");
   	$nCS_Admintel=CS_Request("CS_Admintel");
   	$nCS_Adminmail=CS_Request("CS_Adminmail");
   	$nCS_Keywords=$_POST["CS_Keywords"];
   	$nCS_WebCount=CS_Request("CS_WebCount");
   	$nCS_WebNotice=CS_Request("CS_WebNotice");
   	$nCS_Plmode=CS_Request("CS_Plmode");
   	$nCS_Templateurl=CS_Request("CS_Templateurl");
   	$nCS_PlNum=CS_Request("CS_PlNum");
   	//缓存技术
   	$nCS_IsCache=CS_Request("CS_IsCache");
   	$nCS_CacheTime=CS_Request("CS_CacheTime");
   	$nCS_CacheMark=CS_Request("CS_CacheMark");
   	$nCS_Cachename=CS_Request("CS_Cachename");
   	//图片水印
   	$nCS_Play_w=CS_Request("CS_Play_w");
   	$nCS_Play_h=CS_Request("CS_Play_h");
   	$nCS_Play_sw=CS_Request("CS_Play_sw");
   	$nCS_Play_sh=CS_Request("CS_Play_sh");
   	$nCS_WaterMark=CS_Request("CS_WaterMark");
   	$nCS_WaterFontSize=CS_Request("CS_WaterFontSize");
   	$nCS_WaterLocation=CS_Request("CS_WaterLocation");
   	$nCS_WaterFont=CS_Request("CS_WaterFont");
   	$nCS_WaterFontColor=CS_Request("CS_WaterFontColor");
        if(empty($nCS_Play_w)) $nCS_Play_w=300;
        if(empty($nCS_Play_sw)) $nCS_Play_sw=300;
        if(empty($nCS_Play_h)) $nCS_Play_h=64;
        if(empty($nCS_Play_sh)) $nCS_Play_sh=300;
   	if(empty($nCS_CacheTime)) $nCS_CacheTime=1024;
   	if(empty($nCS_WaterFontSize)) $nCS_WaterFontSize=12;
   	if(empty($nCS_StopTime)) $nCS_StopTime=3;
   	if(empty($nCS_Createpre)) $nCS_Createpre=100;
   	if(empty($nCS_PlNum)) $nCS_PlNum=10;

        //UC信息
   	$nUC_DBHOST=CS_Request("Uc_Host");
   	$nUC_DBUSER=CS_Request("Uc_User");
   	$nUC_DBPW=CS_Request("Uc_Pwd");
   	$nUC_DBNAME=CS_Request("Uc_Name");
   	$nUC_DBTABLEPRE=CS_Request("Uc_Tablepre");
   	$nUC_DBTABLEPRE="`".$nUC_DBNAME."`.".$nUC_DBTABLEPRE."";
   	$nUC_KEY=CS_Request("Uc_Key");
   	$nUC_API=CS_Request("Uc_Api");
   	$nUC_APPID=CS_Request("Uc_Appid");
        if($nUC_DBPW==$UC_PASS){
	     $nUC_DBPW=UC_DBPW;
        }

	
	//判断生成目录有无重名
	$arr1=array($nCS_Dname,$nCS_Nname,$nCS_Tname);
	$arr2=array("舞曲目录","文章目录","专集目录");
	for ($i=0;$i<3;$i++){
		for($j=0;$j<3;$j++){
			if($i<>$j){
				 if ($arr1[$i]==$arr1[$j]){
 					exit("<script>document.getElementById('Msg').innerHTML='".$arr2[$i]."生成目录有重名了,请修改!';</script>");			
				 }
			}
		}
	}
	
	//下面为自动修改文件名
	//判断动态文件夹名是否修改	
        if($nCS_Webmode==3){
	    $i=0;
	    $Arra=array(CS_Dname,CS_Nname,CS_Tname);
	    $Arrb=array($nCS_Dname,$nCS_Nname,$nCS_Tname);
	    for($i=0;$i<3;$i++){
                if(file_exists("../../".$Arra[$i])){
		    if ($Arra[$i]<>$Arrb[$i]){
			if(!rename("../../".$Arra[$i],"../../".$Arrb[$i])) exit("<script>document.getElementById('Msg').innerHTML='网站没有修改静态目录权限!';</script>");
		    }else{
			mkdir("../../".$Arrb[$i]);
                    }
                }else{
		    if(!file_exists("../../".$Arra[$i])){
			mkdir("../../".$Arra[$i]);
		    }
                }
	    }
        }
	//缓存目录名

	if(CS_Cachename!=$nCS_Cachename){
		if(file_exists("../../".CS_Cachename."/")){
			if(!rename("../../".CS_Cachename,"../".$nCS_Cachename)) exit("<script>document.getElementById('Msg').innerHTML='网站没有修改缓存目录".CS_Cachename."的权限!';</script>");
		}else{
			mkdir("../../".$nCS_Cachename);
		}	
	}else{
		if(!file_exists("../../".CS_Cachename)){
			mkdir("../../".$nCS_Cachename);
		}
        }	



	$strs="<?php"."\r\n";
	
	$strs=$strs."define(\"CS_WebName\",\"".$nCS_WebName."\");\r\n";
	$strs=$strs."define(\"CS_WebUrl\",\"".$nCS_WebUrl."\");\r\n";
	$strs=$strs."define(\"CS_AdminCode\",\"".$nCS_AdminCode."\");\r\n";
	$strs=$strs."define(\"CS_WebPath\",\"".$nCS_WebPath."\");\r\n";
	$strs=$strs."define(\"CS_Key\",\"".$nCS_Key."\");\r\n";
	$strs=$strs."define(\"CS_Description\",\"".$nCS_Description."\");\r\n";
	$strs=$strs."define(\"CS_Weboff\",".$nCS_Weboff.");\r\n";
	$strs=$strs."define(\"CS_Webnoneir\",\"".$nCS_Webnoneir."\");\r\n";
	$strs=$strs."define(\"CS_Webmode\",".$nCS_Webmode.");\r\n";
	$strs=$strs."define(\"CS_Usermode\",".$nCS_Usermode.");\r\n";
	$strs=$strs."define(\"CS_Uymmode\",".$nCS_Uymmode.");\r\n";
	$strs=$strs."define(\"CS_Uymurl\",\"".$nCS_Uymurl."\");\r\n";
	$strs=$strs."define(\"CS_Somode\",".$nCS_Somode.");\r\n";
	$strs=$strs."define(\"CS_YmKey\",\"".$nCS_YmKey."\");\r\n";
	$strs=$strs."define(\"CS_Mark\",".$nCS_Mark.");\r\n";
	$strs=$strs."define(\"CS_Dname\",\"".$nCS_Dname."\");\r\n";
	$strs=$strs."define(\"CS_Nname\",\"".$nCS_Nname."\");\r\n";
	$strs=$strs."define(\"CS_Tname\",\"".$nCS_Tname."\");\r\n";
	$strs=$strs."define(\"CS_Suffix\",\"".$nCS_Suffix."\");\r\n";
	$strs=$strs."define(\"CS_StopTime\",".$nCS_StopTime.");\r\n";
	$strs=$strs."define(\"CS_Createpre\",".$nCS_Createpre.");\r\n";
	$strs=$strs."define(\"CS_Webicp\",\"".$nCS_Webicp."\");\r\n";
	$strs=$strs."define(\"CS_AdminQQ\",\"".$nCS_AdminQQ."\");\r\n";
	$strs=$strs."define(\"CS_Admintel\",\"".$nCS_Admintel."\");\r\n";
	$strs=$strs."define(\"CS_Adminmail\",\"".$nCS_Adminmail."\");\r\n";
	$strs=$strs."define(\"CS_Keywords\",\"".$nCS_Keywords."\");\r\n";
	$strs=$strs."define(\"CS_WebCount\",\"".$nCS_WebCount."\");\r\n";
	$strs=$strs."define(\"CS_WebNotice\",\"".$nCS_WebNotice."\");\r\n";
	$strs=$strs."define(\"CS_Plmode\",".$nCS_Plmode.");\r\n";
	$strs=$strs."define(\"CS_PlNum\",".$nCS_PlNum.");\r\n";
	$strs=$strs."define(\"CS_Ucmode\",".$nCS_Ucmode.");\r\n";
	$strs=$strs."define(\"CS_Templateurl\",\"".$nCS_Templateurl."\");\r\n\r\n";

	$strs=$strs."define(\"CS_Play_w\",".$nCS_Play_w.");  \r\n";
	$strs=$strs."define(\"CS_Play_h\",".$nCS_Play_h.");  \r\n";
	$strs=$strs."define(\"CS_Play_sw\",".$nCS_Play_sw.");  \r\n";
	$strs=$strs."define(\"CS_Play_sh\",".$nCS_Play_sh.");  \r\n\r\n";

	$strs=$strs."define(\"CS_IsCache\",".$nCS_IsCache.");\r\n";
	$strs=$strs."define(\"CS_CacheTime\",".$nCS_CacheTime.");\r\n";
	$strs=$strs."define(\"CS_CacheMark\",\"".$nCS_CacheMark."\");\r\n";
	$strs=$strs."define(\"CS_Cachename\",\"".$nCS_Cachename."\");\r\n\r\n";


	$strs=$strs."define(\"CS_WaterMark\",".$nCS_WaterMark.");\r\n";
	$strs=$strs."define(\"CS_WaterFontSize\",".$nCS_WaterFontSize.");\r\n";
	$strs=$strs."define(\"CS_WaterLocation\",".$nCS_WaterLocation.");\r\n";
	$strs=$strs."define(\"CS_WaterFont\",\"".$nCS_WaterFont."\");\r\n";
	$strs=$strs."define(\"CS_WaterFontColor\",\"".$nCS_WaterFontColor."\");";

	//写文件
	$ifile = new iFile('../../lib/cs_config.php','w');
	if(!$ifile->WriteFile($strs,3)) exit("<script>document.getElementById('Msg').innerHTML='/lib/cs_config.php没有修改权限!';</script>");

        /////////////写入整合UC信息////////////////////
        if($nCS_Ucmode==1){
	$strsuc="<?php"."\r\n";
	$strsuc=$strsuc."define(\"UC_CONNECT\", \"mysql\");\r\n";
	$strsuc=$strsuc."define(\"UC_DBHOST\", \"".$nUC_DBHOST."\");\r\n";
	$strsuc=$strsuc."define(\"UC_DBUSER\", \"".$nUC_DBUSER."\");\r\n";
	$strsuc=$strsuc."define(\"UC_DBPW\", \"".$nUC_DBPW."\");\r\n";
	$strsuc=$strsuc."define(\"UC_DBNAME\", \"".$nUC_DBNAME."\");\r\n";
	$strsuc=$strsuc."define(\"UC_DBCHARSET\", \"utf-8\");\r\n";
	$strsuc=$strsuc."define(\"UC_DBTABLEPRE\", \"".$nUC_DBTABLEPRE."\");\r\n";
	$strsuc=$strsuc."define(\"UC_KEY\", \"".$nUC_KEY."\");\r\n";
	$strsuc=$strsuc."define(\"UC_API\", \"".$nUC_API."\");\r\n";
	$strsuc=$strsuc."define(\"UC_CHARSET\", \"utf-8\");\r\n";
	$strsuc=$strsuc."define(\"UC_IP\", \"\");\r\n";
	$strsuc=$strsuc."define(\"UC_APPID\", ".$nUC_APPID.");";
	//写文件
	$ifile = new iFile('../../lib/cs_config_uc.php','w');
	if(!$ifile->WriteFile($strsuc,3)) exit("<script>document.getElementById('Msg').innerHTML='../../lib/cs_config_uc.php没有修改权限!';</script>");
        }
         echo '<script>document.getElementById("Msg").className="tips_success";$("#Msg").text("恭喜,操作成功!").css("color","#026E12");</script>';
	 echo "<script>setTimeout(\"window.location='config_conn.php'\",2000);</script>";
}
?>
</body>
</html>
