<?php
require_once(dirname(__FILE__)."/admin_inc.php");
/*******************************************************************************************
' Software name: DJCMS Content Management System
' Version:3.0
' Web: http://www.djcms.net
' Author: 心情(qq:1130731)
' Copyright (C) 2009-2010 DJCMS官方 版权所有
' 法律申明：DJCMS程序所有代码100%原创、未引入任何网上代码,对一切抄袭行为、坚决严肃追究法律责任
'*******************************************************************************************/
viewHead("站点配置");
$action = getForm("action", "get");
switch ($action) {
	case "edit" : editConfig();break;
	default : main();break;
}
viewFoot();
function main() {
	global $menuList;
?>
<div class="container" id="cpcontainer">
<!--当前导航-->
<script type="text/JavaScript">if(parent.$('admincpnav')) parent.$('admincpnav').innerHTML='后台首页&nbsp;&raquo;&nbsp;<?=$menuList[8][0]?>&nbsp;&raquo;&nbsp;站点配置';</script>
<form method="post" action="?action=edit">
<input type="hidden" name="isalertwin_old" value="<?=isAlertWin?>"/>
<table class="tb">
<tr class="thead"><td colspan="2">站点配置</td></tr>
<tr class="thead2">
  <td colspan="2"><strong>网站基本设置</strong></td>
</tr>
<tr>
	<td width="10%">网站模式：</td>
	<td valign="top">
		<ul id="makeHtmlTab" style="padding:0">
			<li id="li.v" class="hover" onclick="toogletab('0');" style="cursor:pointer">视频</li>
			<li id="li.n" onclick="toogletab('1');" style="cursor:pointer">新闻</li>
		</ul>
		<table class="tb">
			<tbody id="video" style="display:.none;">
				<tr>
					<td>
					<select name="runMode" id="runMode" onChange="selecRunMode(this.options[this.selectedIndex].value)">
						<option value="dynamic" <?php if (runMode == "dynamic")echo('selected');?>>动态模式</option>
						<option value="static" <?php if (runMode == "static")echo('selected');?>>静态模式</option>
						<option value="forgedStatic" <?php if(runMode == "forgedStatic")echo('selected');?>>伪静态模式</option>
					</select> 伪静态模式,因很多虚拟主机不能完美支持,建议熟练者或有独立服务器者使用</td>
				</tr>
				<tr id="static" <?php if (runMode != "static") echo "style=\"display:none\"";?>>
					<td>生成时间间隔：<input type="text" name="makeTimeSpan" size="15" value="<?=makeTimeSpan?>">&nbsp;&nbsp;秒&nbsp;&nbsp;
					  目录选择：
					  <select name="makeMode" onchange="selecMakeMode(this.options[this.selectedIndex].value)" id="makeMode">
					  <option value="dir1" <?php if (makeMode == 'dir1')echo('selected');?>>目录1：/typeEnname/vid/</option>
					  <option value="dir3" <?php if (makeMode == 'dir3')echo('selected');?>>目录3：/typeEnname/date/vid</option>
					  <option value="dir5" <?php if (makeMode == 'dir5')echo('selected');?>>目录5：/typeEnname/vEnName/</option>
					  <option value="dir7" <?php if (makeMode == 'dir7')echo('selected');?>>目录7：/typeEnname/date/vEnName</option>
					  <option value="dir2" <?php if (makeMode == 'dir2')echo('selected');?>>目录2：/[dir]/[page]id</option>
					  <option value="dir4" <?php if (makeMode == 'dir4')echo('selected');?>>目录4：/[dir]/date/[page]id</option>
					  <option value="dir6" <?php if (makeMode == 'dir6')echo('selected');?>>目录6：/[dir]/[page]EnName</option>
					  <option value="dir8" <?php if (makeMode == 'dir8')echo('selected');?>>目录8：/[dir]/date/[page]EnName</option>
					</select>
					&nbsp;&nbsp;md5加密id：开启<input type="radio" name="md5Content" value="1" <?php if (md5Content == 1) echo "checked";?> class="radio"> 关闭<input type="radio" name="md5Content" value="0" <?php if(md5Content == 0) echo "checked";?> class="radio">
					</td>
				</tr>
				<tr><td height="25">文件的后缀名：<select name="fileSuffix" style="width:110px"><option value=".html" <?=checkIsSelected(".html",fileSuffix)?>>.html</option><option value=".php" <?=checkIsSelected(".php",fileSuffix)?>>.php</option><option value=".htm" <?=checkIsSelected(".htm",fileSuffix)?>>.htm</option><option value=".shtml" <?=checkIsSelected(".shtml",fileSuffix)?>>.shtml</option><option value=".shtm" <?=checkIsSelected(".shtm",fileSuffix)?>>.shtm</option></select>&nbsp;&nbsp;URL传参方式：<input type="radio" class="radio" id="paramset1" name="paramset" onclick="hide('urlparamset');view('paramsetbdy');" value="0"<?php if(paramset == 0) echo "checked";?>>1-0-0.html&nbsp;&nbsp;<input type="radio" class="radio" id="paramset2" name="paramset" onclick="hide('paramsetbdy');view('urlparamset')" value="1"<?php if(paramset == 1) echo "checked";?>><span id="paramsetbdy"<?=ifthen(paramset==0,""," style=\"display:none\"")?>><?=paramid?>=1&amp;<?=parampage?>=2&amp;<?=paramindex?>=3</span><span id="urlparamset"<?=ifthen(paramset==1,""," style=\"display:none\"")?>><input type="text" style="height:12px" size="5" name="paramid" onchange="onTxtChange(this)" value="<?=paramid?>">=1&amp;<input type="text" style="height:12px" size="5" name="parampage" onchange="onTxtChange(this)" value="<?=parampage?>">=2&amp;<input type="text" style="height:12px" size="5" name="paramindex" onchange="onTxtChange(this)" value="<?=paramindex?>">=3</span></td></tr>

				<tr id="dynamic" <?php if (runMode != "dynamic") echo "style=\"display:none\"";?>>
					<td> 栏目页目录名：<input type="text" name="channelDirName1" size="15" value="<?=channelDirName1?>"/>&nbsp;&nbsp;内容页目录名：<input type="text" size="15" name="contentDirName1" value="<?=contentDirName1?>"/>&nbsp;&nbsp;播放页目录名：<input type="text" size="15" name="playDirName1" value="<?=playDirName1?>"/></td>
				</tr>
				<tr id="forgedStatic" <?php if (runMode != "forgedStatic") echo "style=\"display:none\"";?>>
					<td> 栏目页目录名：<input type="text" name="channelDirName4" size="15" value="<?=channelDirName4?>"/>&nbsp;&nbsp;内容页目录名：<input type="text" size="15" name="contentDirName4" value="<?=contentDirName4?>"/>&nbsp;&nbsp;播放页目录名：<input type="text" size="15" name="playDirName4" value="<?=playDirName4?>"/>&nbsp;<br/>
					栏目页文件名：<input type="text" name="channelPageName4" value="<?=channelPageName4?>" size="15">&nbsp;&nbsp;内容页文件名：<input type="text" name="contentPageName4" value="<?=contentPageName4?>" size="15">&nbsp;&nbsp;播放页文件名：<input type="text" name="playPageName4" value="<?=playPageName4?>" size="15">
					</td>
				</tr>
				<tr id="dir1" <?php if (!(strpos("#dir1,dir3,dir5,dir7#",makeMode)>0 && runMode == "static")) echo "style=\"display:none\"" ?>>
					<td>
					<span style="display:none;">
					栏目页文件名：<input type="text" size="15" name="channelPageName2" value="index">&nbsp;&nbsp;
					内容页文件名：<input type="text" size="15" name="contentPageName2" value="index">&nbsp;&nbsp;</span>
					播放页文件名：<input type="text" size="15" name="playPageName2" value="<?=playPageName2?>">
					</td>
				</tr>
				<tr id="dir2" <?php if (!(strpos("#dir2,dir4,dir6,dir8#",makeMode)>0 && runMode == "static")) echo "style=\"display:none\"" ?>>
					<td>
					栏目页目录名：<input type="text" name="channelDirName3" value="<?=channelDirName3?>" size="15">&nbsp;&nbsp;内容页目录名：<input type="text" name="contentDirName3" value="<?=contentDirName3?>" size="15">&nbsp;&nbsp;播放页目录名：<input type="text" name="playDirName3" value="<?=playDirName3?>" size="15"/>&nbsp;&nbsp;<br/>
					栏目页文件名：<input type="text" name="channelPageName3" value="<?=channelPageName3?>" size="15">&nbsp;&nbsp;内容页文件名：<input type="text" name="contentPageName3" value="<?=contentPageName3?>" size="15">&nbsp;&nbsp;播放页文件名：<input type="text" name="playPageName3" value="<?=playPageName3?>" size="15"/>
					</td>
				</tr>
				<tr>
					<td id="zt">专题主目录名：<input type="text" size="15" name="topicDirName" value="<?=topicDirName?>">&nbsp;&nbsp;专题页目录名：<input type="text" size="15" name="topicPageDirName" value="<?=topicPageDirName?>"></td>
				</tr>
				<tr id="ismakeplaytr" <?php if (runMode != "static") echo "style=\"display:none\"";?>>
					<td>生成播放网页：<select name="ismakeplay" id="ismakeplay" style="width:100px;" onchange="selectMakeplay(this.options[this.selectedIndex].value)"><option value="0" <?=ifthen(ismakeplay==0,"selected","")?>>动态不生成</option><option value="1" <?=ifthen(ismakeplay==1,"selected","")?>>生成静态</option><option value="3" <?=ifthen(ismakeplay==3,"selected","")?>>生成每集静态</option><option value="2" <?=ifthen(ismakeplay==2,"selected","")?>>生成动态</option></select> 访问量大的站点、建议生成播放页；如选动态可在播放页支持集名称标签{playpage:part}</td>
				</tr>
				<tr>
					<td>
					是否弹窗播放：<input type="radio" name="isAlertWin" onClick="selectAlertWin(this.value)" value="1" <?php if(isAlertWin == 1) echo "checked";?> class="radio">弹窗
						<div id="alertwinset" <?php if (isAlertWin == 0){?>style="display:none"<?php }?>>宽： <input type="text" name="alertWinW" size="5" value="<?=alertWinW?>"> px    &nbsp;&nbsp;高 <input type="text" name="alertWinH" size="5" value="<?=alertWinH?>"/> px</div>
						<input type="radio" name="isAlertWin" onclick="selectAlertWin(this.value)" value="0" <?php if(isAlertWin == 0) echo "checked";?> class="radio">不弹窗  &nbsp;&nbsp;&nbsp;&nbsp;弹窗播放模式,获得更好的播放体验
					</td>
				</tr>
			</tbody>
			<tbody id="news" style="display:none;">
				<tr>
					<td>
					<select name="newsrunMode" id="newsrunMode" onChange="selecNewsRunMode(this.options[this.selectedIndex].value)">
                        <option value="dynamic" <?php if (newsrunMode == "dynamic")echo('selected');?>>动态模式</option>
						<option value="static" <?php if (newsrunMode == "static")echo('selected');?>>静态模式</option>
						<option value="forgedStatic" <?php if(newsrunMode == "forgedStatic")echo('selected');?>>伪静态模式</option>
					</select>  伪静态模式,因很多虚拟主机不能完美支持,建议熟练者或有独立服务器者使用</td>
				</tr>
				<tr id="newsstatic" <?php if (newsrunMode != "static") echo "style=\"display:none\"";?>>
					<td>生成时间间隔：<input type="text" name="newsMakeTimeSpan" size="15" value="<?=newsMakeTimeSpan?>">&nbsp;&nbsp;秒&nbsp;&nbsp;
					  目录选择：
					  <select name="newsMakeMode" onchange="selecnewsMakeMode(this.options[this.selectedIndex].value)" id="newsMakeMode">
					  <option value="dir1" <?php if (newsMakeMode == 'dir1')echo('selected');?>>目录1：/typeEnname/id/</option>
					  <option value="dir3" <?php if (newsMakeMode == 'dir3')echo('selected');?>>目录3：/typeEnname/date/id</option>
					  <option value="dir5" <?php if (newsMakeMode == 'dir5')echo('selected');?>>目录5：/typeEnname/EnName/</option>
					  <option value="dir7" <?php if (newsMakeMode == 'dir7')echo('selected');?>>目录7：/typeEnname/date/EnName</option>
					  <option value="dir2" <?php if (newsMakeMode == 'dir2')echo('selected');?>>目录2：/[dir]/[page]id</option>
					  <option value="dir4" <?php if (newsMakeMode == 'dir4')echo('selected');?>>目录4：/[dir]/date/[page]id</option>
					  <option value="dir6" <?php if (newsMakeMode == 'dir6')echo('selected');?>>目录6：/[dir]/[page]EnName</option>
					  <option value="dir8" <?php if (newsMakeMode == 'dir8')echo('selected');?>>目录8：/[dir]/date/[page]EnName</option>
					</select>
					&nbsp;&nbsp;md5加密id：开启<input type="radio" name="newsmd5Content" value="1" <?php if (newsmd5Content == 1) echo "checked"?> class="radio"> 关闭<input type="radio" name="newsmd5Content" value="0" <?php if (newsmd5Content == 0) echo "checked"?> class="radio">
					</td>
				</tr>
				<tr><td height="25">文件的后缀名：<select name="newsfileSuffix" style="width:110px"><option value=".html" <?=checkIsSelected(".html",fileSuffix)?>>.html</option><option value=".php" <?=checkIsSelected(".php",fileSuffix)?>>.php</option><option value=".htm" <?=checkIsSelected(".htm",fileSuffix)?>>.htm</option><option value=".shtml" <?=checkIsSelected(".shtml",fileSuffix)?>>.shtml</option><option value=".shtm" <?=checkIsSelected(".shtm",fileSuffix)?>>.shtm</option></select>&nbsp;&nbsp;URL传参方式：<input type="radio" class="radio" id="newsparamset1" name="newsparamset" onclick="hide('newsurlparamset');view('newsparamsetbdy');" value="0"<?php if(newsparamset == 0)echo('checked');?>>1-0-0.html&nbsp;&nbsp;<input type="radio" class="radio" id="newsparamset2" name="newsparamset" onclick="hide('newsparamsetbdy');view('newsurlparamset')" value="1"<?php if(newsparamset == 1)echo('checked');?>><span id="newsparamsetbdy"<?=ifthen(newsparamset == 0,""," style=\"display:none\"")?>><?=paramid?>=1&amp;<?=parampage?>=2&amp;<?=paramindex?>=3</span><span id="newsurlparamset"<?=ifthen(newsparamset == 1,""," style=\"display:none\"")?>><input type="text" style="height:12px" size="5" name="newsparamid" onchange="onTxtChange(this)" value="<?=newsparamid?>">=1&amp;<input type="text" style="height:12px" size="5" name="newsparampage" onchange="onTxtChange(this)" value="<?=parampage?>">=2&amp;<input type="text" style="height:12px" size="5" name="newsparamindex" onchange="onTxtChange(this)" value="<?=newsparamindex?>">=3</span></td></tr>

				<tr id="newsdynamic" <?php if (newsrunMode != "dynamic") echo "style=\"display:none\"";?>>
					<td>新闻主目录名：<input type="text" size="15" name="newsDirName1" value="<?=newsDirName1?>"/>&nbsp;&nbsp;栏目页目录名：<input type="text" name="partDirName1" size="15" value="<?=partDirName1?>"/>&nbsp;&nbsp;文章页目录名：<input type="text" size="15" name="articleDirName1" value="<?=articleDirName1?>"/></td>
				</tr>
				<tr id="newsforgedStatic" <?php if(newsrunMode != "forgedStatic") echo "style=\"display:none\"";?>>
					<td>新闻主目录名：<input type="text" size="15" name="newsDirName4" value="<?=newsDirName4?>"/>&nbsp;&nbsp;栏目页目录名：<input type="text" name="partDirName4" size="15" value="<?=partDirName4?>"/>&nbsp;&nbsp;内容页目录名：<input type="text" size="15" name="articleDirName4" value="<?=articleDirName4?>"/><br/>
						新闻页文件名：<input type="text" size="15" name="newsPageName4" value="<?=newsPageName4?>"/>&nbsp;&nbsp;栏目页文件名：<input type="text" name="partPageName4" value="<?=partPageName4?>" size="15">&nbsp;&nbsp;内容页文件名：<input type="text" name="articlePageName4" value="<?=articlePageName4?>" size="15">
					</td>
				</tr>
				<tr id="newsdir1" <?php if (!(strpos("#dir1,dir3,dir5,dir7#",newsMakeMode)>0 && newsrunMode == "static")) echo "style=\"display:none\"" ?>>
					<td>新闻主目录名：<input type="text" size="15" name="newsDirName2" value="<?=newsDirName2?>"/>&nbsp;&nbsp;新闻页文件名：<input type="text" size="15" name="newsPageName2" value="<?=newsPageName2?>"/>
					<span style="display:none;">栏目页文件名：<input type="text" size="15" name="partPageName2" value="index">&nbsp;&nbsp;文章页文件名：<input type="text" size="15" name="articlePageName2" value="index"></span>
					</td>
				</tr>
				<tr id="newsdir2" <?php if (!(strpos("#dir2,dir4,dir6,dir8#",newsMakeMode)>0 && newsrunMode == "static")) echo "style=\"display:none\"" ?>>
					<td>新闻主目录名：<input type="text" size="15" name="newsDirName3" value="<?=newsDirName3?>"/>&nbsp;&nbsp;栏目页目录名：<input type="text" name="partDirName3" value="<?=partDirName3?>" size="15">&nbsp;&nbsp;文章页目录名：<input type="text" name="articleDirName3" value="<?=articleDirName3?>" size="15"><br/>
						新闻页文件名：<input type="text" size="15" name="newsPageName3" value="<?=newsPageName3?>"/>&nbsp;&nbsp;栏目页文件名：<input type="text" name="partPageName3" value="<?=channelPageName3?>" size="15">&nbsp;&nbsp;文章页文件名：<input type="text" name="articlePageName3" value="<?=articlePageName3?>" size="15">
					</td>
				</tr>
			</tbody>
		</table>
	</td>
</tr>
<script type="text/JavaScript">
function toogletab(to){
	if(to!='1'){
		hide('news');view('video');$('li.v').className='hover';$('li.n').className='';
	}else{
		hide('video');view('news');$('li.n').className='hover';$('li.v').className='';
	}
	setCookie('Config_tab',to,365*24);
}
if(getCookie('Config_tab')=='1'){
	toogletab('1');
}
</script>
<tr><td>网站名称：</td><td width="661"><input type="text" name="siteName" size="30" value="<?=siteName?>"> 请尽快修改网站名称</td></tr>
<tr><td>网站地址：</td><td ><input type="text" name="siteUrl" size="30" value="<?=siteUrl?>">
不含http://,如填写:www.djcms.net</td>
</tr>
<tr><td>网站路径：</td><td ><input type="text" name="sitePath" size="30" value="<?=sitePath?>"> 
1.安装在根目录下这里设置为空 2.安装二级目录填写为:二级目录名/</td>
</tr>
<tr class="thead2"><td colspan="2"><a name="rule" /><strong>资源库/采集工具设置<a name="rule" id="rule"></a></strong></td>
</tr>
<tr>
<td >同名数据时：</td>
<td >
 <label for="gatherSet0">智能覆盖</label><input type="radio"  id="gatherSet0" value="0" name="gatherSet" <?php if(gatherSet == 0) echo "checked";?> /> &nbsp;&nbsp;
 <label for="gatherSet1">地址头部追加</label><input type="radio" id="gatherSet1"  value="1" name="gatherSet" <?php if(gatherSet == 1) echo "checked";?> />&nbsp;&nbsp;
 <label for="gatherSet2">地址尾部追加</label><input type="radio" id="gatherSet2"  value="2" name="gatherSet" <?php if(gatherSet == 2) echo "checked";?> />&nbsp;&nbsp;
 <label for="gatherSet3">覆盖地址</label><input type="radio"  value="3" id="gatherSet3"  name="gatherSet" <?php if(gatherSet == 3) echo "checked";?> />&nbsp;&nbsp;
 <label for="gatherSet4">新增数据</label><input type="radio"  value="4" id="gatherSet4"  name="gatherSet" <?php if(gatherSet == 4) echo "checked";?> />&nbsp;&nbsp;
 <label for="gatherSet5">仅更新地址以外的信息</label><input type="radio" id="gatherSet5"  value="5" name="gatherSet" <?php if(gatherSet == 5) echo "checked";?> />
  </td></tr>

<tr class="thead2"><td colspan="2"><strong>模板与路径设置</strong></td></tr>
<tr><td>模板选择：</td>
<td  ><select name="defaultTemplate" style="width:150 ">
<?php
$dh = dir(DJ_ROOT."template/");
while ($dirname = $dh->read()) {
    if (!ereg("\.", $dirname)) {
?>
      <option value='<?=$dirname?>' <?php if($dirname == defaultTemplate)echo('selected');?>><?=$dirname?></option>
<?php
    }
}
?>
</select></td>
</tr>
<tr><td>模板文件所在文件夹：</td><td ><input type="text" name="templateFileFolder" size="15" value="<?=templateFileFolder?>" /> 防止模板被盗</td></tr>

<tr><td>图片文件夹：</td><td width="661" ><input type="text" name="sitePic" size="15" value="<?=sitePic?>"/> 
位于根目录的pic文件夹下</td>
</tr>
<tr><td>JS广告文件夹：</td><td width="661" ><input type="text" name="siteAd" size="15" value="<?=siteAd?>"/>   位于根目录的js文件夹下</td>
</tr>
<tr class="thead2">
<td colspan="2"><strong>插件设置</strong></td></tr>
<tr><td>留言开关：</td><td width="661" style="float:left">开启：
  <input type="radio" name="gbookStart"  value="1" <?php if (gbookStart == 1) echo "checked";?> class="radio" onclick="$('gbookfont').style.display=''"/>关闭：<input type="radio" name="gbookStart"  value="0" <?php if (gbookStart == 0) echo "checked";?> class="radio" onclick="$('gbookfont').style.display='none'"/>
<font <?php if (gbookStart == 0) echo "style=\"display:none\"";?> id="gbookfont">
&nbsp;&nbsp;留言时间间隔<input type="text" name="gbookTime" size="4" value="<?=gbookTime?>"/>秒
&nbsp;&nbsp;留言管理账号<input type="text" name="gbookUser" size="10" value="<?=gbookUser?>"/>
&nbsp;&nbsp;留言密码管理<input type="text" name="gbookPwd" size="10" value="<?=gbookPwd?>"/>
</font>
</td></tr>
<tr><td>评论开关：</td><td width="661">开启：
  <input type="radio" name="commentStart"  value="1" <?php if (commentStart == 1) echo "checked";?> class="radio" onclick="$('commentfont').style.display=''"/>关闭：<input type="radio" name="commentStart"  value="0" <?php if (commentStart == 0) echo "checked";?> class="radio" onclick="$('commentfont').style.display='none'"/><font id="commentfont"  <?php if (commentStart == 0) echo "style=\"display:none\"";?>>&nbsp;&nbsp; 评论时间间隔<input type="text" name="commentTime" size="4" value="<?=commentTime?>"/></font>秒 &nbsp;&nbsp;在数据库负载过重情况下，可以关闭评论功能</td></tr>
  <tr>
  <td >来源排序：</td>
  <td width="661">开启：
  <input type="radio" name="IsFromSort" value="1" <?php if (IsFromSort==1) echo "checked";?> class="radio">关闭：<input type="radio" name="IsFromSort" value="0" <?php if (IsFromSort==0) echo "checked";?> class="radio"> &nbsp;&nbsp;如开启、将对播放来源按设置进行排序；如关闭、将节省部分性能</td></tr>
<tr class="thead2"><td colspan="2"><strong>水印设置</strong></td></tr>
	 <tr>
  <td>文字水印：</td><td width="854" ><table class="tdk"><tr><td>开启：<input type="radio" name="watermark" value="1" onClick="selectWaterMark(this.value)" <?php if (watermark=='1') echo "checked";?>  class="radio" /></td><td id="watermarkfont"  <?php if (watermark=='0') echo "style=\"display:none\"";?>>文字水印位置：<select name="waterlocation" >
  <option value="0" <?php if (waterlocation == '0') echo "selected";?>>随机位置</option>
  <option value="1" <?php if (waterlocation == '1') echo "selected";?>>顶端居左</option>
  <option value="2" <?php if (waterlocation == '2') echo "selected";?>>顶端居中</option>
  <option value="3" <?php if (waterlocation == '3') echo "selected";?>>顶端居右</option>
  <option value="4" <?php if (waterlocation == '4') echo "selected";?>>中部居左</option>
  <option value="5" <?php if (waterlocation == '5') echo "selected";?>>中部居中</option>
  <option value="6" <?php if (waterlocation == '6') echo "selected";?>>中部居右</option>
  <option value="7" <?php if (waterlocation == '7') echo "selected";?>>底端居左</option>
  <option value="8" <?php if (waterlocation == '8') echo "selected";?>>底端居中</option>
  <option value="9" <?php if (waterlocation == '9') echo "selected";?>>底端居右</option>
  </select>&nbsp;水印文字：<input type="text" name="watermarkfont"  value="<?=watermarkfont?>" />&nbsp;文字大小：<input type="text" name="watermarksize"  value="<?=watermarksize?>" size="5" />&nbsp;文字颜色：<select name="watermarkcolor">
			<option style="background-color:<?=watermarkcolor?>;color: <?=watermarkcolor?>" value="<?=watermarkcolor?>"></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></td></td><td>关闭：<input type="radio" <?php if(watermark == '0') echo "checked";?> name="watermark" value="0" onClick="selectWaterMark(this.value)" class="radio" /> &nbsp;&nbsp;需要GD库支持</td></tr>
        </table>
     <tr>
  <td>水印方式：</td><td width="854" ><table class="tdk"><tr><td>图片：<input type="radio" name="marktype" value="img" <?php if (marktype=='img') echo "checked";?>  class="radio" /></td><td>水印图片地址：<input type="text" name="markimg"  value="<?=markimg?>" /></td><td>文字：<input type="radio" <?php if(marktype == 'text') echo "checked";?> name="marktype" value="text" class="radio" />字体库地址：<input type="text" name="fonttype"  value="<?=fonttype?>" /></td></td></tr>
        </table>
</td>
</tr>
<tr class="thead2"><td colspan="2"><strong>缓存设置</strong></td></tr>
	<tr><td>缓存开关：</td><td width="661" ><table class="tdk"><tr><td><input type="radio" name="cacheStart" onClick="selectCache(this.value)" value="1" <?php if (cacheStart == 1) echo "checked";?> class="radio" />开启</td><td id="cacheset"  <?php if (cacheStart == 0) echo "style=\"display:none\"";?>>缓存类型：<select name="cachetype" >
  <option value="file" <?php if (cachetype == 'file') echo "selected";?>>文件缓存</option>
  <option value="sql" <?php if (cachetype == 'sql') echo "selected";?>>SQL 缓存</option>
  <option value="memcached" <?php if (cachetype == 'memcached') echo "selected";?>>memcached</option>
  <option value="eaccelerator" <?php if (cachetype == 'eaccelerator') echo "selected";?>>eaccelerator</option>
  <option value="xcache" <?php if (cachetype == 'xcache') echo "selected";?>>xcache</option>
  <option value="apc" <?php if (cachetype == 'apc') echo "selected";?>>apc</option>
  </select>&nbsp;&nbsp;&nbsp; 缓存过期时间：<input type="text" name="cacheTime" size="5" value="<? echo cacheTime;?>" />分钟&nbsp;&nbsp;&nbsp; 缓存标识<input type="text" name="cacheFlag" size="20"   value="<?="D".date('YmdHis',time())?>"/></td><td><input type="radio" name="cacheStart"  onclick="selectCache(this.value)" value="0" <?php if (cacheStart == 0) echo "checked";?> class="radio" />关闭</td></tr></table>
	  </td></tr>
   <tr><td>数据缓存：</td><td width="661"><table class="tdk"><tr><td>开启：<input type="radio" name="mCache" value="1" <?php if (mCache==1) echo "checked";?> class="radio">关闭：<input type="radio" name="mCache" value="0" <?php if (mCache==0) echo "checked";?> class="radio">&nbsp;&nbsp;访问量过大建议打开，有效减少前台压力</td></tr></table></td></tr>

<tr class="thead2">
  <td colspan="2"><strong>其它设置</strong></td>
</tr>
<tr><td>过滤留言：</td><td><input type="text" name="dirtyWords" size="80" value="<?=dirtyWords?>" />请以英文逗号,分离</td></tr>
<tr><td>禁止留言：</td><td><input type="text" name="BanWords" size="80" value="<?=BanWords?>" />请以英文逗号,分离</td></tr>
<tr><td>禁止IP：</td><td><input type="text" name="banIPS" size="80" value="<?=banIPS?>" />请以英文逗号,分离<br />支持通配符*(例：192.168.1.*)</td></tr>
<tr><td>热门搜索：</td><td><input type="text" name="siteKeyWords" size="80" value="<?=siteKeyWords?>" /></td></tr>
<tr><td>统计代码：</td><td><input type="text" name="siteVisiteJs" size="80" value="<?=siteVisiteJs?>" /></td></tr>
<tr><td>站点描述：</td><td width="661" ><textarea cols="90" rows="3" name="siteDes"><?=siteDes?></textarea></td></tr>
<tr><td   width="79">网站公告：</td>
<td><textarea cols="90" rows="3" name="siteNotice"><?=codeTextarea(siteNotice,"de")?></textarea></td></tr>

<tr><td>网站版权信息</td><td><textarea cols="90" rows="3" name="copyRight"><?=codeTextarea(copyRight,"de")?></textarea></td></tr>
<tr><td></td><td><input type="submit" value="确认更新" class="btn" /></td></tr>
</table>
</form>
<?php
}

