<?
$C_126cmsadmin_tname = 'center_config';

include(dirname(__FILE__)."/global.php");


$filename="../../data/config.php"; //核心设置文件

$article_auto_config_filename="../../data/article_auto_config.php"; //文章自动更新设置文件


@$job = $submitted_vars["job"];

if($job == "modify"){
  
  include( $filename );//取得 数组 $webdb
  
  $_webdbs = $_POST['webdbs'];
  
  $webdbs = array_merge($webdb, $_webdbs);//合并数据有相同的后面替换前面
  
  $writefile="<?php	\r\n";
  $i = 0;
  foreach($webdbs AS $key=>$value){
  $i++;
  $value=addslashes($value);
  $writefile.="\$webdb['$key']='$value';\r\n";
  }
 
  $query    =   updatetofile("$filename","$writefile");
	  
  if ($query)
     {
       $showmsg = "核心设置修改成功！";
	   $formurl = "configIndex.php";
     }
  else
     {
       $showmsg = "核心设置修改失败！";
	   $formurl = "configIndex.php";
     }
  
  
  	
	//记录文章总的自动更新数
	$e = file ($article_auto_config_filename);
	$article_auto = unserialize($e['0']);
	
	$article_auto['autoAllNum'] = $webdbs['autoAllNum'];
	
	$_article_auto=serialize($article_auto);
	
	$query    =   updatetofile("$article_auto_config_filename","$_article_auto");


	 
  include('showmsg.php');
  exit;

  
}

//从数据库中读出 产品的内容
require("$filename");

  foreach($webdb AS $key=>$value){
  $value=stripslashes($value);
  $webdbs[$key]=$value;
  }
  

?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>后台管理</title>
<link href="css.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
a:link {
	text-decoration: none;
	color: #000000;
}
a:visited {
	text-decoration: none;
	color: #000000;
}
a:hover {
	text-decoration: underline;
	color: #FF0000;
}
a:active {
	text-decoration: none;
	color: #000000;
}
-->
</style>

<SCRIPT LANGUAGE="JavaScript">
<!--
function get_obj(obj){
   return document.getElementById(obj);
}
//-->
</SCRIPT>

</head>

<body>
<div align="center" class="font12">
  <table width="100%"  border="0" cellpadding="3" cellspacing="1" bgcolor="#A4B6D7">
    <tr>
      <td width="100%" height="22" align="center" background="images/titlebg.jpg">&nbsp;</td>
    </tr>
  </table>
  <br />
  <table width="100%" height="25" border="0" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
    <tr>
      <td align="left" bgcolor="#FFFFFF"> [<a href="config.php" class="a_bt">网站核心设置</a>] [<a href="configIndex.php" class="a_bt">首页设置</a>]      </td>
    </tr>
  </table>
  <br />
  <br />
  <table width="100%" border="0" cellpadding="0" cellspacing="0" class="table">
    <tr>
      <td height="22" align="left" class="head">网站首页设置</td>
    </tr>
    <tr>
      <td height="24" align="left">
	  <form id="form1" name="form1" method="post" action="">
	  <table width="99%" border="0" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC" class="table2">
        <tr>
          <td width="34%" height="36" bgcolor="#FFFFFF">静态文件名</td>
          <td width="66%" bgcolor="#FFFFFF"><input name="webdbs[homeHtmlName]" id="webdbs[homeHtmlName]" value="<?=$webdbs['homeHtmlName']?>" size="20" />
