Ejemplo n.º 1
0
     }
 }
 ($hook = vBulletinHook::fetch_hook('group_list_filter')) ? eval($hook) : false;
 $totalgroups = $socialgroupsearch->execute(true);
 $grouplist = '';
 if ($socialgroupsearch->has_errors()) {
     $errorlist = '';
     foreach ($socialgroupsearch->generator->errors as $error) {
         $errorlist .= "<li>{$error}</li>";
     }
     $show['errors'] = $vbulletin->GPC['dofilter'];
     // don't show the error box if we didn't actually do a search
 } else {
     sanitize_pageresults($totalgroups, $pagenumber, $perpage);
     $socialgroupsearch->limit(($pagenumber - 1) * $perpage, $perpage);
     $groups = $socialgroupsearch->fetch_results();
     $show['gminfo'] = $vbulletin->options['socnet_groups_msg_enabled'];
     $show['pictureinfo'] = ($vbulletin->options['socnet'] & $vbulletin->bf_misc_socnet['enable_albums'] and $vbulletin->options['socnet_groups_albums_enabled']) ? true : false;
     $picturealt = $show['gminfo'] ? 'alt2' : 'alt1';
     $lastpostalt = $show['pictureinfo'] ? 'alt1' : 'alt2';
     if (is_array($groups)) {
         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;
             eval('$grouplist .= "' . fetch_template("socialgroups_grouplist_bit") . '";');
         }
     }
     $sorturl = 'group.php?' . $vbulletin->session->vars['sessionurl'] . "do={$doaction}" . ($perpage != 20 ? "&amp;pp={$perpage}" : '');
     if ($vbulletin->GPC['dofilter']) {
Ejemplo n.º 2
0
 // Sort helpers
 $oppositesort = $desc ? 'asc' : 'desc';
 $sorturl = 'groupsubscription.php?' . $vbulletin->session->vars['sessionurl'];
 $orderlinks = array('replies' => $sorturl . '&amp;sort=replies' . ($sortfield == 'replies' ? '&amp;order=' . $oppositesort : ''), 'dateline' => $sorturl . '&amp;sort=dateline' . ($sortfield == 'dateline' ? '&amp;order=' . $oppositesort : ''), 'lastpost' => $sorturl . '&amp;sort=lastpost' . ($sortfield == 'lastpost' ? '&amp;order=' . $oppositesort : ''), 'subscription' => $sorturl . '&amp;sort=subscription' . ($sortfield == 'subscription' ? '&amp;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:
                     $group['notification'] = $vbphrase['none'];
             }
             $templater = vB_Template::create('socialgroups_groupsub_bit');
             $templater->register('group', $group);