<?php
require("../class/connect.php");
include("../class/db_sql.php");
include("../class/config.php");
include("../class/functions.php");
$link=db_connect();
$empire=new mysqlquery();
$logininid=getcvar('loginuserid');
$loginin=getcvar('loginusername');
$loginrnd=getcvar('loginrnd');
$loginlevel=getcvar('loginlevel');
is_login($logininid,$loginin,$loginrnd);
//验证权限
CheckLevel($logininid,$loginin,$classid,"class");
$enews=$_GET['enews'];
if($_GET['from'])
{
	$listclasslink="ListPageClass.php";
}
else
{
	$listclasslink="ListClass.php";
}
$url="<a href=".$listclasslink.">栏目管理</a>&nbsp;->&nbsp;增加栏目";
$hiddenclass="";
$zt="";
$b_ok=1;
$hiddenclass="<script>smallclass.style.display='none';smallclasssetinfo.style.display='none';</script>";
//初使化数据
$r[listorderf]="id";
$r[listorder]="DESC";
$r[reorderf]="newstime";
$r[reorder]="DESC";
$islast="";
$filename0=" checked";
$filename1="";
$filename2="";
$openpl0=" checked";
$openpl1="";
$openadd0=" checked";
$openadd1="";
$r[classtype]=".html";
$r[filetype]=".html";
$r[newspath]="Y-m-d";
$r[link_num]="10";
$r[lencord]=25;
$read="";
$newshowdate="";
$hotshowdate="";
$goodshowdate="";
$hotplshowdate="";
$firstshowdate="";
$r[newline]=10;
$r[newstrlen]=26;
$r[hotline]=10;
$r[hotstrlen]=26;
$r[goodline]=10;
$r[goodstrlen]=26;
$r[hotplline]=10;
$r[hotplstrlen]=26;
$r[firstline]=10;
$r[firststrlen]=26;
$r[maxnum]=0;
$r[addinfofen]=0;
$r[doctime]=0;
$r[down_num]=2;
$r[online_num]=2;
$checked=" checked";
$r['addreinfo']=1;
$defaultbclassid=" selected";
$islist="";
$islast="<input name=islast type=checkbox id=islast onclick='small_class(this.checked)' value='1'>是";
//复制栏目
$docopy=$_GET['docopy'];
if($docopy&&$enews=="AddClass")
{
	$copyclass=1;
}
//修改栏目
if($enews=="EditClass"||$copyclass)
{
	if($copyclass)
	{
		$thisdo="复制";
	}
	else
	{
		$thisdo="修改";
	}
	$read="";
	$classid=(int)$_GET['classid'];
	$r=$empire->fetch1("select * from {$dbtbpre}enewsclass where classid='$classid'");
	if(!empty($r[bclassid]))
	{$defaultbclassid="";}
	$url="<a href=".$listclasslink.">管理栏目</a>&nbsp;->&nbsp;".$thisdo."栏目：".$r[classname];
	if($r[islist])
	{$islist=" checked";}
	//修改大栏目
	if(!$r[islast])
	{
		//主栏目
		if(empty($r[bclassid]))
		{
			$b_ok=1;
			$hiddenclass="<script>smallclass.style.display='none';smallclasssetinfo.style.display='none';</script>";
		}
		//中级栏目
		else
		{
			$b_ok=1;
			$hiddenclass="<script>smallclass.style.display='none';smallclasssetinfo.style.display='none';</script>";
		}
	}
	//终级栏目
	else
	{
		$hiddenclass="";
		$b_ok=0;
	}
	//终级类别
	if($r[islast])
	{
		$islast="<b>是</b>";
		$islastcheck=" checked";
	}
	else
	{
		$islast="<b>否</b>";
		$islastcheck="";
	}
	$islast.="<input type=hidden name=islast value='".$r[islast]."'>";
	if($r[filename]==1)
	{
		$filename0="";
		$filename1=" checked";
		$filename2="";
	}
	elseif($r[filename]==2)
	{
		$filename0="";
		$filename1="";
		$filename2=" checked";
	}
	else
	{}
	if($r[openpl])
	{
		$openpl0="";
		$openpl1=" checked";
	}
	if($r[checkpl])
	{
		$checkpl=" checked";
	}
	if($r[openadd])
	{
		$openadd0="";
		$openadd1=" checked";
	}
	if($r[newshowdate])
	{$newshowdate=" checked";}
	if($r[hotshowdate])
	{$hotshowdate=" checked";}
	if($r[goodshowdate])
	{$goodshowdate=" checked";}
	if($r[hotplshowdate])
	{$hotplshowdate=" checked";}
	if($r[firstshowdate])
	{$firstshowdate=" checked";}
	//栏目目录
	$mycr=GetPathname($r[classpath]);
	$pripath=$mycr[1];
	$classpath=$mycr[0];
	$read="";
	//复制栏目
	if($copyclass)
	{
		$r[classname].="(1)";
		$classpath.="1";
		$read="";
		$islast="<input name=islast type=checkbox id=islast onclick='small_class(this.checked)' value='1'".$islastcheck.">是";
    }
	if($r[checked])
	{$checked=" checked";}
	else
	{$checked="";}
	if($r[docheckuser])
	{$docheckuser=" checked";}
}
//系统模型
$m_sql=$empire->query("select mid,mname from {$dbtbpre}enewsmod order by mid");
while($m_r=$empire->fetch($m_sql))
{
	if($m_r[mid]==$r[modid])
	{$m_d=" selected";}
	else
	{$m_d="";}
	$mod_options.="<option value=".$m_r[mid].$m_d.">".$m_r[mname]."</option>";
	//列表模板
	$listtemp_options.="<option value=0 style='background:#99C4E3'>".$m_r[mname]."</option>";
	$dtlisttemp_options.="<option value=0 style='background:#99C4E3'>".$m_r[mname]."</option>";
	$lt_sql=$empire->query("select tempid,tempname from ".GetTemptb("enewslisttemp")." where modid='$m_r[mid]'");
	while($lt_r=$empire->fetch($lt_sql))
	{
		//静态
		if($lt_r[tempid]==$r[listtempid])
		{$lt_d=" selected";}
		else
		{$lt_d="";}
		$listtemp_options.="<option value=".$lt_r[tempid].$lt_d."> |-".$lt_r[tempname]."</option>";
		//动态
		if($lt_r[tempid]==$r[dtlisttempid])
		{$lt_dt=" selected";}
		else
		{$lt_dt="";}
		$dtlisttemp_options.="<option value=".$lt_r[tempid].$lt_dt."> |-".$lt_r[tempname]."</option>";
	}
	//搜索模板
	$searchtemp.="<option value=0 style='background:#99C4E3'>".$m_r[mname]."</option>";
	$st_sql=$empire->query("select tempid,tempname from ".GetTemptb("enewssearchtemp")." where modid='$m_r[mid]'");
	while($st_r=$empire->fetch($st_sql))
	{
		if($st_r[tempid]==$r[searchtempid])
		{$st_d=" selected";}
		else
		{$st_d="";}
		$searchtemp.="<option value=".$st_r[tempid].$st_d."> |-".$st_r[tempname]."</option>";
	}
	//内容模板
	$newstemp_options.="<option value=0 style='background:#99C4E3'>".$m_r[mname]."</option>";
	$nt_sql=$empire->query("select tempid,tempname from ".GetTemptb("enewsnewstemp")." where modid='$m_r[mid]'");
	while($nt_r=$empire->fetch($nt_sql))
	{
		if($nt_r[tempid]==$r[newstempid])
		{$nt_d=" selected";}
		else
		{$nt_d="";}
		$newstemp_options.="<option value=".$nt_r[tempid].$nt_d."> |-".$nt_r[tempname]."</option>";
	}
}
//栏目
$fcfile="../data/fc/ListEnews.php";
$fcjsfile="../data/fc/cmsclass.js";
if(file_exists($fcjsfile)&&file_exists($fcfile))
{
	$options=GetFcfiletext($fcjsfile);
	$options=str_replace("<option value='$r[bclassid]'","<option value='$r[bclassid]' selected",$options);
}
else
{
	$options=ShowClass_AddClass("",$r[bclassid],0,"|-",0,0);
}
//会员组
//----------会员组
$sql1=$empire->query("select groupid,groupname from {$dbtbpre}enewsmembergroup order by level");
while($l_r=$empire->fetch($sql1))
{
	if($r[groupid]==$l_r[groupid])
	{$select=" selected";}
	else
	{$select="";}
	$group.="<option value=".$l_r[groupid].$select.">".$l_r[groupname]."</option>";
	if($r[qaddgroupid]==$l_r[groupid])
	{$qselect=" selected";}
	else
	{$qselect="";}
	$qgroup.="<option value=".$l_r[groupid].$qselect.">".$l_r[groupname]."</option>";
}
//js模板
$jstempsql=$empire->query("select tempid,tempname from ".GetTemptb("enewsjstemp")." order by tempid");
while($jstempr=$empire->fetch($jstempsql))
{
	$select="";
	if($r[jstempid]==$jstempr[tempid])
	{
		$select=" selected";
	}
	$jstemp.="<option value='".$jstempr[tempid]."'".$select.">".$jstempr[tempname]."</option>";
}
//封面模板
$classtempsql=$empire->query("select tempid,tempname from ".GetTemptb("enewsclasstemp")." order by tempid");
while($classtempr=$empire->fetch($classtempsql))
{
	$select="";
	if($r[classtempid]==$classtempr[tempid])
	{
		$select=" selected";
	}
	$classtemp.="<option value='".$classtempr[tempid]."'".$select.">".$classtempr[tempname]."</option>";
}
//当前使用的模板组
$thegid=GetDoTempGid();
//风格
$loginadminstyleid=(int)getcvar('loginadminstyleid');
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="adminstyle/<?=$loginadminstyleid?>/adminstyle.css" type="text/css">
<link id="luna-tab-style-sheet" type="text/css" rel="stylesheet" href="adminstyle/<?=$loginadminstyleid?>/tab.winclassic.css" disabled="disabled" /> 
<title>管理栏目</title>
<!-- the id is not needed. It is used here to be able to change css file at runtime -->
<style type="text/css"> 
   .dynamic-tab-pane-control .tab-page { 
         height:                100px; 
 } 
  .dynamic-tab-pane-control .tab-page .dynamic-tab-pane-control .tab-page { 
         height:                150px; 
 } 
  form { 
         margin:        0; 
         padding:        0; 
 } 
  /* over ride styles from webfxlayout */ 
  .dynamic-tab-pane-control h2 { 
         text-align:        center; 
         width:                auto;
		 height:            20; 
 } 
   .dynamic-tab-pane-control h2 a { 
         display:        inline; 
         width:                auto; 
 } 
  .dynamic-tab-pane-control a:hover { 
         background: transparent; 
 } 
  </style>
 <script type="text/javascript" src="../data/images/tabpane.js"></script> <script type="text/javascript"> 
  function setLinkSrc( sStyle ) { 
         document.getElementById( "luna-tab-style-sheet" ).disabled = sStyle != "luna"; 
  
         //document.documentElement.style.background = "";
         //document.body.style.background = sStyle == "webfx" ? "white" : "ThreeDFace"; 
 } 
