standard_error(fetch_error('invalidid', $vbphrase['social_group'], $vbulletin->options['contactuslink'])); } if ($vbulletin->GPC['gmid']) { if ($messageinfo['state'] == 'deleted' and !fetch_socialgroup_modperm('canviewdeleted', $group)) { standard_error(fetch_error('invalidid', $vbphrase['message'], $vbulletin->options['contactuslink'])); } else { if ($messageinfo['state'] == 'moderation' and !fetch_socialgroup_modperm('canmoderategroupmessages', $group) and $messageinfo['postuserid'] != $vbulletin->userinfo['userid']) { standard_error(fetch_error('invalidid', $vbphrase['message'], $vbulletin->options['contactuslink'])); } } } ($hook = vBulletinHook::fetch_hook('group_start_postcheck')) ? eval($hook) : false; // ####################################################################### if ($_REQUEST['do'] == 'grouplist' or $_REQUEST['do'] == 'invitations' or $_REQUEST['do'] == 'requests' or $_REQUEST['do'] == 'moderatedgms') { require_once DIR . '/includes/class_socialgroup_search.php'; $socialgroupsearch = new vB_SGSearch($vbulletin); switch ($_REQUEST['do']) { case 'invitations': if (!$vbulletin->userinfo['userid']) { print_no_permission(); } $socialgroupsearch->add('member', $vbulletin->userinfo['userid']); $socialgroupsearch->add('membertype', 'invited'); $grouplisttitle = $navphrase = $vbphrase['your_invites']; $doaction = 'invitations'; break; case 'requests': $socialgroupsearch->add('creator', $vbulletin->userinfo['userid']); $socialgroupsearch->add('pending', true); $grouplisttitle = $navphrase = $vbphrase['your_groups_in_need_of_attention']; $doaction = 'requests';
unset($bit, $bit_factory, $collection_factory, $collection); // Construct pagenav $pagenavlink = 'groupsubscription.php?' . $vbulletin->session->vars['sessionurl'] . ($perpage ? "pp=" . $perpage : '') . ($sortfield ? "&sort={$sortfield}" : '') . (!$desc ? '&order=asc' : ''); $pagenav = construct_page_nav($pagenumber, $perpage, $totaldiscussions, $pagenavlink); // Sort helpers $oppositesort = $desc ? 'asc' : 'desc'; $sorturl = 'groupsubscription.php?' . $vbulletin->session->vars['sessionurl']; $orderlinks = array('replies' => $sorturl . '&sort=replies' . ($sortfield == 'replies' ? '&order=' . $oppositesort : ''), 'dateline' => $sorturl . '&sort=dateline' . ($sortfield == 'dateline' ? '&order=' . $oppositesort : ''), 'lastpost' => $sorturl . '&sort=lastpost' . ($sortfield == 'lastpost' ? '&order=' . $oppositesort : ''), 'subscription' => $sorturl . '&sort=subscription' . ($sortfield == 'subscription' ? '&order=' . $oppositesort : '')); $templater = vB_Template::create('forumdisplay_sortarrow'); $templater->register('oppositesort', $oppositesort); $sortarrow["{$sortfield}"] = $templater->render(); $group_subscribe_list = ''; if ($pagenumber <= 1) { // show group subscriptions on page one require_once DIR . '/includes/class_socialgroup_search.php'; $socialgroupsearch = new vB_SGSearch($vbulletin); $socialgroupsearch->add('subscribed', $vbulletin->userinfo['userid']); $socialgroupsearch->set_sort('lastpost', 'ASC'); if ($numsocialgroups = $socialgroupsearch->execute(true)) { foreach ($socialgroupsearch->fetch_results() as $group) { $group = prepare_socialgroup($group); $show['lastpostinfo'] = $group['lastpost'] ? true : false; switch ($group['emailupdate']) { case 'daily': $group['notification'] = $vbphrase['daily']; break; case 'weekly': $group['notification'] = $vbphrase['weekly']; break; case 'none': default:
$templater->register('subscribethread', $subscribethread); $templater->register('memberaction_dropdown', $memberaction_dropdown); $templater->register('thread', $thread); $templater->register('threadid', $threadid); $threadbits .= $templater->render(); $numthreads++; } $show['threads'] = true; } } // ############################## start subscribed to groups ################################# $show['socialgroups'] = false; if ($vbulletin->options['socnet'] & $vbulletin->bf_misc_socnet['enable_groups'] and $vbulletin->userinfo['permissions']['socialgrouppermissions'] & $vbulletin->bf_ugp_socialgrouppermissions['canviewgroups'] and $vbulletin->options['socnet_groups_msg_enabled']) { require_once DIR . '/includes/functions_socialgroup.php'; require_once DIR . '/includes/class_socialgroup_search.php'; $socialgroupsearch = new vB_SGSearch($vbulletin); $socialgroupsearch->add('subscribed', $vbulletin->userinfo['userid']); $socialgroupsearch->set_sort('lastpost', 'ASC'); $socialgroupsearch->check_read($vbulletin->options['threadmarking']); ($hook = vBulletinHook::fetch_hook('group_list_filter')) ? eval($hook) : false; if ($numsocialgroups = $socialgroupsearch->execute(true)) { $groups = $socialgroupsearch->fetch_results(); $show['pictureinfo'] = $vbulletin->options['socnet_groups_pictures_enabled'] ? true : false; $lastpostalt = $show['pictureinfo'] ? 'alt2' : 'alt1'; if (is_array($groups)) { $grouplist = ''; foreach ($groups as $group) { $group = prepare_socialgroup($group); $show['pending_link'] = (fetch_socialgroup_modperm('caninvitemoderatemembers', $group) and $group['moderatedmembers'] > 0); $show['lastpostinfo'] = $group['lastpost']; ($hook = vBulletinHook::fetch_hook('group_list_groupbit')) ? eval($hook) : false;
print_select_row($vbphrase['group_type'], 'type', array('' => '', 'public' => $vbphrase['group_type_public'], 'moderated' => $vbphrase['group_type_moderated'], 'inviteonly' => $vbphrase['group_type_inviteonly'])); print_submit_row($vbphrase['search']); print_cp_footer(); } // ####################################################################### if ($_REQUEST['do'] == 'groupsby' and !empty($vbulletin->GPC['userid'])) { if (verify_id('user', $vbulletin->GPC['userid'], false)) { $vbulletin->GPC['creatoruserid'] = $vbulletin->GPC['userid']; $_REQUEST['do'] = 'dosearch'; } else { print_cp_message($vbphrase['invalid_username']); } } // ####################################################################### if ($_REQUEST['do'] == 'dosearch') { $socialgroupsearch = new vB_SGSearch($vbulletin); $vbulletin->input->clean_array_gpc('r', array('filtertext' => TYPE_NOHTML, 'category' => TYPE_UINT, 'members_lteq' => TYPE_UINT, 'members_gteq' => TYPE_UINT, 'date_gteq' => TYPE_UNIXTIME, 'date_lteq' => TYPE_UNIXTIME, 'creator' => TYPE_NOHTML, 'type' => TYPE_NOHTML)); if ($vbulletin->GPC['creator'] != '') { $user = $vbulletin->db->query_first_slave("SELECT userid FROM " . TABLE_PREFIX . "user WHERE username = '******'creator']) . "'"); if (!empty($user['userid'])) { $vbulletin->GPC['creatoruserid'] = $user['userid']; } else { print_cp_message($vbphrase['invalid_username']); } } $filters = array(); if (!empty($vbulletin->GPC['filtertext'])) { $filters['text'] = $vbulletin->GPC['filtertext']; } if ($vbulletin->GPC['category']) { $filters['category'] = $vbulletin->GPC['category'];