<?php
/************************************************************************/
/* Maximus CMS: Web Portal System                                       */
/* ==============================                                       */
/*                                                                      */
/* Copyright (c) 2002 - 2006                                            */
/* http://www.php-maximus.fr                                            */
/* dev@php-maximus.org                                                  */
/*                                                                      */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License.       */
/************************************************************************/
/* Based on PHP-NUKE: Web Portal System                                 */
/************************************************************************/
if (!defined('ADMIN_ALLOW') && !defined('ADMIN_MAX')) {{
    Header("Location: index.php");
}

    $catid = $db->XMFnum($catid);
    $db->sql_query("delete from ".TABLE_STORIES_CAT." where catid='$catid'");
    $result = $db->sql_query("select sid from ".TABLE_STORIES." where catid='$catid'");
    while(list($sid) = $db->sql_fetchrow($result)) {
        $sid = $db->XMFnum($sid);
        $db->sql_query("delete from ".TABLE_STORIES." where catid='$catid'");
        $db->sql_query("delete from ".TABLE_COMMENTS." where sid='$sid'");
    }
    redirect_url("".$admin_file.".php");