function chgBg(obj,color){
 if (document.all || document.getElementById)
   obj.style.backgroundColor=color;
 else if (document.layers)
   obj.bgColor=color;
}
  setLinkSrc( "luna" ); 
  </script>
  
<script>
function small_class(mycheck)
{
if(mycheck)
{
smallclass.style.display="";
smallclasssetinfo.style.display="";
}
else
{
smallclass.style.display="none";
smallclasssetinfo.style.display="none";
}
}

function mybclass()
{
bclass=new Array();
bclass[0]=new Array();
bclass[0][0]='';
<?
//-----------类别js数组
$psql=$empire->query("select classid,classpath from {$dbtbpre}enewsclass order by classid");
$i=0;
while($pr=$empire->fetch($psql))
{
?>
bclass[<?=$pr[classid]?>]=new Array();
bclass[<?=$pr[classid]?>][0]="<?=$pr[classpath]?>/";
<?
}
?>
}
mybclass();

function changeitem(myfrm)
{var SelectedBigId;
SelectedBigId=myfrm.bclassid.options[myfrm.bclassid.selectedIndex].value;
myfrm.pripath.value=bclass[SelectedBigId][0];
myfrm.classpath.focus();
}

//检查
function CheckForm(obj)
{
if(obj.classname.value=="")
{
alert("请输入栏目名称");
return false;
}
if(obj.classpath.value=="")
{
alert("请输入栏目目录");
return false;
}
//终极栏目
if(obj.islast.checked)
{
	if(obj.modid.value==0||obj.modid.value=="")
	{
	alert("请选择所属系统模型");
	return false;
	}
	if(obj.listtempid.value==0)
	{
	alert("请选择列表模板");
	return false;
	}
	if(obj.newstempid.value==0)
	{
	alert("请选择内容模板");
	return false;
	}
	if(obj.filetype.value=="")
	{
	alert("请输入信息文件扩展名");
	return false;
	}
}
//大栏目
else
{
	if(obj.islist.checked&&obj.blisttempid.value==0)
	{
	alert("列表式的栏目,需选择列表模板");
	return false;
	}
}
return true;
}
</script>
</head>

