<?
$C_126cmsadmin_tname = 'sort_config';

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


include("../../include/pinyin.php");

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

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

if($job == "lower"){

	$fid = $_GET['id'];
	$sort_db = lower_sort_name($fid);
	//print_r($sort_db);exit;
	
}elseif($job == "modifylist"){

	$fiddb = $submitted_vars['fiddb'];
	
	for( $i = 0 ; $i < count($fiddb) ; $i++ ){
		$fid = $fiddb[$i];
		$sql="select * from `w6_sort` where `id` = $fid";
		$result=mysql_query($sql);
		$sort_db[]=mysql_fetch_array($result);
	}
		//print_r($sort_db);exit;
}elseif($job == "ReturnTo"){

	$allfid = $submitted_vars['allfid'];
	$fiddb = explode(',',$allfid);
	
	for( $i = 0 ; $i < count($fiddb) ; $i++ ){
		$fid = $fiddb[$i];
		$sql="select * from `w6_sort` where `id` = $fid";
		$result=mysql_query($sql);
		$sort_db[]=mysql_fetch_array($result);
	}
		//print_r($sort_db);exit;
}


if($job == "modify"){

	$fiddb = $_POST['fiddb'];
	$postdb = $_POST['postdb'];
	$ifchang = $_POST['ifchang'];
	
	if( !$ifchang ){
		$allfid= implode( ',' , $fiddb );
		$showmsg = "请选择要修改哪个属性！";
		$formurl = "sort_modify_batch.php?job=ReturnTo&allfid=$allfid";
		include('showmsg.php');
		exit;
	}
	
	if( $ifchang['fsort'] == 1 ){
		$class = GetClass($postdb['parentId'],'w6_sort');////计算当前分类为几级分类
		$str_sql[] = "`class`='".$class."'";
	}
	if( $ifchang['fmid'] == 1 ){
		$str_sql[] = "`mid`='".$postdb['mid']."'";
	}
	if( $ifchang['fps'] == 1 ){
		$str_sql[] = "`passwd`='".$postdb['passwd']."'";
	}
	if( $ifchang['fcl'] == 1 ){
		$str_sql[] = "`color`='".$postdb['color']."'";
	}
	if( $ifchang['fhide'] == 1 ){
		$str_sql[] = "`hide`='".$postdb['hide']."'";
	}
	if( $ifchang['flist'] == 1 ){
		$str_sql[] = "`list`='".$postdb['list']."'";
	}
	if( $ifchang['fmaxperpage'] == 1 ){
		$str_sql[] = "`maxperpage`='".$postdb['maxperpage']."'";
	}
	if( $ifchang['ftype'] == 1 ){
		$str_sql[] = "`type`='".$postdb['type']."'";
	}
	if( $ifchang['fSpecialSql'] == 1 ){
		$str_sql[] = "`SpecialSql`='".$postdb['SpecialSql']."'";
	}
	if( $ifchang['ftpllist'] == 1 ){
		$str_sql[] = "`tpl_head`='".$postdb['tpl_head']."' , `tpl_foot`='".$postdb['tpl_foot']."' , `tpl_list`='".$postdb['tpl_list']."'";
	}
	if( $ifchang['ftplshow'] == 1 ){
		$str_sql[] = "`tpl_show_head`='".$postdb['tpl_show_head']."' , `tpl_show_foot`='".$postdb['tpl_show_foot']."' , `tpl_list`='".$postdb['tpl_show']."' , `tpl_adv_set`='".$postdb['tpl_adv_set']."' , `tpl_adv_swap`='".$postdb['tpl_adv_swap']."' , `tpl_adv_swap2`='".$postdb['tpl_adv_swap2']."' , `tpl_adv_css`='".$postdb['tpl_adv_css']."' , `tpl_adv_css2`='".$postdb['tpl_adv_css2']."'";
	}
	if( $ifchang['flogo'] == 1 ){
		$str_sql[] = "`logo`='".$postdb['logo']."'";
	}
	if( $ifchang['ftk'] == 1 ){
		$str_sql[] = "`titlekeywords`='".$postdb['titlekeywords']."'";
	}
	if( $ifchang['fmk'] == 1 ){
		$str_sql[] = "`metakeywords`='".$postdb['metakeywords']."'";
	}
	if( $ifchang['fmd'] == 1 ){
		$str_sql[] = "`metadescription`='".$postdb['metadescription']."'";
	}
	if( $ifchang['fhd'] == 1 ){
		$str_sql[] = "`htmldescription`='".$postdb['htmldescription']."'";
	}
	if( $ifchang['fbz'] == 1 ){
		$str_sql[] = "`s_bz_1`='".$postdb['s_bz_1']."' , `s_bz_2`='".$postdb['s_bz_2']."' , `s_bz_3`='".$postdb['s_bz_3']."' , `s_bz_4`='".$postdb['s_bz_4']."' , `s_bz_5`='".$postdb['s_bz_5']."' , `s_bz_1_sm`='".$postdb['s_bz_1_sm']."' , `s_bz_2_sm`='".$postdb['s_bz_2_sm']."' , `s_bz_3_sm`='".$postdb['s_bz_3_sm']."' , `s_bz_4_sm`='".$postdb['s_bz_4_sm']."' , `s_bz_5_sm`='".$postdb['s_bz_5_sm']."'";
	}

	if( $ifchang['fauto'] == 1 ){
		//开始修改文章自动更新设置
		$e = file ($article_auto_config_filename);
		$article_auto = unserialize($e['0']);

		for( $s=0;$s<count($fiddb);$s++ ){
			$article_auto[$fiddb[$s]]['article_auto_config'] = $postdb['article_auto_config'];
			$article_auto[$fiddb[$s]]['article_auto_num'] = $postdb['article_auto_num'];
		}
			
		$_article_auto=serialize($article_auto);
		$query    =   updatetofile("$article_auto_config_filename","$_article_auto");
		
			if( count( $ifchang ) == 1 ){
				$showmsg = "栏目批量修改成功！";
				$formurl = "sort.php";
				include('showmsg.php');
				exit;
			}
		
	}
	
	
	$count_fiddb = count($fiddb);
	for( $s=0;$s<$count_fiddb;$s++ ){
		$str_fid .= '`id` ='. $fiddb[$s];
		if( $s < ($count_fiddb-1) )$str_fid .= ' || ';
	}
	
	$str_sql = implode( ' , ' , $str_sql );

  $query = "UPDATE `w6_sort` SET ". $str_sql ." WHERE ".$str_fid;
  
  $result = mysql_query($query) or die(mysql_error());
  if ($result)
     {
       $showmsg = "栏目批量修改成功！";
	   $formurl = "sort.php";
     }
  else
     {
       $showmsg = "栏目批量修改失败！";
	   $formurl = "sort.php";
     }
  include('showmsg.php');
  exit;

/*
  $postdb = $_POST['postdb'];
  
  //计算当前分类为几级分类
  $class = GetClass($postdb['parentId'],'w6_sort');
  
  //exit($class);
  
  $query="UPDATE `w6_sort` 
          SET `mid`='".$postdb['mid']."' , `name`='".$postdb['name']."' , `parentId`='".$postdb['parentId']."' , `class`='".$class."' , `type`='".$postdb['type']."' , `SpecialSql`='".addslashes($postdb['SpecialSql'])."' , `tpl_head`='".$postdb['tpl_head']."' , `tpl_foot`='".$postdb['tpl_foot']."' , `tpl_list`='".$postdb['tpl_list']."'  , `tpl_show_head`='".$postdb['tpl_show_head']."'  , `tpl_show_foot`='".$postdb['tpl_show_foot']."'  , `tpl_show`='".$postdb['tpl_show']."'  , `tpl_adv_set`='".$postdb['tpl_adv_set']."' , `tpl_adv_swap`='".$postdb['tpl_adv_swap']."' , `tpl_adv_swap2`='".$postdb['tpl_adv_swap2']."' , `tpl_adv_css`='".$postdb['tpl_adv_css']."' , `tpl_adv_css2`='".$postdb['tpl_adv_css2']."' , `list_html`='".$postdb['list_html']."' , `spe_htmlname_set`='".$postdb['spe_htmlname_set']."' , `spe_htmlname`='".$postdb['spe_htmlname']."' , `passwd`='".$postdb['passwd']."' , `color`='".$postdb['color']."' , `hide`='".$postdb['hide']."' , `maxperpage`='".$postdb['maxperpage']."' , `list`='".$postdb['list']."' , `logo`='".$postdb['logo']."' , `titlekeywords`='".$postdb['titlekeywords']."' , `metakeywords`='".$postdb['metakeywords']."' , `metadescription`='".$postdb['metadescription']."' , `htmldescription`='".$postdb['htmldescription']."' , `s_bz_1`='".$postdb['s_bz_1']."' , `s_bz_2`='".$postdb['s_bz_2']."' , `s_bz_3`='".$postdb['s_bz_3']."' , `s_bz_4`='".$postdb['s_bz_4']."' , `s_bz_5`='".$postdb['s_bz_5']."' , `s_bz_1_sm`='".$postdb['s_bz_1_sm']."' , `s_bz_2_sm`='".$postdb['s_bz_2_sm']."' , `s_bz_3_sm`='".$postdb['s_bz_3_sm']."' , `s_bz_4_sm`='".$postdb['s_bz_4_sm']."' , `s_bz_5_sm`='".$postdb['s_bz_5_sm']."'
		  WHERE `id`=".$postdb['id']; 
		  
  $result = mysql_query($query) or die(mysql_error());
  if ($result)
     {
       $showmsg = "栏目修改成功！";
	   $formurl = "sort_modify.php?id=".$postdb['id'];
     }
  else
     {
       $showmsg = "栏目修改失败！";
	   $formurl = "sort_modify.php?id=".$postdb['id'];
     }
	 
	//开始修改文章自动更新设置
	
	$e = file ($article_auto_config_filename);
	$article_auto = unserialize($e['0']);
	
	$article_auto[$postdb['id']]['article_auto_config'] = $postdb['article_auto_config'];
	$article_auto[$postdb['id']]['article_auto_num'] = $postdb['article_auto_num'];
	
	$_article_auto=serialize($article_auto);
	
	$query    =   updatetofile("$article_auto_config_filename","$_article_auto");
	 
  include('showmsg.php');
  exit;
  
  
  */
}



