예제 #1
0
        $subpage = "waiting";
    }
} else {
    $subpage = "leave";
    if ($group->groupmember_info['groupmember_status'] == 0) {
        $subpage = "confirm";
    }
}
// LEAVE GROUP
if ($task == "leave_do" && $subpage == "leave") {
    $database->database_query("DELETE FROM se_groupmembers WHERE groupmember_group_id='{$group->group_info['group_id']}' AND groupmember_user_id='{$user->user_info['user_id']}' LIMIT 1");
    $database->database_query("DELETE FROM se_groupsubscribes WHERE groupsubscribe_group_id='{$group->group_info['group_id']}' AND groupsubscribe_user_id='{$user->user_info['user_id']}'");
    $database->database_query("UPDATE se_groups SET group_totalmembers=group_totalmembers-1 WHERE group_id='{$group->group_info['group_id']}' LIMIT 1");
    // IF USER IS OWNER OF GROUP, DELETE THE GROUP
    if ($group->user_rank == 2) {
        $group->group_delete();
    }
    // INSERT ACTION
    $group_title_short = $group->group_info['group_title'];
    if (strlen($group_title_short) > 100) {
        $group_title_short = substr($group_title_short, 0, 97);
        $group_title_short .= "...";
    }
    $actions->actions_add($user, "leavegroup", array($user->user_info['user_username'], $user->user_displayname, $group->group_info['group_id'], $group_title_short), array(), 0, false, "group", $group->group_info['group_id'], $group->group_info['group_privacy']);
    // SET RESULT
    $result = 2000161;
} elseif ($task == "accept_do" && $subpage == "confirm") {
    // JOIN GROUP
    $database->database_query("UPDATE se_groupmembers SET groupmember_status='1', groupmember_approved='1' WHERE groupmember_user_id='{$user->user_info['user_id']}' AND groupmember_group_id='{$group->group_info['group_id']}'");
    $database->database_query("UPDATE se_groups SET group_totalmembers=group_totalmembers+1 WHERE group_id='{$group->group_info['group_id']}' LIMIT 1");
    // INSERT ACTION
예제 #2
0
if (~(int) $user->level_info['level_group_allow'] & 2) {
    header("Location: user_home.php");
    exit;
}
// INITIALIZE GROUP OBJECT
$group = new se_group($user->user_info[user_id], $group_id);
if (!$group->group_exists || $group->user_rank <= 0) {
    header("Location: user_group.php");
    exit;
}
// INITIALIZE VARIABLES
$is_error = 0;
$result = 0;
// DELETE GROUP
if ($task == "delete_do" && $group->user_rank == 2) {
    $group->group_delete($group->group_info[group_id]);
    header("Location: user_group.php");
    exit;
}
// DELETE PHOTO
if ($task == "remove" && $group->groupowner_level_info['level_group_photo'] != 0) {
    $group->group_photo_delete();
    $group->group_lastupdate();
}
// UPLOAD PHOTO
if ($task == "upload" && $group->groupowner_level_info['level_group_photo'] != 0) {
    $group->group_photo_upload("photo");
    $is_error = $group->is_error;
    if ($is_error == 0) {
        $group->group_lastupdate();
    }
예제 #3
0
    $task = "main";
}
if (isset($_POST['group_id'])) {
    $group_id = $_POST['group_id'];
} elseif (isset($_GET['group_id'])) {
    $group_id = $_GET['group_id'];
} else {
    $group_id = 0;
}
// CREATE GROUP OBJECT
$groups_per_page = 100;
$group = new se_group();
// DELETE ALBUM
if ($task == "deletegroup") {
    if ($database->database_num_rows($database->database_query("SELECT group_id FROM se_groups WHERE group_id='{$group_id}'"))) {
        $group->group_delete($group_id);
    }
}
// SET USER GROUP SORT-BY VARIABLES FOR HEADING LINKS
$i = "id";
// GROUP_ID
$t = "t";
// GROUP_TITLE
$o = "o";
// OWNER OF GROUP
$m = "m";
// MEMBERS IN GROUP
$d = "d";
// CREATION DATE OF GROUP
// SET SORT VARIABLE FOR DATABASE QUERY
if ($s == "i") {
예제 #4
0
function deleteuser_group($user_id)
{
    global $database;
    // INITATE GROUP OBJECT
    $group = new se_group($user_id);
    // LOOP OVER GROUPS AND DELETE THEM
    $groups = $database->database_query("SELECT group_id FROM se_groups WHERE group_user_id='{$user_id}'");
    while ($group_info = $database->database_fetch_assoc($groups)) {
        $group->group_delete($group_info['group_id']);
    }
    // DELETE USER FROM ALL GROUPS
    $database->database_query("DELETE FROM se_groupmembers WHERE groupmember_user_id='{$user_id}'");
    $database->database_query("DELETE FROM se_groupsubscribes WHERE groupsubscribe_user_id='{$user_id}'");
    $database->database_query("UPDATE se_groupmediatags SET groupmediatag_user_id='0' WHERE groupmediatag_user_id='{$user_id}'");
}