<body>
<table width="100%" border="0" align="center" cellpadding="6" cellspacing="1">
  <tr>
    <td>位置：<?=$url?> </td>
  </tr>
</table>
  <form name="form1" method="post" action="enews.php" onsubmit="return CheckForm(document.form1);">
  <div class="tab-pane" id="TabPane1"> <script type="text/javascript">
tb1 = new WebFXTabPane( document.getElementById( "TabPane1" ) );
</script>
<div class="tab-page" id="baseinfo"> 
                    
      <h2 class="tab">&nbsp;<font class=tabcolor>基本属性</font>&nbsp;</h2>
                    <script type="text/javascript">tb1.addTabPage( document.getElementById( "baseinfo" ) );</script>
      <table width="100%" border="0" align="center" cellpadding="3" cellspacing="1" class="tableborder">
        <input type=hidden name=enews value=<?=$enews?>>
        <tr class="header"> 
          <td height="30" colspan="2">增加栏目</td>
        </tr>
        <tr bgcolor="#FFFFFF"> 
          <td width="23%" height="25">栏目名称</td>
          <td> <input name="classname" type="text" id="classname" value="<?=$r[classname]?>" size="38"> 
            <?
	  if($enews=="AddClass")
	  {
	  ?>
            <input type="button" name="Submit5" value="生成拼音目录" onclick="window.open('GetPinyin.php?hz='+document.form1.classname.value+'&returnform=opener.document.form1.classpath.value','','width=160,height=100');"> 
            <?
	  }
	  ?>
            <input name="oldbclassid" type="hidden" id="oldbclassid" value="<?=$r[bclassid]?>"> 
            <input name="classid" type="hidden" id="classid" value="<?=$classid?>"> 
            <input name="oldclassname" type="hidden" id="oldclassname" value="<?=$r[classname]?>"> 
            <input name="oldislast" type="hidden" id="oldislast" value="<?=$r[islast]?>"> 
          </td>
        </tr>
		<tr bgcolor="#FFFFFF"> 
          <td height="25">栏目别名</td>
          <td><input name="bname" type="text" id="bname" value="<?=$r[bname]?>" size="38"> 
            <font color="#666666">(为空则与栏目名相同)</font></td>
        </tr>
        <tr bgcolor="#FFFFFF"> 
          <td height="25" valign="top">所属父栏目</td>
          <td><select name="bclassid" size="12" id="bclassid" onchange='javascript:changeitem(document.form1);' style="width:320">
              <option value="0"<?=$defaultbclassid?>>根栏目</option>
              <?=$options?>
            </select> </td>
        </tr>
        <tr bgcolor="#FFFFFF"> 
          <td height="25">是否终级栏目</td>
          <td> 
            <?=$islast?>
            <font color="#666666">(终级栏目下才能增加信息)</font></td>
        </tr>
        <tr bgcolor="#FFFFFF"> 
          <td height="25" valign="top">栏目存放文件夹
