<?php try { require '../include/core/common.php'; require_once PATHS_LIBRARIES . 'groups_active.lib.php'; $action = $_GET['action']; switch ($action) { case 'new_post': $auth = group_check_auth($_SESSION['login']['id'], $_POST['groupid'], 1); if ($auth) { $_POST['group_message'] = trim($_POST['group_message']); if (strlen($_POST['group_message']) > 0) { if (isset($_GET['return']) && $_GET['return'] == true) { group_send_new_message($_POST['groupid'], $_SESSION['login']['id'], $_POST['group_message'], false); header('Location: /traffa/groups.php/?action=goto&groupid=' . $_POST['groupid'] . ''); } else { group_send_new_message($_POST['groupid'], $_SESSION['login']['id'], $_POST['group_message']); } $div_code = 'orange'; if (preg_match("/(" . $_SESSION['login']['username'] . "|Magic word: igotgodmodeigotgubbmode)/i", $data['text'])) { $div_code = 'orange_deluxe'; } echo rounded_corners_top(array('color' => $div_code)); echo '<table class="body" style="width: 95%;"><tr><td style="vertical-align: top; width: 75px;">'; echo ui_avatar($_SESSION['login']['id']); echo '</td><td style="vertical-align: top;">'; echo fix_time(time()) . ' <a href="javascript:void(0);" onclick="javascript:document.postform.group_message.value=document.postform.group_message.value + \'' . $data['username'] . ': \';document.postform.group_message.focus();">[^]</a><br/>'; echo '<a href="/traffa/profile.php?id=' . $_SESSION['login']['id'] . '">'; echo '<b>' . ($_SESSION['login']['id'] == 43273 ? '<span style="color: #FF60B6">GheyAtrapp</span>' : $_SESSION['login']['username']) . '</b></a> '; echo ui_birthday_cake($_SESSION['userinfo']['birthday']) . ' '; echo '<br/>';
group_draw_menu(0, NULL, 1); break; case 'create_group': $_POST['take_members'] = isset($_POST['take_members']) ? 0 : 1; group_create_new(htmlspecialchars($_POST['group_name']), $_SESSION['login']['id'], $_POST['take_members'], htmlspecialchars($_POST['description'])); jscript_alert('Din grupp är nu skapad'); jscript_location($_SERVER['PHP_SELF']); break; case 'group_invite': $auth = group_check_admin_auth($_GET['groupid']); if ($auth) { group_invite_member($_GET['groupid'], htmlspecialchars($_POST['inviteuser'])); jscript_location($_SERVER['PHP_SELF'] . '?action=goto&groupid=' . $_GET['groupid']); } case 'invited_member': $auth = group_check_auth($_SESSION['login']['id'], $_GET['groupid'], 3); if ($auth) { group_add_to_group($_GET['groupid'], $_SESSION['login']['id'], 1); jscript_alert('Du är nu medlem i gruppen'); jscript_location($_SERVER['php_self'] . '?action=goto&groupid=' . $_GET['groupid']); } break; case 'save_press': $auth = group_check_admin_auth($_GET['groupid']); if ($auth) { group_press_save(htmlspecialchars($_POST['press_text']), $_GET['groupid']); $_POST['take_new'] = isset($_POST['take_new']) ? 1 : 0; group_change_status($_GET['groupid'], $_POST['take_new'], $_POST['not_member_read_presentation'], $_POST['not_member_read_messages']); jscript_location($_SERVER['PHP_SELF'] . '?action=goto&groupid=' . $_GET['groupid']); } jscript_location($_SERVER['PHP_SELF']);