/** * @desc Eliminar un foro */ function bx_delete_forums() { global $tpl, $xoopsModule, $xoopsConfig, $xoopsSecurity; $ids = rmc_server_var($_REQUEST, 'ids', 0); if (!$xoopsSecurity->check()) { redirectMsg('forums.php', __('Session token expired!', 'bxpress'), 1); die; } $errors = ''; foreach ($ids as $id) { $forum = new bXForum($id); if ($forum->isNew()) { $errors .= sprintf(__('Forum with id "%u" does not exists!', 'bxpress'), $id); die; } if (!$forum->delete()) { $errors = sprintf(__('Forum "%s" could not be deleted!', 'bxpress'), $forum->name()) . '<br />' . $forum->errors(); } } if ($errors != '') { redirectMsg('forums.php', __('Errors ocurred while trying to delete forums:', 'bxpress') . '<br />' . $errors, 1); } else { redirectMsg('forums.php', __('Forums deleted without errors', 'bxpress'), 0); } }