function chkPic()
{
	$x=getForm("sitepic","post");
	if (sitePic != $x) {
		$sql = "SELECT m_pic WHERE ".DB::table('data')."  WHERE LEFT(m_pic,7)<>'http://'";
		$row = DB::fetch_first($sql);
		if (is_array($row)) {
			$m_pic = $row['m_pic'];
			$m_pic = replaceStr($row['m_pic'],sitePic,$x);
			DB::update('data', array('m_pic' => $m_pic));
		}
	} 
}

function setforgeStatic() {
	$tmpstr = "";
	$content = loadFile(DJ_ROOT."inc/RewriteRule.config");
	if (getForm("runMode","post") == "forgedStatic") {
		$tmpstr  = $content;
		$tmpstr  = replaceStr($tmpstr,"{channeldirname1}",getForm("channelDirName1","post"));
		$tmpstr  = replaceStr($tmpstr,"{contentdirname1}",getForm("contentDirName1","post"));
		$tmpstr  = replaceStr($tmpstr,"{playdirname1}",getForm("playDirName1","post"));
		$tmpstr  = replaceStr($tmpstr,"{topicdirname}",getForm("topicDirName","post"));
		$tmpstr  = replaceStr($tmpstr,"{topicpagedirname}",getForm("topicPageDirName","post"));
		$tmpstr  = replaceStr($tmpstr,"{channeldirname4}",getForm("channelDirName4","post"));
		$tmpstr  = replaceStr($tmpstr,"{contentdirname4}",getForm("contentDirName4","post"));
		$tmpstr  = replaceStr($tmpstr,"{contentdirname1}",getForm("contentDirName1","post"));
		$tmpstr  = replaceStr($tmpstr,"{partpagename4}",getForm("partPageName4","post"));
		$tmpstr  = replaceStr($tmpstr,"{playdirname4}",getForm("playDirName4","post"));
		$tmpstr  = replaceStr($tmpstr,"{channelpagename4}",getForm("channelPageName4","post"));
		$tmpstr  = replaceStr($tmpstr,"{contentpagename4}",getForm("contentPageName4","post"));
		$tmpstr  = replaceStr($tmpstr,"{playpagename4}",getForm("playPageName4","post"));
		$tmpstr  = replaceStr($tmpstr,"{sitePath}",sitePath);
		$tmpstr  = replaceStr($tmpstr,"{fileSuffix}",getForm("fileSuffix","post"));
    }
    if (getForm("newsrunMode","post") == "forgedStatic") {
		$tmpstr  = replaceStr($tmpstr,"{newsdirname1}",getForm("newsDirName1","post"));
		$tmpstr  = replaceStr($tmpstr,"{partdirname1}",getForm("partDirName1","post"));
		$tmpstr  = replaceStr($tmpstr,"{articledirname1}",getForm("articleDirName1","post"));
		$tmpstr  = replaceStr($tmpstr,"{newsdirname4}",getForm("newsDirName4","post"));
		$tmpstr  = replaceStr($tmpstr,"{newspagename4}",getForm("newsPageName4","post"));
		$tmpstr  = replaceStr($tmpstr,"{partdirname4}",getForm("partDirName4","post"));
		$tmpstr  = replaceStr($tmpstr,"{partpagename4}",getForm("partPageName4","post"));
		$tmpstr  = replaceStr($tmpstr,"{articledirname4}",getForm("articleDirName4","post"));
		$tmpstr  = replaceStr($tmpstr,"{articlepagename4}",getForm("articlePageName4","post"));
		$tmpstr  = replaceStr($tmpstr,"{sitePath}",sitePath);
		$tmpstr  = replaceStr($tmpstr,"{fileSuffix}",getForm("fileSuffix","post"));
    }
	$tmpstr = replaceStr(replaceStr($tmpstr,"{","\{"),"}","\}");
	createTextFile($tmpstr,"../httpd.ini");
}