<input name="oldclasspath" type="hidden" id="oldclasspath" value="<?=$r[classpath]?>"> 
            <br> <input name="oldcpath" type="hidden" id="oldcpath" value="<?=$classpath?>"></td>
          <td><table border="0" cellspacing="1" cellpadding="3">
              <tr bgcolor="DBEAF5"> 
                <td>&nbsp;</td>
                <td bgcolor="DBEAF5">上层栏目目录</td>
                <td>本栏目目录</td>
                <td bgcolor="DBEAF5">&nbsp;</td>
              </tr>
              <tr> 
                <td><div align="right">根目录/</div></td>
                <td><input name="pripath" type="text" id="pripath" value="<?=$pripath?>" size="30" readonly> 
                </td>
                <td><input name="classpath" type="text" id="classpath3" value="<?=$classpath?>" size="16"<?=$read?>></td>
                <td> <div align="left"> 
                    <input type="button" name="Submit3" value="检测目录" onclick="javascript:window.open('enews.php?enews=CheckPath&pripath='+document.form1.pripath.value+'&classpath='+document.form1.classpath.value,'','width=100,height=100,top=250,left=450');">
                  </div></td>
              </tr>
            </table></td>
        </tr>
		<tr bgcolor="#FFFFFF"> 
          <td width="23%" height="25">绑定的系统模型</td>
          <td width="77%"><select name="modid" id="modid">
              <?=$mod_options?>
            </select> <input type="button" name="Submit6" value="管理系统模型" onclick="window.open('db/ListTable.php');">
            * 
            <input name="oldmodid" type="hidden" id="oldmodid" value="<?=$r[modid]?>"></td>
        </tr>
        <tr bgcolor="#FFFFFF"> 
          <td height="25">绑定域名</td>
          <td><input name="classurl" type="text" id="classurl" value="<?=$r[classurl]?>" size="38"> 
            <input name="UrlToSmall" type="checkbox" id="UrlToSmall" value="1">
            应用于子栏目<font color="#666666"> (没有绑定，请留空.后面无需加&quot;/&quot;)</font></td>
        </tr>
        <tr bgcolor="#FFFFFF"> 
          <td height="25">栏目缩略图</td>
          <td><input name="classimg" type="text" id="classimg" value="<?=$r[classimg]?>" size="38"> 
            <a onclick="window.open('editor/file.php?userid=<?=$logininid?>&username=<?=$loginin?>&rnd=<?=$loginrnd?>&type=1&classid=&doing=2&field=classimg','','width=700,height=550,scrollbars=yes');" title="选择已上传的图片"><img src="../data/images/changeimg.gif" width="22" height="22" border="0" align="absbottom"></a></td>
        </tr>
        <tr bgcolor="#FFFFFF"> 
          <td height="25" valign="top">页面关键字</td>
          <td><input name="classpagekey" type="text" id="classpagekey" value="<?=$r[classpagekey]?>" size="38"></td>
        </tr>
        <tr bgcolor="#FFFFFF"> 
          <td height="25" valign="top">栏目简介</td>
          <td><textarea name="intro" cols="70" rows="8" id="intro"><?=stripSlashes($r[intro])?></textarea></td>
        </tr>
      </table>
  </div>
  <div class="tab-page" id="changevar"> 
      <h2 class="tab">&nbsp;<font class="tabcolor">选项设置</font>&nbsp;</h2>
                    <script type="text/javascript">tb1.addTabPage( document.getElementById( "changevar" ) );</script>
      <table width="100%" border="0" align="center" cellpadding="3" cellspacing="1" class="tableborder">
        <tr class="header"> 
          <td height="30" colspan="2">栏目选项</td>
        </tr>
        <tr bgcolor="#FFFFFF"> 
          <td height="25" valign="top">是否显示到导航</td>
          <td><input type="radio" name="showclass" value="0"<?=$r[showclass]==0?' checked':''?>>
            显示 
            <input type="radio" name="showclass" value="1"<?=$r[showclass]==1?' checked':''?>>
            不显示<font color="#666666">（如：导航标签，地图标签）</font></td>
        </tr>
        <tr bgcolor="#FFFFFF"> 
          <td height="25" valign="top">显示排序</td>
          <td><input name="myorder" type="text" id="myorder" value="<?=$r[myorder]?>" size="8"> 
            <font color="#666666">(值越小越前面)</font></td>
        </tr>
        <tbody id="smallclass">
          <tr bgcolor="#FFFFFF"> 
            <td width="23%" valign="top">评论</td>
            <td height="25"><input type="radio" name="openpl" value="0"<?=$openpl0?>>
              开启 
              <input type="radio" name="openpl" value="1"<?=$openpl1?>>
              关闭，评论需要审核: 
              <input name="checkpl" type="checkbox" id="checkpl2" value="1"<?=$checkpl?>>
              是</td>
          </tr>
          <tr bgcolor="#FFFFFF"> 
            <td height="25">开放投稿</td>
            <td><input type="radio" name="openadd" value="0"<?=$openadd0?>>
              开启 
              <input type="radio" name="openadd" value="1"<?=$openadd1?>>
              关闭 
              <input name="oldopenadd" type="hidden" id="oldopenadd" value="<?=$r[openadd]?>"> 
            </td>
          </tr>
          <tr bgcolor="#FFFFFF"> 
            <td valign="top">前台投稿设置</td>
            <td height="25">会员组： 
              <select name="qaddgroupid" id="select2">
                <option value="0">游客</option>
                <?=$qgroup?>
              </select>
              ，开启验证码: 
              <input name="qaddshowkey" type="checkbox" id="qaddshowkey2" value="1"<?=$r['qaddshowkey']==1?' checked':''?>></td>
          </tr>
          <tr bgcolor="#FFFFFF"> 
            <td valign="top">&nbsp;</td>
            <td height="25"><p>投稿需要审核: 
                <input name="checkqadd" type="checkbox" id="checkqadd" value="1"<?=$r['checkqadd']==1?' checked':''?>>
                直接通过审核 ，投稿生成列表: 
                <select name="qaddlist" id="qaddlist">
                  <option value="0"<?=$r['qaddlist']==0?' selected':''?>>不生成</option>
                  <option value="1"<?=$r['qaddlist']==1?' selected':''?>>生成当前栏目</option>
                  <option value="2"<?=$r['qaddlist']==2?' selected':''?>>生成首页</option>
                  <option value="3"<?=$r['qaddlist']==3?' selected':''?>>生成父栏目</option>
                  <option value="4"<?=$r['qaddlist']==4?' selected':''?>>生成当前栏目与父栏目</option>
                  <option value="5"<?=$r['qaddlist']==5?' selected':''?>>生成父栏目与首页</option>
                  <option value="6"<?=$r['qaddlist']==6?' selected':''?>>生成当前栏目、父栏目与首页</option>
                </select>
              </p></td>
          </tr>
          <tr bgcolor="#FFFFFF"> 
            <td valign="top">&nbsp;</td>
            <td height="25">单篇投稿审核后获得 
              <input name="addinfofen" type="text" id="addinfofen" value="<?=$r[addinfofen]?>" size="6">
              点数 <font color="#666666">(不增加请设为0,扣点请设为负数)</font></td>
          </tr>
          <tr bgcolor="#FFFFFF"> 
            <td valign="top">&nbsp;</td>
            <td height="25">管理投稿：<strong> 
              <select name="adminqinfo" id="adminqinfo">
                <option value="0"<?=$r['adminqinfo']==0?' selected':''?>>不能管理信息</option>
                <option value="1"<?=$r['adminqinfo']==1?' selected':''?>>可管理未审核信息</option>
                <option value="2"<?=$r['adminqinfo']==2?' selected':''?>>只可编辑未审核信息</option>
                <option value="3"<?=$r['adminqinfo']==3?' selected':''?>>只可删除未审核信息</option>
                <option value="4"<?=$r['adminqinfo']==4?' selected':''?>>可管理所有信息</option>
                <option value="5"<?=$r['adminqinfo']==5?' selected':''?>>只可编辑所有信息</option>
                <option value="6"<?=$r['adminqinfo']==6?' selected':''?>>只可删除所有信息</option>
              </select>
              </strong></td>
          </tr>
          <tr bgcolor="#FFFFFF">
            <td valign="top">后台信息发布设置</td>
            <td height="25">增加/编辑信息：
              <input name="addreinfo" type="checkbox" id="addreinfo" value="1"<?=$r['addreinfo']==1?' checked':''?>>
              直接生成内容页；生成列表：<select name="haddlist" id="haddlist">
                  <option value="0"<?=$r['haddlist']==0?' selected':''?>>不生成</option>
                  <option value="1"<?=$r['haddlist']==1?' selected':''?>>生成当前栏目</option>
                  <option value="2"<?=$r['haddlist']==2?' selected':''?>>生成首页</option>
                  <option value="3"<?=$r['haddlist']==3?' selected':''?>>生成父栏目</option>
                  <option value="4"<?=$r['haddlist']==4?' selected':''?>>生成当前栏目与父栏目</option>
                  <option value="5"<?=$r['haddlist']==5?' selected':''?>>生成父栏目与首页</option>
                  <option value="6"<?=$r['haddlist']==6?' selected':''?>>生成当前栏目、父栏目与首页</option>
                </select></td>
          </tr>
          <tr bgcolor="#FFFFFF">
            <td valign="top">&nbsp;</td>
            <td height="25"><input name="sametitle" type="checkbox" id="sametitle" value="1"<?=$r['sametitle']==1?' checked':''?>>
              检测标题重复</td>
          </tr>
          <tr bgcolor="#FFFFFF"> 
            <td valign="top">审核设置</td>
            <td height="25"><input name="checked" type="checkbox" id="checked" value="1"<?=$checked?>>
              直接审核</td>
          </tr>
          <tr bgcolor="#FFFFFF"> 
            <td valign="top">&nbsp;</td>
            <td height="25">强制签发 
              <input name="docheckuser" type="checkbox" id="docheckuser" value="1"<?=$docheckuser?>> 
              &nbsp;&nbsp;签发人员： 
              <input name="checkuser" type="text" id="checkuser" value="<?=$r[checkuser]?>" size="32"> 
              <input type="button" name="Submit4" value="选择用户" onclick="window.open('ChangeUser.php?field=checkuser&form=form1','','width=300,height=520,scrollbars=yes');"> 
            </td>
          </tr>
          <tr bgcolor="#FFFFFF"> 
            <td valign="top">&nbsp;</td>
            <td height="25"><font color="#666666">(签发说明：多个用户请用&quot;,&quot;格开,强制签发将应用于本栏目的信息)</font></td>
          </tr>
          <tr bgcolor="#FFFFFF"> 
            <td height="25">默认查看信息权限</td>
            <td><select name="groupid" id="groupid">
                <option value="0">游客</option>
                <?=$group?>
              </select> <font color="#666666">(方便录入信息)</font></td>
          </tr>
          <tr bgcolor="#FFFFFF"> 
            <td height="25">信息归档</td>
            <td>归档大于 
              <input name="doctime" type="text" id="doctime" value="<?=$r[doctime]?>" size="6">
              天的信息<font color="#666666">(0为不归档)</font></td>
          </tr>
          <tr class="header"> 
            <td height="30" colspan="2">特殊模型设置</td>
          </tr>
          <tr bgcolor="#FFFFFF"> 
            <td width="23%" height="25">下载/影视模型</td>
            <td height="25">每行显示 
              <input name="down_num" type="text" id="link_num3" value="<?=$r[down_num]?>" size="5">
              个下载地址， 
              <input name="online_num" type="text" id="down_num" value="<?=$r[online_num]?>" size="5">
              个在线观看地址</td>
          </tr>
        </tbody>
      </table>
  </div>
  <div class="tab-page" id="settemplate"> 
      <h2 class="tab">&nbsp;<font class="tabcolor">模板选项</font>&nbsp;</h2>
                    <script type="text/javascript">tb1.addTabPage( document.getElementById( "settemplate" ) );</script>
      <table width="100%" border="0" align="center" cellpadding="3" cellspacing="1" class="tableborder">
        <tr class="header"> 
          <td height="30" colspan="2">模板设置</td>
        </tr>
        <tr bgcolor="#FFFFFF"> 
          <td height="25">封面模板</td>
          <td height="25"><select name="classtempid">
              <?=$classtemp?>
            </select> <input type="button" name="Submit6223" value="管理封面模板" onclick="window.open('template/ListClasstemp.php?gid=<?=$thegid?>');"></td>
        </tr>
        <tr bgcolor="#FFFFFF"> 
          <td width="23%" height="25">列表式</td>
          <td height="25"> <input name="islist" type="checkbox" id="islist" value="1"<?=$islist?>>
            是<font color="#666666">(选中此项,封面模板无效)</font> <input name="oldislist" type="hidden" id="oldislist" value="<?=$r[islist]?>"></td>
        </tr>
        <tr bgcolor="#FFFFFF"> 
          <td height="25">所属列表模板</td>
          <td> 静态： 
            <select name="listtempid" id="listtempid">
              <?=$listtemp_options?>
            </select>
            ，动态： 
            <select name="dtlisttempid">
              <?=$dtlisttemp_options?>
            </select> <input type="button" name="Submit6222" value="管理列表模板" onclick="window.open('template/ListListtemp.php?gid=<?=$thegid?>');">
            *</td>
        </tr>
        <tr bgcolor="#FFFFFF"> 
          <td height="25">所属内容模板</td>
          <td><select name="newstempid" id="newstempid">
              <?=$newstemp_options?>
            </select> <input type="button" name="Submit62222" value="管理内容模板" onclick="window.open('template/ListNewstemp.php?gid=<?=$thegid?>');">
            *( 
            <input name="tobetempinfo" type="checkbox" id="tobetempinfo" value="1">
            应用于已生成的信息 )</td>
        </tr>
        <tr bgcolor="#FFFFFF"> 
          <td height="25">搜索模板</td>
          <td><select name="searchtempid" id="searchtempid">
              <option value="0">使用默认模板 </option>
              <?=$searchtemp?>
            </select> <input type="button" name="Submit62" value="管理搜索模板" onclick="window.open('template/ListSearchtemp.php?gid=<?=$thegid?>');"></td>
        </tr>
      </table>
  </div>
  <div class="tab-page" id="sethtml"> 
      <h2 class="tab">&nbsp;<font class="tabcolor">生成选项</font>&nbsp;</h2>
                    <script type="text/javascript">tb1.addTabPage( document.getElementById( "sethtml" ) );</script>
      <table width="100%" border="0" align="center" cellpadding="3" cellspacing="1" class="tableborder">
        <tr class="header"> 
          <td height="30" colspan="2">生成设置</td>
        </tr>
        <tr bgcolor="#FFFFFF"> 
          <td width="23%" height="25">列表模式</td>
          <td><input type="radio" name="listdt" value="0"<?=$r[listdt]==0?' checked':''?>>
            静态列表 
            <input type="radio" name="listdt" value="1"<?=$r[listdt]==1?' checked':''?>>
            动态列表<font color="#666666"> (交互性的列表可选择动态)</font></td>
        </tr>
        <tr bgcolor="#FFFFFF"> 
          <td height="25">内容页模式</td>
          <td><input type="radio" name="showdt" value="0"<?=$r[showdt]==0?' checked':''?>>
            静态页面 
            <input type="radio" name="showdt" value="1"<?=$r[showdt]==1?' checked':''?>>
            动态生成<font color="#666666"> (交互性的信息可选择动态生成)</font></td>
        </tr>
        <tr bgcolor="#FFFFFF"> 
          <td height="25">管理信息排序方式</td>
          <td>按字段 
            <input name="listorderf" type="text" id="listorderf" value="<?=$r[listorderf]?>" size="16"> 
            <select name="select4" onchange="document.form1.listorderf.value=this.value">
              <option>选择</option>
              <option value="newstime">发布时间</option>
              <option value="id">ID</option>
              <option value="onclick">点击率</option>
              <option value="totaldown">下载数</option>
              <option value="plnum">评论数</option>
            </select>
            ，排列方式 
            <select name="listorder" id="listorder">
              <option value="DESC"<?=$r[listorder]=="DESC"?' selected':''?>>倒序排序</option>
              <option value="ASC"<?=$r[listorder]=="ASC"?' selected':''?>>顺序排序</option>
            </select></td>
        </tr>
        <tr bgcolor="#FFFFFF"> 
          <td height="25">列表式页面排序方式</td>
          <td>按字段 
            <input name="reorderf" type="text" id="reorderf" value="<?=$r[reorderf]?>" size="16"> 
            <select name="select5" onchange="document.form1.reorderf.value=this.value">
              <option>选择</option>
              <option value="newstime">发布时间</option>
              <option value="id">ID</option>
              <option value="onclick">点击率</option>
              <option value="totaldown">下载数</option>
              <option value="plnum">评论数</option>
            </select>
            ，排列方式 
            <select name="reorder" id="select">
              <option value="DESC"<?=$r[reorder]=="DESC"?' selected':''?>>倒序排序</option>
              <option value="ASC"<?=$r[reorder]=="ASC"?' selected':''?>>顺序排序</option>
            </select></td>
        </tr>
        <tr bgcolor="#FFFFFF"> 
          <td height="25">是否生成</td>
          <td><input name="nreclass" type="checkbox" value="1"<?=$r[nreclass]==1?' checked':''?>>
            不生成栏目页， 
            <input name="nreinfo" type="checkbox" value="1"<?=$r[nreinfo]==1?' checked':''?>>
            不生成内容页， 
            <input name="nrejs" type="checkbox" value="1"<?=$r[nrejs]==1?' checked':''?>>
            不生成JS调用， 
            <input name="nottobq" type="checkbox" value="1"<?=$r[nottobq]==1?' checked':''?>>
            标签不调用</td>
        </tr>
        <tr bgcolor="#FFFFFF"> 
          <td height="25">栏目文件扩展名</td>
          <td><input name="classtype" type="text" id="classtype" value="<?=$r[classtype]?>" size="38"> 
            <select name="select" onchange="document.form1.classtype.value=this.value">
              <option value=".html">扩展名</option>
              <option value=".html">.html</option>
              <option value=".htm">.htm</option>
              <option value=".php">.php</option>
              <option value=".shtml">.shtml</option>
            </select> <input name="oldclasstype" type="hidden" id="oldclasstype" value="<?=$r[classtype]?>"> 
            <font color="#666666">(如.html,.xml,.htm等)</font></td>
        </tr>
        <tr bgcolor="#FFFFFF"> 
          <td height="25">显示总记录数</td>
          <td> <input name="maxnum" type="text" id="maxnum" value="<?=$r[maxnum]?>" size="38">
            条<font color="#666666">(0为显示所有记录)</font></td>
        </tr>
        <tr bgcolor="#FFFFFF"> 
          <td height="25">生成信息每页显示</td>
          <td><input name="lencord" type="text" id="lencord" value="<?=$r[lencord]?>" size="38">
            条记录 
            <input name="oldlencord" type="hidden" id="oldlencord3" value="<?=$r[lencord]?>"></td>
        </tr>
		<tbody id="smallclasssetinfo">
        <tr bgcolor="#FFFFFF"> 
          <td height="25">相关链接显示</td>
          <td><input name="link_num" type="text" id="link_num" value="<?=$r[link_num]?>" size="38">
            条记录</td>
        </tr>
        <tr bgcolor="#FFFFFF"> 
          <td height="26">内容页存放目录</td>
          <td><input type="radio" name="infopath" value="0"<?=$r[ipath]==''?' checked':''?>>
              栏目目录 
              <input type="radio" name="infopath" value="1"<?=$r[ipath]<>''?' checked':''?>>
              自定义： /
