예제 #1
0
         $template->assign_vars(array('ERROR' => isset($ERR) ? $ERR : '', 'ID' => '', 'MESSAGE' => ($counter > 0 ? $message : '') . '<p>' . $MSG['838'] . implode(', ', $names) . '</p>', 'TYPE' => 1));
         $template->set_filenames(array('body' => 'confirm.tpl'));
         $template->display('body');
         exit;
     }
     rebuild_cat_file();
     include 'util_cc1.php';
 }
 if ($_POST['action'] == $MSG['030']) {
     //delete categories that are selected
     if (isset($_POST['delete']) && is_array($_POST['delete'])) {
         foreach ($_POST['delete'] as $k => $v) {
             $k = intval($k);
             if ($v == 'delete') {
                 //never delete categories without using this function it will mess up your database big time
                 $catscontrol->delete($k);
             } elseif ($v == 'move') {
                 if (isset($_POST['moveid'][$k]) && !empty($_POST['moveid'][$k]) && is_numeric($_POST['moveid'][$k]) && $catscontrol->check_category($_POST['moveid'][$k])) {
                     // first move the parent
                     $catscontrol->move($k, $_POST['moveid'][$k]);
                     // remove the parent and raise the children up a level
                     $catscontrol->delete($k, true);
                     $query = "UPDATE " . $DBPrefix . "auctions SET category = :cat_new WHERE category = :cat_old";
                     $params = array();
                     $params[] = array(':cat_new', $_POST['moveid'][$k], 'str');
                     $params[] = array(':cat_old', $k, 'int');
                     $db->query($query, $params);
                 } else {
                     $ERR = $MSG['844'];
                 }
             }