require(AT_SOCIAL_INCLUDE.'constants.inc.php'); require(AT_SOCIAL_INCLUDE.'friends.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 social group class $social_groups = new SocialGroups(); // Get this group $id = intval($_REQUEST['id']); //make sure $_GET and $_POST don't overlap the use of 'id' $group = new SocialGroup($id); //validate if this user is the administrator of the group if ($group->getUser() != $_SESSION['member_id']){ $msg->addError('CANT_EDIT_GROUP'); header('Location: index.php'); exit; } //TODO //validate the group_admin is indeed a group member function resize_image($src, $dest, $src_h, $src_w, $dest_h, $dest_w, $type) { $thumbnail_img = imagecreatetruecolor($dest_w, $dest_h); if ($type == 'gif') { $source = imagecreatefromgif($src); } else if ($type == 'jpg') { $source = imagecreatefromjpeg($src);
<div class="headingbox"><h3><a href="<?php echo url_rewrite(AT_SOCIAL_BASENAME . 'groups/index.php'); ?> "><?php echo _AT('my_groups'); ?> </a></h3></div> <div class="contentbox"> <?php foreach ($this->my_groups as $i => $grp) { $grp_obj = new SocialGroup($grp); ?> <div class="contact_mini"> <?php if ($grp_obj->getUser() == $_SESSION['member_id']) { ?> <div style="float:right;margin:1em;"><a href="<?php echo $_base_href . AT_SOCIAL_BASENAME; ?> groups/edit.php?id=<?php echo $grp; ?> "><img src="<?php echo $_base_href . AT_SOCIAL_BASENAME; ?> images/icon-settings.png" alt="<?php echo _AT('settings'); ?> " title="<?php echo _AT('settings'); ?>
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';
$_user_location = 'public'; define('AT_INCLUDE_PATH', '../../../../include/'); require AT_INCLUDE_PATH . 'vitals.inc.php'; require AT_SOCIAL_INCLUDE . 'constants.inc.php'; require AT_SOCIAL_INCLUDE . 'friends.inc.php'; require AT_SOCIAL_INCLUDE . 'classes/SocialGroups/SocialGroup.class.php'; require AT_SOCIAL_INCLUDE . 'classes/SocialGroups/SocialGroups.class.php'; // Get social group class $social_groups = new SocialGroups(); // Get this group $id = intval($_REQUEST['id']); //make sure $_GET and $_POST don't overlap the use of 'id' $sg = new SocialGroup($id); $sgs = new SocialGroups(); //validate if this user is the administrator of the group if ($sg->getUser() != $_SESSION['member_id']) { $msg->addError('CANT_DELETE_GROUP'); header('Location: index.php'); exit; } //delete group $msg->addFeedback('GROUP_DELETED'); $sgs->removeGroup($id); header('Location: ' . url_rewrite(AT_SOCIAL_BASENAME . 'groups/index.php', AT_PRETTY_URL_HEADER)); exit; //Display /* include(AT_INCLUDE_PATH.'header.inc.php'); $savant->assign('group_obj', $group); $savant->assign('group_types', $social_groups->getAllGroupType()); $savant->display('sgroup_edit.tmpl.php');