(注:一般情况是<span class="red">index.htm</span>,你也可以改成<span class="red">index.html</span>) </td>
        </tr>
        <tr>
          <td height="80" bgcolor="#FFFFFF">模板(一般留空)</td>
          <td bgcolor="#FFFFFF">网页头部: 
              <input type="text" name="webdbs[tpl_homeHead]" value="<?=$webdbs['tpl_homeHead']?>" id="tpl_homeHead" size="40">
              <select onChange='get_obj("tpl_homeHead").value=this.options[this.selectedIndex].value;' name='' ><option value='' style='color:red;'>请选择模板</option>  <option value='tpl/default/none.htm' >头部白板</option> </select><br>
              网页底部: 
              <input type="text" name="webdbs[tpl_homeFoot]" value="<?=$webdbs['tpl_homeFoot']?>" id="tpl_homeFoot" size="40">
              <select onChange='get_obj("tpl_homeFoot").value=this.options[this.selectedIndex].value;' name='' ><option value='' style='color:red;'>请选择模板</option>  <option value='tpl/default/none.htm' >底部白板</option> </select><br>
              网页中间: 
              <input type="text" name="webdbs[tpl_homeMain]" value="<?=$webdbs['tpl_homeMain']?>" id="tpl_homeMain" size="40">
              <select onChange='get_obj("tpl_homeMain").value=this.options[this.selectedIndex].value;' name='' ><option value='' style='color:red;'>请选择模板</option>  <option value='tpl/default/index.htm' >主页(左宽右窄)</option> </select></td>
        </tr>
        <!--<tr>
          <td height="28" bgcolor="#FFFFFF">网站首页专用风格</td>
          <td bgcolor="#FFFFFF"><select name="webdbs[index_style]" id="webdbs[index_style]">
            <option value="" selected="selected">选择风格</option>
            <option value="default">官方风格</option>
          </select>
如果不选择,将依照上面的风格为标准</td>
        </tr>//-->
        <!--<tr>
          <td height="28" bgcolor="#FFFFFF">文章伪原创功能</td>
          <td bgcolor="#FFFFFF"><input type="radio" name="webdbs[NewsWYC]" value="1" <? if($webdbs['NewsWYC'] == 1) echo 'checked';?> />
开启
  <input name="webdbs[NewsWYC]" type="radio" value="0" <? if($webdbs['NewsWYC'] == 0) echo 'checked';?> />
关闭</td>
        </tr>
        <tr>
          <td height="28" bgcolor="#FFFFFF">关键词站群功能</td>
          <td bgcolor="#FFFFFF"><input type="radio" name="webdbs[KeyZQ]" value="1" <? if($webdbs['KeyZQ'] == 1) echo 'checked';?> />
开启
  <input name="webdbs[KeyZQ]" type="radio" value="0" <? if($webdbs['KeyZQ'] == 0) echo 'checked';?> />
关闭</td>
        </tr>
		<tr>
          <td height="28" bgcolor="#FFFFFF">英文翻译功能</td>
          <td bgcolor="#FFFFFF"><input type="radio" name="webdbs[NewsFY]" value="1" <? if($webdbs['NewsFY'] == 1) echo 'checked';?> />
开启
  <input name="webdbs[NewsFY]" type="radio" value="0" <? if($webdbs['NewsFY'] == 0) echo 'checked';?> />
关闭</td>
        </tr>
		<tr>
          <td height="28" bgcolor="#FFFFFF">文章关键字提取功能</td>
          <td bgcolor="#FFFFFF"><input type="radio" name="webdbs[NewsKey]" value="1" <? if($webdbs['NewsKey'] == 1) echo 'checked';?> />
开启
  <input name="webdbs[NewsKey]" type="radio" value="0" <? if($webdbs['NewsKey'] == 0) echo 'checked';?> />
关闭</td>
        </tr>
		<tr>
          <td height="28" bgcolor="#FFFFFF">设置文章每日自动更新数</td>
          <td bgcolor="#FFFFFF"><input name="webdbs[autoAllNum]" id="webdbs[autoAllNum]" value="<?=$webdbs['autoAllNum']?>" size="10" /></td>
        </tr>
		//-->
        <tr>
          <td height="28" bgcolor="#FFFFFF">&nbsp;</td>
          <td bgcolor="#FFFFFF"><input type="submit" value="提交" name="Submit" />
            <input name="job" type="hidden" id="job" value="modify" />            </td>
        </tr>
      </table>
        </form>
      </td>
    </tr>
  </table>
</div>
</body>
</html>