function editConfig() {
	chkPic();
	setforgeStatic();
	$config = file_get_contents(DJ_ROOT."inc/config.php");
	$config = preg_replace('/"siteName","(.*?)"/','"siteName","'.getForm("siteName","post").'"',$config);
	$config = preg_replace('/"siteUrl","(.*?)"/','"siteUrl","'.getForm("siteUrl","post").'"',$config);
	$config = preg_replace('/"sitePath","(.*?)"/','"sitePath","'.getForm("sitePath","post").'"',$config);
	$config = preg_replace('/"templateFileFolder","(.*?)"/','"templateFileFolder","'.getForm("templateFileFolder","post").'"',$config);
	$config = preg_replace('/"defaultTemplate","(.*?)"/','"defaultTemplate","'.getForm("defaultTemplate","post").'"',$config);
	$config = preg_replace('/"gbookStart","(.*?)"/','"gbookStart","'.getForm("gbookStart","post").'"',$config);
	$config = preg_replace('/"commentStart","(.*?)"/','"commentStart","'.getForm("commentStart","post").'"',$config);
	$config = preg_replace('/"cacheStart","(.*?)"/','"cacheStart","'.getForm("cacheStart","post").'"',$config);
	$config = preg_replace('/"cachetype","(.*?)"/','"cachetype","'.getForm("cachetype","post").'"',$config);
	$config = preg_replace('/"cacheTime","(.*?)"/','"cacheTime","'.getForm("cacheTime","post").'"',$config);
	$config = preg_replace('/"cacheTime","(.*?)"/','"cacheTime","'.getForm("cacheTime","post").'"',$config);
	$config = preg_replace('/"cacheFlag","(.*?)"/','"cacheFlag","'.getForm("cacheFlag","post").'"',$config);
	$config = preg_replace('/"watermark","(.*?)"/','"watermark","'.getForm("watermark","post").'"',$config);
	$config = preg_replace('/"watermarkfont","(.*?)"/','"watermarkfont","'.getForm("watermarkfont","post").'"',$config);
	$config = preg_replace('/"waterlocation","(.*?)"/','"waterlocation","'.getForm("waterlocation","post").'"',$config);
	$config = preg_replace('/"watermarkcolor","(.*?)"/','"watermarkcolor","'.getForm("watermarkcolor","post").'"',$config);
	$config = preg_replace('/"watermarksize","(.*?)"/','"watermarksize","'.getForm("watermarksize","post").'"',$config);
	$config = preg_replace('/"marktype","(.*?)"/','"marktype","'.getForm("marktype","post").'"',$config);
	$config = preg_replace('/"markimg","(.*?)"/','"markimg","'.getForm("markimg","post").'"',$config);
	$config = preg_replace('/"fonttype","(.*?)"/','"fonttype","'.getForm("fonttype","post").'"',$config);
	$config = preg_replace('/"iscache","(.*?)"/','"iscache","'.getForm("iscache","post").'"',$config);
	$config = preg_replace('/"runMode","(.*?)"/','"runMode","'.getForm("runMode","post").'"',$config);
	$config = preg_replace('/"fileSuffix","(.*?)"/','"fileSuffix","'.getForm("fileSuffix","post").'"',$config);
	$config = preg_replace('/"makeMode","(.*?)"/','"makeMode","'.getForm("makeMode","post").'"',$config);
	$config = preg_replace('/"makeTimeSpan","(.*?)"/','"makeTimeSpan","'.getForm("makeTimeSpan","post").'"',$config);
	$config = preg_replace('/"md5Content","(.*?)"/','"md5Content","'.getForm("md5Content","post").'"',$config);
	$config = preg_replace('/"ismakeplay","(.*?)"/','"ismakeplay","'.getForm("ismakeplay","post").'"',$config);
	$config = preg_replace('/"channelDirName1","(.*?)"/','"channelDirName1","'.getForm("channelDirName1","post").'"',$config);
	$config = preg_replace('/"contentDirName1","(.*?)"/','"contentDirName1","'.getForm("contentDirName1","post").'"',$config);
	$config = preg_replace('/"playDirName1","(.*?)"/','"playDirName1","'.getForm("playDirName1","post").'"',$config);
	$config = preg_replace('/"channelPageName2","(.*?)"/','"channelPageName2","'.getForm("channelPageName2","post").'"',$config);
	$config = preg_replace('/"contentPageName2","(.*?)"/','"contentPageName2","'.getForm("contentPageName2","post").'"',$config);
	$config = preg_replace('/"playPageName2","(.*?)"/','"playPageName2","'.getForm("playPageName2","post").'"',$config);
	$config = preg_replace('/"channelDirName3","(.*?)"/','"channelDirName3","'.getForm("channelDirName3","post").'"',$config);
	$config = preg_replace('/"contentDirName3","(.*?)"/','"contentDirName3","'.getForm("contentDirName3","post").'"',$config);
	$config = preg_replace('/"playDirName3","(.*?)"/','"playDirName3","'.getForm("playDirName3","post").'"',$config);
	$config = preg_replace('/"channelPageName3","(.*?)"/','"channelPageName3","'.getForm("channelPageName3","post").'"',$config);
	$config = preg_replace('/"contentPageName3","(.*?)"/','"contentPageName3","'.getForm("contentPageName3","post").'"',$config);
	$config = preg_replace('/"playPageName3","(.*?)"/','"playPageName3","'.getForm("playPageName3","post").'"',$config);
	$config = preg_replace('/"channelPageName4","(.*?)"/','"channelPageName4","'.getForm("channelPageName4","post").'"',$config);
	$config = preg_replace('/"contentPageName4","(.*?)"/','"contentPageName4","'.getForm("contentPageName4","post").'"',$config);
	$config = preg_replace('/"playPageName4","(.*?)"/','"playPageName4","'.getForm("playPageName4","post").'"',$config);
	$config = preg_replace('/"channelDirName4","(.*?)"/','"channelDirName4","'.getForm("channelDirName4","post").'"',$config);
	$config = preg_replace('/"contentDirName4","(.*?)"/','"contentDirName4","'.getForm("contentDirName4","post").'"',$config);
	$config = preg_replace('/"playDirName4","(.*?)"/','"playDirName4","'.getForm("playDirName4","post").'"',$config);
	$config = preg_replace('/"topicDirName","(.*?)"/','"topicDirName","'.getForm("topicDirName","post").'"',$config);
	$config = preg_replace('/"topicPageDirName","(.*?)"/','"topicPageDirName","'.getForm("topicPageDirName","post").'"',$config);
	$config = preg_replace('/"topicDirName4","(.*?)"/','"topicDirName4","'.getForm("topicDirName","post").'"',$config);
	$config = preg_replace('/"topicpageDirName4","(.*?)"/','"topicpageDirName4","'.getForm("topicPageDirName","post").'"',$config);
	$config = preg_replace('/"paramset","(.*?)"/','"paramset","'.getForm("paramset","post").'"',$config);
	$config = preg_replace('/"paramid","(.*?)"/','"paramid","'.getForm("paramid","post").'"',$config);
	$config = preg_replace('/"parampage","(.*?)"/','"parampage","'.getForm("parampage","post").'"',$config);
	$config = preg_replace('/"paramindex","(.*?)"/','"paramindex","'.getForm("paramindex","post").'"',$config);
	$config = preg_replace('/"newsrunMode","(.*?)"/','"newsrunMode","'.getForm("newsrunMode","post").'"',$config);
	$config = preg_replace('/"newsfileSuffix","(.*?)"/','"newsfileSuffix","'.getForm("newsfileSuffix","post").'"',$config);
	$config = preg_replace('/"newsMakeMode","(.*?)"/','"newsMakeMode","'.getForm("newsMakeMode","post").'"',$config);
	$config = preg_replace('/"newsMakeTimeSpan","(.*?)"/','"newsMakeTimeSpan","'.getForm("newsMakeTimeSpan","post").'"',$config);
	$config = preg_replace('/"newsmd5Content","(.*?)"/','"newsmd5Content","'.getForm("newsmd5Content","post").'"',$config);
	$config = preg_replace('/"newsDirName1","(.*?)"/','"newsDirName1","'.getForm("newsDirName1","post").'"',$config);
	$config = preg_replace('/"partDirName1","(.*?)"/','"partDirName1","'.getForm("partDirName1","post").'"',$config);
	$config = preg_replace('/"articleDirName1","(.*?)"/','"articleDirName1","'.getForm("articleDirName1","post").'"',$config);
	$config = preg_replace('/"newsDirName2","(.*?)"/','"newsDirName2","'.getForm("newsDirName2","post").'"',$config);
	$config = preg_replace('/"newsPageName2","(.*?)"/','"newsPageName2","'.getForm("newsPageName2","post").'"',$config);
	$config = preg_replace('/"partPageName2","(.*?)"/','"partPageName2","'.getForm("partPageName2","post").'"',$config);
	$config = preg_replace('/"articlePageName2","(.*?)"/','"articlePageName2","'.getForm("articlePageName2","post").'"',$config);
	$config = preg_replace('/"newsDirName3","(.*?)"/','"newsDirName3","'.getForm("newsDirName3","post").'"',$config);
	$config = preg_replace('/"partDirName3","(.*?)"/','"partDirName3","'.getForm("partDirName3","post").'"',$config);
	$config = preg_replace('/"articleDirName3","(.*?)"/','"articleDirName3","'.getForm("articleDirName3","post").'"',$config);
	$config = preg_replace('/"newsPageName3","(.*?)"/','"newsPageName3","'.getForm("newsPageName3","post").'"',$config);
	$config = preg_replace('/"partPageName3","(.*?)"/','"partPageName3","'.getForm("partPageName3","post").'"',$config);
	$config = preg_replace('/"articlePageName3","(.*?)"/','"articlePageName3","'.getForm("articlePageName3","post").'"',$config);
	$config = preg_replace('/"newsPageName4","(.*?)"/','"newsPageName4","'.getForm("newsPageName4","post").'"',$config);
	$config = preg_replace('/"partPageName4","(.*?)"/','"partPageName4","'.getForm("partPageName4","post").'"',$config);
	$config = preg_replace('/"articlePageName4","(.*?)"/','"articlePageName4","'.getForm("articlePageName4","post").'"',$config);
	$config = preg_replace('/"newsDirName4","(.*?)"/','"newsDirName4","'.getForm("newsDirName4","post").'"',$config);
	$config = preg_replace('/"partDirName4","(.*?)"/','"partDirName4","'.getForm("partDirName4","post").'"',$config);
	$config = preg_replace('/"articleDirName4","(.*?)"/','"articleDirName4","'.getForm("articleDirName4","post").'"',$config);
	$config = preg_replace('/"newsparamset","(.*?)"/','"newsparamset","'.getForm("newsparamset","post").'"',$config);
	$config = preg_replace('/"newsparamid","(.*?)"/','"newsparamid","'.getForm("newsparamid","post").'"',$config);
	$config = preg_replace('/"newsparampage","(.*?)"/','"newsparampage","'.getForm("newsparampage","post").'"',$config);
	$config = preg_replace('/"newsparamindex","(.*?)"/','"newsparamindex","'.getForm("newsparamindex","post").'"',$config);
	$config = preg_replace('/"sitePic","(.*?)"/','"sitePic","'.getForm("sitePic","post").'"',$config);
	$config = preg_replace('/"siteAd","(.*?)"/','"siteAd","'.getForm("siteAd","post").'"',$config);
	$config = preg_replace('/"siteVisiteJs","(.*?)"/','"siteVisiteJs","'.getForm("siteVisiteJs","post").'"',$config);
	$config = preg_replace('/"siteKeyWords","(.*?)"/','"siteKeyWords","'.new_addslashes(getForm("siteKeyWords","post")).'"',$config);
	$config = preg_replace('/"siteNotice","(.*?)"/','"siteNotice","'.new_addslashes(getForm("siteNotice","post")).'"',$config);
	$config = preg_replace('/"siteDes","(.*?)"/','"siteDes","'.getForm("siteDes","post").'"',$config);
	$config = preg_replace('/"gatherSet","(.*?)"/','"gatherSet","'.getForm("gatherSet","post").'"',$config);
	$config = preg_replace('/"isAlertWin","(.*?)"/','"isAlertWin","'.getForm("isAlertWin","post").'"',$config);
	$config = preg_replace('/"alertWinW","(.*?)"/','"alertWinW","'.getForm("alertWinW","post").'"',$config);
	$config = preg_replace('/"alertWinH","(.*?)"/','"alertWinH","'.getForm("alertWinH","post").'"',$config);
	$config = preg_replace('/"isAutoCheck","(.*?)"/','"isAutoCheck","'.getForm("isAutoCheck","post").'"',$config);
	$config = preg_replace('/"commentTime","(.*?)"/','"commentTime","'.getForm("commentTime","post").'"',$config);
	$config = preg_replace('/"gbookTime","(.*?)"/','"gbookTime","'.getForm("gbookTime","post").'"',$config);
	$config = preg_replace('/"gbookUser","(.*?)"/','"gbookUser","'.getForm("gbookUser","post").'"',$config);
	$config = preg_replace('/"gbookPwd","(.*?)"/','"gbookPwd","'.getForm("gbookPwd","post").'"',$config);
	$config = preg_replace('/"dirtyWords","(.*?)"/','"dirtyWords","'.getForm("dirtyWords","post").'"',$config);
	$config = preg_replace('/"BanWords","(.*?)"/','"BanWords","'.getForm("BanWords","post").'"',$config);
	$config = preg_replace('/"IsFromSort","(.*?)"/','"IsFromSort","'.getForm("IsFromSort","post").'"',$config);
	$config = preg_replace('/"banIPS","(.*?)"/','"banIPS","'.getForm("banIPS","post").'"',$config);
	$config = preg_replace('/"copyRight","(.*?)"/','"copyRight","'.new_addslashes(codeTextarea(getForm("copyRight","post"),"en")).'"',$config);
	autoMoveFolder();
	fwrite(fopen(DJ_ROOT."inc/config.php","wb"),$config);
	alertMsg("配置修改成功","admin_config.php"); 
}

