exit; } //handle search friends request if ($rand_key != '' && isset($_POST['search_friends_' . $rand_key])) { if (empty($_POST['search_friends_' . $rand_key])) { $msg->addError('CANNOT_BE_EMPTY'); header('Location: ' . url_rewrite(AT_SOCIAL_BASENAME . 'groups/list.php?id=' . $id, AT_PRETTY_URL_IS_HEADER)); exit; } $search_field = $addslashes($_POST['search_friends_' . $rand_key]); $grp_members = $grp_obj->searchMembers($search_field); } //handle delete friends request if (isset($_GET['remove']) && isset($_GET['member_id'])) { //saveguard $member_id = $_GET['member_id']; //validate if this is the creator of group if ($_SESSION['member_id'] == $grp_obj->getUser()) { $grp_obj->removeMember($member_id); $msg->addFeedback('GRUOP_MEMBER_REMOVED'); header('Location: ' . url_rewrite(AT_SOCIAL_BASENAME . 'groups/list.php?id=' . $id, AT_PRETTY_URL_IS_HEADER)); exit; } } include AT_INCLUDE_PATH . 'header.inc.php'; $savant->display('social/pubmenu.tmpl.php'); $savant->assign('grp_obj', $grp_obj); $savant->assign('grp_members', $grp_members); $savant->assign('rand_key', $rand_key); $savant->display('social/sgroup_list.tmpl.php'); include AT_INCLUDE_PATH . 'footer.inc.php';
require AT_SOCIAL_INCLUDE . 'classes/SocialGroups/SocialGroup.class.php'; require AT_SOCIAL_INCLUDE . 'classes/SocialGroups/SocialGroups.class.php'; $_custom_css = $_base_path . AT_SOCIAL_BASENAME . 'module.css'; // use a custom stylesheet //Get group $gid = intval($_REQUEST['id']); $group_obj = new SocialGroup($gid); //check if this group is valid if (!$group_obj->isValid()) { $msg->addError('GROUP_HAS_BEEN_REMOVED'); header('Location: ' . url_rewrite(AT_SOCIAL_BASENAME . 'groups/index.php', AT_PRETTY_URL_HEADER)); exit; } //remove group member if (isset($_GET['remove']) && $_GET['remove'] == 1) { $group_obj->removeMember($_SESSION['member_id']); $msg->addFeedback('LEFT_GROUP_SUCCESSFULLY'); header('Location: ' . url_rewrite(AT_SOCIAL_BASENAME . 'groups/index.php', AT_PRETTY_URL_HEADER)); exit; } //submit message if (isset($_POST['submit'])) { $body = $_POST['msg_body']; if ($body != '') { $group_obj->addMessage($body); } } // delete group if ($_GET['delete'] == "confirm") { //$msg->addConfirm('DELETE_GROUP', $group_obj->getName()); //$msg->addConfirm('DELETE_GROUP', );