?><!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 type="text/javascript" src="<?=$webdb[www_url]?>/126cmsjs/jquery-1.4.4.min.js"></script>
<script type="text/javascript" src="<?=$webdb[www_url]?>/webeditor/xheditor/xheditor-1.1.13-zh-cn.min.js"></script>
<script type="text/javascript">
$(pageInit);
function pageInit()
{
	$.extend(xheditor.settings,{shortcuts:{'ctrl+enter':submitForm}});
	$('#htmldescription').xheditor({upImgUrl:"<?=$webdb[www_url]?>/webeditor/xheditor/upload.php?immediate=1",upImgExt:"jpg,jpeg,gif,png"});
}
function insertUpload(arrMsg)
{
	var i,msg;
	for(i=0;i<arrMsg.length;i++)
	{
		msg=arrMsg[i];
		$("#uploadList").append('<option value="'+msg.id+'">'+msg.localname+'</option>');
	}
}
function submitForm(){$('#rgfrm').submit();}
</script>

<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="sort.php" class="a_bt">栏目管理</a>] 
      [<a 
      href="sort_add.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="form" method="post" action="">
	  <table width="99%" border="0" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC" class="table2">
         <tr>
          <td height="28" colspan="3" bgcolor="#FFFFFF">
          <input type="checkbox" name="showmore" value="checkbox" id="showmore" onClick="show_more(0);" checked>
        <font color="#FF0000">以下每个项目有一个多选框,如选中,则修改其属性,如不选中,则不做修改</font>       </td>
          </tr>
        <tr>
          <td width="21%" height="30" colspan="2" bgcolor="#FFFFFF">当前栏目</td>
          <td width="79%" bgcolor="#FFFFFF">
          
<?
foreach($sort_db AS $key=>$rs){
	echo '<input type="hidden" name="fiddb[]" value="'.$rs['id'].'">'.$rs['name'].' , ';
}
?>          </td>
        </tr>
       
        <tr>
          <td height="28" bgcolor="#FFFFFF">修改后属于哪个分类</td>
          <td bgcolor="#FFFFFF"><input type="checkbox" name="ifchang[fsort]" value="1" id="ifchang[fsort]"></td>
          <td bgcolor="#FFFFFF"><select name="postdb[parentId]" id="postdb[parentId]">
              <option value="0">根分类</option>
              <?
		  formListSort("w6_sort",$postdb['parentId'] ,1);
		  ?>
          </select></td>
        </tr>
        <tr>
          <td height="28" bgcolor="#FFFFFF">本栏目归属于哪个模型</td>
          <td height="28" bgcolor="#FFFFFF"><input type="checkbox" name="ifchang[fmid]" value="1" id="ifchang[fmid]" /></td>
          <td bgcolor="#FFFFFF"><select name='postdb[mid]' >
              <?
		  $sql="select * from `w6_module`";
          $result=mysql_query($sql);
          while($row=mysql_fetch_array($result)){
		  
		  echo "<option value='".$row['module_id']."'";
		  if( $postdb['mid'] == $row['module_id'] ) echo " selected='selected'";
		  echo ">".$row['module_name']."</option>
		  ";
		  
		  }
		  
		  ?>
            </select>          </td>
        </tr>
        <tr class="hidetr">
          <td height="28" bgcolor="#FFFFFF">栏目密码(可以设置栏目访问密码)</td>
          <td height="28" bgcolor="#FFFFFF"><input type="checkbox" name="ifchang[fps]" value="1" id="ifchang[fps]" /></td>
          <td bgcolor="#FFFFFF"><input name="postdb[passwd]" value="<?=$postdb['passwd']?>" /></td>
        </tr>
        <tr class="hidetr">
          <td height="28" bgcolor="#FFFFFF">字体颜色<SCRIPT>
function foreColor_font(obj)
{
  var arr = showModalDialog('images/selcolor.htm', '', 'dialogWidth:18.5em; dialogHeight:17.5em; status:0');
  if (arr != null) { obj.value=arr;obj.style.color=arr;}
  else  obj.focus();
  
}
</SCRIPT></td>
          <td height="28" bgcolor="#FFFFFF"><input type="checkbox" name="ifchang[fcl]" value="1" id="ifchang[fcl]" /></td>
          <td bgcolor="#FFFFFF"><input style="color:<? if($postdb['color']) echo $postdb['color'];?>;" name="postdb[color]" onclick="foreColor_font(this);" value="<?=$postdb['color']?>" /></td>
        </tr>
        <tr class="hidetr">
          <td height="28" bgcolor="#FFFFFF">隐藏/显示</td>
          <td height="28" bgcolor="#FFFFFF"><input type="checkbox" name="ifchang[fhide]" value="1" id="ifchang[fhide]" /></td>
          <td bgcolor="#FFFFFF"><input type="radio" value="0" name="postdb[hide]" <? if($postdb['hide'] == '0'){ echo 'checked="checked"';}?>/>
显示
  <input type="radio" value="1" name="postdb[hide]" <? if($postdb['hide'] == '1'){ echo 'checked="checked"';}?>/>
隐藏</td>
        </tr>
        <tr class="hidetr">
          <td height="28" bgcolor="#FFFFFF">排序值</td>
          <td height="28" bgcolor="#FFFFFF"><input type="checkbox" name="ifchang[flist]" value="1" id="ifchang[flist]" /></td>
          <td bgcolor="#FFFFFF"><input name="postdb[list]" value="<?=$postdb['list']?>" size="5" maxlength="4" />
(数字) </td>
        </tr>
        <tr>
          <td height="28" bgcolor="#FFFFFF">列表页每页显示多少条内容:</td>
          <td height="28" bgcolor="#FFFFFF"><input type="checkbox" name="ifchang[fmaxperpage]" value="1" id="ifchang[fmaxperpage]" /></td>
          <td bgcolor="#FFFFFF"><input size="5" value="<?=$postdb['maxperpage']?>" name="postdb[maxperpage]" />
条 (留空则以默认为标准)</td>
        </tr>
        <tr class="hidetr">
          <td height="28" bgcolor="#FFFFFF">设置为大分类/小栏目/单篇文章</td>
          <td height="28" bgcolor="#FFFFFF"><input type="checkbox" name="ifchang[ftype]" value="1" id="ifchang[ftype]" /></td>
          <td bgcolor="#FFFFFF"><input type="radio" name="postdb[type]" value="1" <? if($postdb['type'] == '1'){ echo 'checked="checked"';}?> onclick="SpecialSet('0')">
        大分类(不可发内容) 
        <input type="radio" name="postdb[type]" value="0" <? if($postdb['type'] == '0'){ echo 'checked="checked"';}?> onclick="SpecialSet('0')">
        小栏目
        <input type="radio" name="postdb[type]" value="3" <? if($postdb['type'] == '3'){ echo 'checked="checked"';}?> onclick="SpecialSet('1')">
        专题
        <input type="radio" name="postdb[type]" value="2" <? if($postdb['type'] == '2'){ echo 'checked="checked"';}?> onclick="SpecialSet('0')">
        单篇文章(一个栏目即一篇文章，适合于作公司联系方式，公司介绍等)</td>
        </tr>
        <tr  id="SpecialSql_div">
          <td height="28" bgcolor="#FFFFFF">专题栏目sql语句:</td>
          <td height="28" bgcolor="#FFFFFF"><input type="checkbox" name="ifchang[fSpecialSql]" value="1" id="ifchang[fSpecialSql]" /></td>
          <td bgcolor="#FFFFFF"><textarea name="postdb[SpecialSql]" cols="84" rows="5"><?=$postdb['SpecialSql']?></textarea>
            <br />
            当选择专题时在此输入sql语句，sql1与sql2之前用 [||] 隔开，如：<br />
            SELECT * FROM `w6_module_content_45` WHERE `shows` = '1' AND (`title` LIKE '%$fname%' || `fl_keywords` LIKE '%$fname%')[||]SELECT * FROM `w6_module_content_45` WHERE 1 AND (`title` LIKE '%$fname%' || `fl_keywords` LIKE '%$fname%') AND `shows` = '1' ORDER BY `count` DESC  LIMIT {=star_page=} , $article_page_size;<br />
            sql1 用于取得数据总数，sql2 用于取得具体数据
			
			<SCRIPT LANGUAGE="JavaScript">
<!--
function SpecialSet(t){
	if(t=='0'||t==''){
		document.getElementById("SpecialSql_div").style.display='none';
	}
	else{
		document.getElementById("SpecialSql_div").style.display='';
		v=document.getElementById("postdb[SpecialSql]").value;
		if(v==''||v=='0'){
			document.getElementById("postdb[SpecialSql]").value='SELECT * FROM `w6_module_content_45` WHERE `shows` = \'1\' AND (`title` LIKE \'%$fname%\' || `news_keywords` LIKE \'%$fname%\')[||]SELECT * FROM `w6_module_content_45` WHERE 1 AND (`title` LIKE \'%$fname%\' || `news_keywords` LIKE \'%$fname%\') AND `shows` = \'1\' ORDER BY `count` DESC  LIMIT {=star_page=} , $article_page_size;';
		}
	}
}
SpecialSet('<? if($postdb['type']=='3') echo '1'; else echo '';?>');
//-->
</SCRIPT>

			{=star_page=} 为搜索数据库开始记录数 </td>
        </tr>
        <tr>
          <td height="13" bgcolor="#FFFFFF">栏目模板:<br />
            (一般留空,即以默认为标准) </td>
          <td height="13" bgcolor="#FFFFFF"><input type="checkbox" name="ifchang[ftpllist]" value="1" id="ifchang[ftpllist]" /></td>
          <td bgcolor="#FFFFFF"> 头部模板: 
              <input type="text" name="postdb[tpl_head]" value="<?=$postdb['tpl_head']?>" id="tpl_head" size="40">
              <select onChange='get_obj("tpl_head").value=this.options[this.selectedIndex].value;' name='' ><option value='' style='color:red;'>请选择模板</option>  <option value='tpl/126cms/none.htm' >头部白板</option> </select><br>
              底部模板: 
              <input type="text" name="postdb[tpl_foot]" value="<?=$postdb['tpl_foot']?>" id="tpl_foot" size="40">
              <select onChange='get_obj("tpl_foot").value=this.options[this.selectedIndex].value;' name='' ><option value='' style='color:red;'>请选择模板</option>  <option value='tpl/126cms/none.htm' >底部白板</option> </select><br>
              列表模板: 
              <input type="text" name="postdb[tpl_list]" value="<?=$postdb['tpl_list']?>" id="tpl_list" size="40">
              <select onChange='get_obj("tpl_list").value=this.options[this.selectedIndex].value;' name='' ><option value='' style='color:red;'>请选择模板</option>  <option value='tpl/126cms/list.htm' >文章列表页(左宽右窄)</option> </select><!--[<A HREF='#' onclick="window.open('#','','width=650,height=500')" style='color:blue;'>上传一个新模板</A>]//--></td>
        </tr>
        <tr>
          <td height="14" bgcolor="#FFFFFF">内容页模板<br />
            (一般留空,即以默认为标准)</td>
          <td height="14" bgcolor="#FFFFFF"><input type="checkbox" name="ifchang[ftplshow]" value="1" id="ifchang[ftplshow]" /></td>
          <td bgcolor="#FFFFFF">头部模板: 
              <input type="text" name="postdb[tpl_show_head]" value="<?=$postdb['tpl_show_head']?>" id="tpl_show_head" size="40">
              <select onChange='get_obj("tpl_show_head").value=this.options[this.selectedIndex].value;' name='' ><option value='' style='color:red;'>请选择模板</option>  <option value='tpl/126cms/none.htm' >头部白板</option> </select><br>
              底部模板: 
              <input type="text" name="postdb[tpl_show_foot]" value="<?=$postdb['tpl_show_foot']?>" id="tpl_show_foot" size="40">
              <select onChange='get_obj("tpl_show_foot").value=this.options[this.selectedIndex].value;' name='' ><option value='' style='color:red;'>请选择模板</option>  <option value='tpl/126cms/none.htm' >底部白板</option> </select><br>
              列表模板: 
              <input type="text" name="postdb[tpl_show]" value="<?=$postdb['tpl_show']?>" id="tpl_show" size="40">
              <select onChange='get_obj("tpl_show").value=this.options[this.selectedIndex].value;' name='' ><option value='' style='color:red;'>请选择模板</option>  <option value='tpl/126cms/list.htm' >文章列表页(左宽右窄)</option> </select><!--[<A HREF='#' onclick="window.open('#','','width=650,height=500')" style='color:blue;'>上传一个新模板</A>]//--><br /><br />
              高级功能:
              <input type="radio" name="postdb[tpl_adv_set]" value="1" <? if($postdb['tpl_adv_set'] == '1'){ echo 'checked="checked"';}?> />
开启
<input name="postdb[tpl_adv_set]" type="radio" value="0" <? if($postdb['tpl_adv_set'] == '0'){ echo 'checked="checked"';}?> />
关闭 （只替换内容页模板） <br />
              模板内容替换:
              <input name="postdb[tpl_adv_swap]" type="text" id="postdb[tpl_adv_swap]" value="<?=$postdb['tpl_adv_swap']?>" size="20" />
              替换成
              <input name="postdb[tpl_adv_swap2]" type="text" id="postdb[tpl_adv_swap2]" value="<?=$postdb['tpl_adv_swap2']?>" size="20" />
              <br />
              复制文件名:
              <input name="postdb[tpl_adv_css]" type="text" id="postdb[tpl_adv_css]" value="<?=$postdb['tpl_adv_css']?>" size="20" />
              改名为
              <input name="postdb[tpl_adv_css2]" type="text" id="postdb[tpl_adv_css2]" value="<?=$postdb['tpl_adv_css2']?>" size="20" />
              可以将指定文件复制到和生成的文件相同的目录下</td>
        </tr>
        <tr>
          <td height="28" bgcolor="#FFFFFF">栏目文章自动更新设置</td>
          <td height="28" bgcolor="#FFFFFF"><input type="checkbox" name="ifchang[fauto]" value="1" id="ifchang[fauto]" /></td>
          <td bgcolor="#FFFFFF"><input type="radio" name="postdb[article_auto_config]" value="Y" <? if($article_auto_config=='Y') echo 'checked';?> onclick="article_auto('1')">
          开启文章自动更新
            <input type="radio" name="postdb[article_auto_config]" value="N" <? if($article_auto_config=='N') echo 'checked';?> onclick="article_auto('0')">
            关闭文章自动更新<span id="article_autodiv"><br>
          每日自动更新文章数量设置: 
          <input  id="article_auto_num"  type='text' size='10' value='<?=$article_auto_num?>' name='postdb[article_auto_num]'>
          默认为每日更新文章数<br />
		  <font color="#999999">（自动更新文章是将本栏目的未审核文章自动选取一篇文章重新发表并审核，会将原来的文章删除）</font>
         <br>
        </span> 
        <SCRIPT LANGUAGE="JavaScript">
<!--
function article_auto(t){
	if(t=='0'||t==''){
		document.getElementById("article_autodiv").style.display='none';
	}
	else{
		document.getElementById("article_autodiv").style.display='';
		v=document.getElementById("article_auto_num").value;
		if(v==''||v=='0'){
			document.getElementById("article_auto_num").value='5';
		}
	}
}
article_auto('<? if($article_auto_config=='N') echo '0'; else echo $article_auto_config;?>');
//-->
</SCRIPT></td>
        </tr>
        <tr class="hidetr">
          <td height="28" bgcolor="#FFFFFF">栏目LOGO装饰图片:</td>
          <td height="28" bgcolor="#FFFFFF"><input type="checkbox" name="ifchang[flogo]" value="1" id="ifchang[flogo]" /></td>
          <td bgcolor="#FFFFFF"><input name="postdb[logo]" id="sortlogo" value="<?=$postdb['logo']?>" size="50" />
            <a onclick="window.open('upfile.php?dir=sortlogo&amp;label=sortlogo','','width=350,height=50,top=200,left=400')" href="javascript:"><font color="#0000FF">点击上传图片</font></a><SCRIPT LANGUAGE="JavaScript">
<!--
function upfile(url,name,size,p){
	document.getElementById(p).value=url;
}
//-->
</SCRIPT>            </td>
        </tr>
        <tr class="hidetr">
          <td height="28" bgcolor="#FFFFFF">SEO - title - 关键字:</td>
          <td height="28" bgcolor="#FFFFFF"><input type="checkbox" name="ifchang[ftk]" value="1" id="ifchang[ftk]" /></td>
          <td bgcolor="#FFFFFF"><input name="postdb[titlekeywords]" value="<?=$postdb['titlekeywords']?>" size="60" /></td>
        </tr>
        <tr class="hidetr">
          <td height="28" bgcolor="#FFFFFF">SEO关键字(多个关键字请用,分开):</td>
          <td height="28" bgcolor="#FFFFFF"><input type="checkbox" name="ifchang[fmk]" value="1" id="ifchang[fmk]" /></td>
          <td bgcolor="#FFFFFF"><input name="postdb[metakeywords]" value="<?=$postdb['metakeywords']?>" size="60" /></td>
        </tr>
        <tr class="hidetr">
          <td height="28" bgcolor="#FFFFFF">SEO栏目描述:</td>
          <td height="28" bgcolor="#FFFFFF"><input type="checkbox" name="ifchang[fmd]" value="1" id="ifchang[fmd]" /></td>
          <td bgcolor="#FFFFFF">
		  
<SCRIPT LANGUAGE="JavaScript">
    <!--//
    function textCounter(field, countfield, maxlimit) {
    // 函数，3个参数，表单名字，表单域元素名，限制字符；
    if (field.value.length > maxlimit)
    //如果元素区字符数大于最大字符数，按照最大字符数截断；
    field.value = field.value.substring(0, maxlimit);
    else
    //在记数区文本框内显示剩余的字符数；
    countfield.value = maxlimit - field.value.length;
    }
    //-->
    </SCRIPT>
			  
		  <textarea name="postdb[metadescription]" id="postdb_metadescription" cols="50" rows="4" onKeyDown="textCounter(this.form.postdb_metadescription,this.form.remLen,85);" onKeyUp="textCounter(this.form.postdb_metadescription,this.form.remLen,85);"><?=$postdb['metadescription']?></textarea>
		  
		  您还可以输入:<input name="remLen" type="text" value="85" size="5" readonly="readonly">个字符		  </td>
        </tr>
        <tr class="hidetr">
          <td height="28" bgcolor="#FFFFFF">栏目介绍:</td>
          <td height="28" bgcolor="#FFFFFF"><input type="checkbox" name="ifchang[fhd]" value="1" /></td>
          <td bgcolor="#FFFFFF"><textarea id="htmldescription" name="postdb[htmldescription]" cols="84" rows="7"><?=$postdb['htmldescription']?></textarea>
          </td>
        </tr>
        <tr class="hidetr">
          <td height="28" bgcolor="#FFFFFF">备注1：</td>
          <td rowspan="5" bgcolor="#FFFFFF"><input type="checkbox" name="ifchang[fbz]" value="1" id="ifchang[fbz1]" /></td>
          <td bgcolor="#FFFFFF"><input name="postdb[s_bz_1]]" type="text" id="s_bz_1" value="<?=$postdb['s_bz_1']?>" size="44" />
            说明：
              <input name="postdb[s_bz_1_sm]" type="text" id="s_bz_1_sm" value="<?=$postdb['s_bz_1_sm']?>" size="36" /></td>
        </tr>
        <tr class="hidetr">
          <td height="28" bgcolor="#FFFFFF">备注2：</td>
          <td bgcolor="#FFFFFF"><input name="postdb[s_bz_2]" type="text" id="s_bz_2" value="<?=$postdb['s_bz_2']?>" size="44" />
说明：
  <input name="postdb[s_bz_2_sm]" type="text" id="s_bz_2_sm" value="<?=$postdb['s_bz_2_sm']?>" size="36" /></td>
        </tr>
        <tr class="hidetr">
          <td height="28" bgcolor="#FFFFFF">备注3：</td>
          <td bgcolor="#FFFFFF"><input name="postdb[s_bz_3]" type="text" id="s_bz_3" value="<?=$postdb['s_bz_3']?>" size="44" />
说明：
  <input name="postdb[s_bz_3_sm]" type="text" id="s_bz_3_sm" value="<?=$postdb['s_bz_3_sm']?>" size="36" /></td>
        </tr>
        <tr class="hidetr">
          <td height="28" bgcolor="#FFFFFF">备注4：</td>
          <td bgcolor="#FFFFFF"><input name="postdb[s_bz_4]" type="text" id="s_bz_4" value="<?=$postdb['s_bz_4']?>" size="44" />
说明：
  <input name="postdb[s_bz_4_sm]" type="text" id="s_bz_4_sm" value="<?=$postdb['s_bz_4_sm']?>" size="36" /></td>
        </tr>
        <tr class="hidetr">
          <td height="28" bgcolor="#FFFFFF">备注5：</td>
          <td bgcolor="#FFFFFF"><input name="postdb[s_bz_5]" type="text" id="s_bz_5" value="<?=$postdb['s_bz_5']?>" size="44" />
说明：
  <input name="postdb[s_bz_5_sm]" type="text" id="s_bz_5_sm" value="<?=$postdb['s_bz_5_sm']?>" size="36" /></td>
        </tr>
        <tr>
          <td height="28" colspan="2" bgcolor="#FFFFFF">&nbsp;</td>
          <td bgcolor="#FFFFFF"><input type="submit" value="提交" name="Submit" />
            <input name="job" type="hidden" id="job" value="modify" />
            <input name="postdb[id]" type="hidden" id="id" value="<?=$id?>" /></td>
        </tr>
      </table>
        </form>
      </td>
    </tr>
  </table>
  <SCRIPT LANGUAGE="JavaScript">
<!--
function show_more(va){
	var s=document.getElementsByTagName("tr");
	for(var i=0;i<s.length;i++){
		if( document.form1.showmore.checked==true ||va==1 ){
			if(s[i].className=='hidetr'){
				s[i].style.display="";
			}	
		}else{
			if(s[i].className=='hidetr'){
				s[i].style.display="none";
			}	
		}
	}
}
show_more(1);
//-->
</SCRIPT>

  </div>
</body>
</html>
