$missing_fields = implode(', ', $missing_fields); $msg->addError(array('EMPTY_FIELDS', $missing_fields)); } else { if ($_POST['group_privacy'] == "private") { $privacy = 1; } else { if ($_POST['group_privacy'] == "public") { $privacy = 0; } } $group_id = $social_groups->addGroup($_POST['group_type'], $_POST['group_name'], $_POST['description'], $privacy); if ($group_id) { //Add the logo in now that we have the group id. And rename the old one. if ($thumbnail_img != '') { $new_group = new SocialGroup($group_id); $new_group->updateGroupLogo($group_id . '.' . $extension); $new_location = AT_CONTENT_DIR . 'social/' . $group_id . '.' . $extension; copy($thumbnail_img, $new_location); unlink($thumbnail_img); } $msg->addFeedback('GROUP_CREATED'); header('Location: index.php'); exit; } else { //Something went bad in the backend, contact admin? $msg->addError('GROUP_CREATION_FAILED'); } } } //Display include AT_INCLUDE_PATH . 'header.inc.php';