<?php
include_once("../inc/config.php");
include_once("../inc/publicfun.php");
include_once("../inc/ftbbsdbclass.php");
include_once("../conn.php");
include_once("check_master.php");
include_once("check_admin_qs.php");

$BBSCateID=$_POST["BBS_Cate_ID"];
$query = "SELECT * FROM {$tablepre}ftbbsmb";
$ftbbsmb=adminmakecache('../cache/ftbbsmb.html',$query,$expire);
$treemb=$ftbbsmb[9];

$sql="select * from {$tablepre}bbs_cate where BBS_Cate_PID='".$BBSCateID."'";
$rs=mysql_query($sql);
$myrow = mysql_fetch_array($rs);
$numrows = mysql_num_rows($rs);
do {
   $BBS_Cate_ID=$myrow["BBS_Cate_ID"];
   $strsql="delete from {$tablepre}bbs_cate where BBS_Cate_ID='".$BBS_Cate_ID."'";
   mysql_query($strsql);
}
while ($myrow = mysql_fetch_array($rs));

$sql="delete from {$tablepre}bbs_cate where BBS_Cate_ID='".$BBSCateID."'";
mysql_query($sql);

include_once("maketree.php");
include_once("makejs.php");
maketotree($treemb);
maketodh();
$db->close();
delcache("../cache/ftbbshome.txt");
delcache("../cache/default_list.txt");
header("Location:".$_SERVER["HTTP_REFERER"]);
?>