<?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");
}

    $title = ereg_replace("\"","",$title);
    $result = $db->sql_query("select catid from ".TABLE_STORIES_CAT." where title='$title'");
    $catid = $db->XMFnum($catid);
        $check = $db->sql_numrows($result);
    if ($check) {
        $what1 = _CATEXISTS;
        $what2 = _GOBACK;
    } else {
        $what1 = _CATSAVED;
        $what2 = "[ <a href=\"".$admin_file.".php\">"._GOTOADMIN."</a> ]";
        $result = $db->sql_query("update ".TABLE_STORIES_CAT." set title='$title' where catid='$catid'");
        if (!$result) {
            return;
        }
    }
    incoh();
    GraphicAdmin();
    Max_OpenTable();
    echo "<center><font class='title'><b>"._CATEGORIESADMIN."</b></font></center>";
    Max_CloseTable();
    br('1');
    Max_OpenTable();
    echo "<center><font class=\"content\"><b>$what1</b></font><br /><br />";
    echo "$what2</center>";
    Max_CloseTable();
    incof();