<input name="ipath" type="text" id="ipath" value="<?=$r[ipath]?>">
              <font color="#666666">(从根目录开始)</font></td>
        </tr>
        <tr bgcolor="#FFFFFF"> 
          <td height="26">内容页目录存放形式</td>
          <td><input name="newspath" type="text" id="newspath" value="<?=$r[newspath]?>" size="38"> 
            <select name="select2" onchange="document.form1.newspath.value=this.value">
              <option value="Y-m-d">选择</option>
              <option value="Y-m-d">2005-01-27</option>
              <option value="Y/m-d">2005/01-27</option>
              <option value="Y/m/d">2005/01/27</option>
              <option value="Ymd">20050127</option>
              <option value="">不设置目录</option>
            </select>
              <font color="#666666">(如Y-m-d，Y/m-d等形式)</font></td>
        </tr>
        <tr bgcolor="#FFFFFF"> 
          <td height="25">内容页文件命名形式</td>
          <td>[前缀] 
            <input name="filename_qz" type="text" id="filename_qz" value="<?=$r[filename_qz]?>" size="15">
            命名: 
            <input type="radio" name="filename" value="0"<?=$r[filename]==0?' checked':''?>>
            信息ID 
            <input type="radio" name="filename" value="1"<?=$r[filename]==1?' checked':''?>>
            time() 
            <input type="radio" name="filename" value="2"<?=$r[filename]==2?' checked':''?>>
            md5() 
            <input type="radio" name="filename" value="3"<?=$r[filename]==3?' checked':''?>>
            目录</td>
        </tr>
        <tr bgcolor="#FFFFFF"> 
          <td height="25">内容页文件扩展名</td>
          <td><input name="filetype" type="text" id="filetype" value="<?=$r[filetype]?>" size="38"> 
            <select name="select3" onchange="document.form1.filetype.value=this.value">
              <option value=".html">扩展名</option>
              <option value=".html">.html</option>
              <option value=".htm">.htm</option>
              <option value=".php">.php</option>
              <option value=".shtml">.shtml</option>
            </select> <font color="#666666">(如.html,.xml,.htm等)</font></td>
        </tr>
		</tbody>
      </table>
  </div>
  <div class="tab-page" id="setjs"> 
      <h2 class="tab">&nbsp;<font class="tabcolor">JS调用设置</font>&nbsp;</h2>
                    <script type="text/javascript">tb1.addTabPage( document.getElementById( "setjs" ) );</script>
      <table width="100%" border="0" align="center" cellpadding="3" cellspacing="1" class="tableborder">
        <tr class="header"> 
      <td height="30" colspan="2">JS调用相关设置</td>
    </tr>
    <tr bgcolor="#FFFFFF">
          <td height="25">所用JS模板</td>
      <td><select name="jstempid" id="jstempid">
	  <?=$jstemp?>
        </select>
            <input type="button" name="Submit62223" value="管理JS模板" onclick="window.open('template/ListJstemp.php?gid=<?=$thegid?>');"></td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
          <td width="23%" height="25">最新信息JS设置</td>
      <td> 调用 
        <input name="newline" type="text" id="newline" value="<?=$r[newline]?>" size="6">
        条记录,标题截取 
        <input name="newstrlen" type="text" id="newstrlen" value="<?=$r[newstrlen]?>" size="6">
        个字节, 
        <input name="newshowdate" type="checkbox" id="newshowdate" value="1"<?=$newshowdate?>>
        显示日期</td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
          <td height="25">热门信息JS设置</td>
      <td>调用 
        <input name="hotline" type="text" id="hotline" value="<?=$r[hotline]?>" size="6">
        条记录,标题截取 
        <input name="hotstrlen" type="text" id="hotstrlen" value="<?=$r[hotstrlen]?>" size="6">
        个字节, 
        <input name="hotshowdate" type="checkbox" id="hotshowdate" value="1"<?=$hotshowdate?>>
        显示日期</td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
          <td height="25">推荐信息JS设置</td>
      <td>调用 
        <input name="goodline" type="text" id="goodline" value="<?=$r[goodline]?>" size="6">
        条记录,标题截取 
        <input name="goodstrlen" type="text" id="goodstrlen" value="<?=$r[goodstrlen]?>" size="6">
        个字节, 
        <input name="goodshowdate" type="checkbox" id="goodshowdate" value="1"<?=$goodshowdate?>>
        显示日期</td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
          <td height="25">热门评论信息JS设置</td>
      <td>调用 
        <input name="hotplline" type="text" id="hotplline" value="<?=$r[hotplline]?>" size="6">
        条记录,标题截取 
        <input name="hotplstrlen" type="text" id="hotplstrlen" value="<?=$r[hotplstrlen]?>" size="6">
        个字节, 
        <input name="hotplshowdate" type="checkbox" id="hotplshowdate" value="1"<?=$hotplshowdate?>>
        显示日期</td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
          <td height="25">头条信息JS设置</td>
      <td>调用 
        <input name="firstline" type="text" id="firstline" value="<?=$r[firstline]?>" size="6">
        条记录,标题截取 
        <input name="firststrlen" type="text" id="firststrlen" value="<?=$r[firststrlen]?>" size="6">
        个字节, 
        <input name="firstshowdate" type="checkbox" id="firstshowdate" value="1"<?=$firstshowdate?>>
        显示日期</td>
    </tr>
  </table>
  </div>
</div>
  <table width="100%" border="0" align="center" cellpadding="3" cellspacing="1">
    <tr> 
      <td width="100%" height="30"><div align="center"><strong> 
          <input type="submit" name="Submit" value="提交">
          &nbsp;&nbsp;<input type="reset" name="Submit2" value="重置">
          <input type=hidden name=from value="<?=$_GET['from']?>"></strong></div></td>
    </tr>
  </table>
  </form>
</body>
</html>
<?
db_close();
$empire=null;
?>
<?=$hiddenclass?>