function autoMoveFolder(){
	$moveType = getForm("runMode","post");
	$moveType2 = getForm("makeMode","post");
	$dir_topic = getForm("topicDirName","post");$dir_topicpage = getForm("topicPageDirName","post");if (empty($dir_topic)){ alertMsg("专题目录名不能为空","javascript:history.go(-1);");exit();}
	if (topicDirName != $dir_topic) moveFolder("../".topicDirName."/", "../".$dir_topic."/");
	if (topicPageDirName != $dir_topicpage) moveFolder("../".topicPageDirName."/", "../".$dir_topicpage."/");
	switch ($moveType) {
		case "dynamic":
		    $dir_channel = getForm("channelDirName1","post");if (empty($dir_channel)){ alertMsg("栏目页目录名不能为空","javascript:history.go(-1);");exit();}
			$dir_content = getForm("contentDirName1","post");if (empty($dir_content)){ alertMsg("内容页目录名不能为空","javascript:history.go(-1);");exit();}
			$dir_play = getForm("playDirName1","post");if (empty($dir_play)){ alertMsg("播放页目录名不能为空","javascript:history.go(-1);");exit();}
            
			$dir_news = getForm("newsDirName1","post");if (empty($dir_news)){ alertMsg("新闻主目录名不能为空","javascript:history.go(-1);");exit();}
			$dir_part = getForm("partDirName1","post");if (empty($dir_part)){ alertMsg("栏目页目录名不能为空","javascript:history.go(-1);");exit();}
			$dir_article = getForm("articleDirName1","post");if (empty($dir_article)){ alertMsg("文章页目录名不能为空","javascript:history.go(-1);");exit();}
			
            //if (isEqualOther($dir_channel."|".$dir_content."|".$dir_play."|".$dir_topic."|".$dir_topicpage."|".$dir_news."|".$dir_part."|".$dir_article)){alertMsg("视频和新闻目录名不能存在雷同","javascript:history.go(-1);");die("");}
			
			if (channelDirName1 != $dir_channel) moveFolder("../".channelDirName1."/", "../".$dir_channel."/");
			if (contentDirName1 != $dir_content) moveFolder("../".contentDirName1."/", "../".$dir_content."/");
			if (playDirName1 != $dir_play) moveFolder("../".playDirName1."/", "../".$dir_play."/");
            
			if (newsDirName1 != $dir_news) moveFolder("../".newsDirName1."/", "../".$dir_news."/");
			if (partDirName1 != $dir_part) moveFolder("../".partDirName1."/", "../".$dir_part."/");
			if (articleDirName1 != $dir_article) moveFolder("../".articleDirName1."/", "../".$dir_article."/");
			break;
		case "static":
			if (strpos(" dir2,dir4,dir6,dir8,",$moveType2)){
			    global $channelDirName3,$contentDirName3,$playDirName3,$newsDirName3,$partDirName3,$articleDirName3;
			    $dir_channel = getForm("channelDirName3","post");if (empty($dir_channel)){ alertMsg("栏目页目录名不能为空","javascript:history.go(-1);");exit();}
			    $dir_content = getForm("contentDirName3","post");if (empty($dir_content)){ alertMsg("内容页目录名不能为空","javascript:history.go(-1);");exit();}
			    $dir_play = getForm("playDirName3","post");if (empty($dir_play)){ alertMsg("播放页目录名不能为空","javascript:history.go(-1);");exit();}

                $dir_news = getForm("newsDirName3","post");if (empty($dir_news)){ alertMsg("新闻主目录名不能为空","javascript:history.go(-1);");exit();}
			    $dir_part = getForm("partDirName3","post");if (empty($dir_part)){ alertMsg("栏目页目录名不能为空","javascript:history.go(-1);");exit();}
			    $dir_article = getForm("articleDirName3","post");if (empty($dir_article)){ alertMsg("文章页目录名不能为空","javascript:history.go(-1);");exit();}
                
				//if (isEqualOther($dir_channel."|".$dir_content."|".$dir_play."|".$dir_topic."|".$dir_topicpage."|".$dir_news."|".$dir_part."|".$dir_article)){alertMsg("视频和新闻目录名不能存在雷同","javascript:history.go(-1);");die("");}
			}
		break;
	}
	$x = getForm("templateFileFolder","post");$y = getForm("sitePic","post");$z = getForm("siteAd","post");
	if (empty($x)){ alertMsg("模板文件所在文件夹不能为空","javascript:history.go(-1);");exit();}
	if (empty($y)){ alertMsg("图片文件夹不能为空","javascript:history.go(-1);");exit();}
	if (empty($z)){ alertMsg("JS广告文件夹不能为空","javascript:history.go(-1);");exit();}
	
	if (templateFileFolder != $x) moveFolder("../template/".defaultTemplate."/".templateFileFolder."/", "../template/".defaultTemplate."/".$x."/");
	if (sitePic != $y) moveFolder("../pic/".sitePic."/", "../pic/".$y."/");
	if (siteAd != $z) moveFolder("../js/".siteAd."/", "../js/".$z."/");
}

function checkIsSelected($str1,$str2){
	if ($str1 == $str2) echo "selected"; else echo "";
}

function isEqualOther($str)
{
	$strArray=explode("|",$str);
	$isEqualOther=false;
	foreach($strArray as $v)
	{
		$temarray=explode($v."|","|".$str."|");
		if (count($temarray)>2){
			$isEqualOther=true;
			return $isEqualOther;
		}
	}
	return $isEqualOther;
}
?>
