<?php
/********************************************************/
/* NSN GR Downloads                                     */
/* By: NukeScripts Network (webmaster@nukescripts.net)  */
/* http://www.nukescripts.net                           */
/* Copyright  2000-2005 by NukeScripts Network         */
/********************************************************/
if (!defined('ADMIN_ALLOW') && !defined('ADMIN_MAX')) {
	die ("Access Denied");
}
$crawled = array($cid);
CrawlLevel($cid);
$x=0;
while ($x <= (sizeof($crawled)-1)) {
  $db->sql_query("DELETE FROM ".TABLE_NSNGD_CATEGORIES." WHERE cid='$crawled[$x]'");
  $db->sql_query("DELETE FROM ".TABLE_NSNGD_DOWNLOADS." WHERE cid='$crawled[$x]'");
  $x++;
}
$db->sql_query("OPTIMIZE TABLE ".TABLE_NSNGD_CATEGORIES."");
$db->sql_query("OPTIMIZE TABLE ".TABLE_NSNGD_DOWNLOADS."");
redirect_url("".$admin_file.".php?op=Categories");