Beispiel #1
0
 /**
  * Standard modular run function for rendering a search result.
  *
  * @param  array		The data row stored when we retrieved the result
  * @return tempcode	The output
  */
 function render($row)
 {
     $leader = $GLOBALS['FORUM_DRIVER']->member_profile_hyperlink($row['g_group_leader']);
     require_code('ocf_groups');
     $group_name = ocf_get_group_name($row['id']);
     require_code('ocf_groups2');
     $num_members = ocf_get_group_members_raw_count($row['id'], false, false, true, false);
     $summary = do_lang_tempcode($row['g_open_membership'] == 1 ? 'CLUB_WITH_MEMBERS_OPEN' : 'CLUB_WITH_MEMBERS_APPROVAL', escape_html($group_name), escape_html(integer_format($num_members)), $leader);
     $url = build_url(array('page' => 'groups', 'type' => 'view', 'id' => $row['id']), get_module_zone('groups'));
     return do_template('SIMPLE_PREVIEW_BOX', array('SUMMARY' => $summary, 'URL' => $url));
 }
Beispiel #2
0
 /**
  * The UI to show a usergroup.
  *
  * @return tempcode		The UI
  */
 function usergroup()
 {
     $id = get_param_integer('id');
     if ($id == db_get_first_id()) {
         warn_exit(do_lang_tempcode('INTERNAL_ERROR'));
     }
     $map = has_specific_permission(get_member(), 'see_hidden_groups') ? array('id' => $id) : array('id' => $id, 'g_hidden' => 0);
     $groups = $GLOBALS['FORUM_DB']->query_select('f_groups', array('*'), $map, '', 1);
     if (!array_key_exists(0, $groups)) {
         warn_exit(do_lang_tempcode('MISSING_RESOURCE'));
     }
     $group = $groups[0];
     $club = $group['g_is_private_club'] == 1;
     $name = get_translated_text($group['g_name'], $GLOBALS['FORUM_DB']);
     $title = get_page_title($club ? 'CLUB' : 'USERGROUP', true, array(escape_html($name)));
     // Leadership
     if (!is_null($group['g_group_leader']) && !is_null($GLOBALS['FORUM_DRIVER']->get_username($group['g_group_leader']))) {
         $leader_name = $GLOBALS['FORUM_DRIVER']->get_username($group['g_group_leader']);
         if (is_null($leader_name)) {
             $leader_name = do_lang('UNKNOWN');
         }
         $leader_url = build_url(array('page' => 'members', 'type' => 'view', 'id' => $group['g_group_leader']), get_module_zone('members'));
         $leader_link = hyperlink($leader_url, $leader_name, false, true);
         $leader = paragraph(do_lang_tempcode('GROUP_LED_BY', $leader_link), 'gfgdfggdf');
     } else {
         $leader = new ocp_tempcode();
     }
     // Promotion
     if (addon_installed('points') && !is_null($group['g_promotion_threshold']) && !is_null($group['g_promotion_target'])) {
         $promote_link = ocf_get_group_link($group['g_promotion_target']);
         $promotion_info = do_lang_tempcode('OCF_PROMOTION_INFO', integer_format($group['g_promotion_threshold']), $promote_link->evaluate());
     } else {
         $promotion_info = new ocp_tempcode();
     }
     // To add
     if (ocf_may_control_group($id, get_member())) {
         $add_url = build_url(array('page' => '_SELF', 'type' => 'add_to', 'id' => $id), '_SELF');
     } else {
         $add_url = new ocp_tempcode();
     }
     // To apply
     $my_groups = $GLOBALS['FORUM_DRIVER']->get_members_groups(get_member(), false, false);
     if (is_guest()) {
         $apply_url = new ocp_tempcode();
         $apply_text = new ocp_tempcode();
     } else {
         if (!in_array($id, $my_groups)) {
             $apply_url = build_url(array('page' => '_SELF', 'type' => 'apply', 'id' => $id), '_SELF');
             $apply_text = do_lang_tempcode('APPLY_TO_GROUP');
         } elseif (ocf_get_member_primary_group(get_member()) != $id) {
             $apply_url = build_url(array('page' => '_SELF', 'type' => 'resign', 'id' => $id), '_SELF');
             $apply_text = do_lang_tempcode('RESIGN_FROM_GROUP');
         } else {
             $apply_url = new ocp_tempcode();
             $apply_text = new ocp_tempcode();
         }
     }
     require_code('templates_results_table');
     $sortables = array();
     list($sortable, $sort_order) = explode(' ', get_param('p_sort', 'date_and_time DESC'));
     // Primary members
     $start = get_param_integer('p_start', 0);
     $max = get_param_integer('p_max', 50);
     $_primary_members = ocf_get_group_members_raw($id, true, true, false, false, $max, $start);
     if (count($_primary_members) > 0) {
         $max_rows = ocf_get_group_members_raw_count($id, true, true, false, false);
         $primary_members = new ocp_tempcode();
         foreach ($_primary_members as $i => $primary_member) {
             $url = $GLOBALS['FORUM_DRIVER']->member_profile_url($primary_member['gm_member_id'], false, true);
             $temp = do_template('OCF_VIEW_GROUP_MEMBER', array('_GUID' => 'b96b674ac713e9790ecb78c15af1baab', 'NAME' => $primary_member['m_username'], 'URL' => $url));
             $primary_members->attach(results_entry(array($temp)));
         }
         $fields_title = results_field_title(array(do_lang_tempcode('PRIMARY_MEMBERS')), $sortables, 'p_sort', $sortable . ' ' . $sort_order);
         $primary_members = results_table(do_lang_tempcode('PRIMARY_MEMBERS'), $start, 'p_start', $max, 'p_max', $max_rows, $fields_title, $primary_members, $sortables, $sortable, $sort_order, 'p_sort', NULL, NULL, NULL, 6);
     } else {
         $primary_members = new ocp_tempcode();
     }
     $edit_url = new ocp_tempcode();
     $s_start = get_param_integer('s_start', 0);
     $s_max = get_param_integer('s_max', 50);
     $_secondary_members = ocf_get_group_members_raw($id, false, true, true, ocf_may_control_group($id, get_member()), $s_max, $s_start);
     $secondary_members = new ocp_tempcode();
     $prospective_members = new ocp_tempcode();
     $s_max_rows = ocf_get_group_members_raw_count($id, false, false, true, ocf_may_control_group($id, get_member()));
     $d_max_rows = ocf_get_group_members_raw_count($id, false, true, true, ocf_may_control_group($id, get_member()));
     foreach ($_secondary_members as $secondary_member) {
         $m_username = $GLOBALS['FORUM_DRIVER']->get_member_row_field($secondary_member['gm_member_id'], 'm_username');
         if (is_null($m_username)) {
             continue;
         }
         if ($secondary_member['gm_validated'] == 1) {
             $url = $GLOBALS['FORUM_DRIVER']->member_profile_url($secondary_member['gm_member_id'], false, true);
             $remove_url = build_url(array('page' => '_SELF', 'type' => 'remove_from', 'id' => $id, 'member_id' => $secondary_member['gm_member_id']), '_SELF');
             $temp = do_template('OCF_VIEW_GROUP_MEMBER' . (ocf_may_control_group($id, get_member()) ? '_SECONDARY' : ''), array('REMOVE_URL' => $remove_url, 'NAME' => $m_username, 'URL' => $url));
             $secondary_members->attach(results_entry(array($temp)));
         } elseif (!$add_url->is_empty()) {
             $url = $GLOBALS['FORUM_DRIVER']->member_profile_url($secondary_member['gm_member_id'], false, true);
             $accept_url = build_url(array('page' => '_SELF', 'type' => 'accept', 'id' => $id, 'member_id' => $secondary_member['gm_member_id']), '_SELF');
             $decline_url = build_url(array('page' => '_SELF', 'type' => 'decline', 'id' => $id, 'member_id' => $secondary_member['gm_member_id']), '_SELF');
             $temp = do_template('OCF_VIEW_GROUP_MEMBER_PROSPECTIVE', array('_GUID' => '16e93cf50a14e3b6a3bdf31525fd5e7f', 'ACCEPT_URL' => $accept_url, 'DECLINE_URL' => $decline_url, 'NAME' => $m_username, 'URL' => $url));
             $prospective_members->attach(results_entry(array($temp)));
         }
     }
     if (!$secondary_members->is_empty()) {
         $fields_title = results_field_title(array(do_lang_tempcode('SECONDARY_MEMBERS')), $sortables, 'p_sort', $sortable . ' ' . $sort_order);
         $secondary_members = results_table(do_lang_tempcode('SECONDARY_MEMBERS'), $s_start, 's_start', $s_max, 's_max', $s_max_rows, $fields_title, $secondary_members, $sortables, $sortable, $sort_order, 's_sort', NULL, NULL, NULL, 6);
     }
     if (!$prospective_members->is_empty()) {
         $fields_title = results_field_title(array(do_lang_tempcode('PROSPECTIVE_MEMBERS')), $sortables, 'p_sort', $sortable . ' ' . $sort_order);
         $prospective_members = results_table(do_lang_tempcode('PROSPECTIVE_MEMBERS'), $s_start, 's_start', $s_max, 's_max', $d_max_rows, $fields_title, $prospective_members, $sortables, $sortable, $sort_order, 'd_sort', NULL, NULL, NULL, 6);
     } elseif (has_actual_page_access(get_member(), 'cms_ocf_groups', get_module_zone('cms_ocf_groups'))) {
         $is_super_admin = $group['g_is_super_admin'];
         if (!has_specific_permission(get_member(), 'control_usergroups') || $is_super_admin == 1) {
             $leader_tmp = $group['g_group_leader'];
             if ($leader_tmp == get_member()) {
                 $edit_url = build_url(array('page' => 'cms_ocf_groups', 'type' => '_ed', 'id' => $id), get_module_zone('cms_ocf_groups'));
             }
         } else {
             $edit_url = build_url(array('page' => 'cms_ocf_groups', 'type' => '_ed', 'id' => $id), get_module_zone('cms_ocf_groups'));
         }
     }
     breadcrumb_set_self(make_string_tempcode(escape_html($name)));
     breadcrumb_set_parents(array(array('_SELF:_SELF:misc', do_lang_tempcode('USERGROUPS'))));
     if (has_actual_page_access(get_member(), 'admin_ocf_groups', get_module_zone('admin_ocf_groups'))) {
         $edit_url = build_url(array('page' => 'admin_ocf_groups', 'type' => '_ed', 'id' => $id), get_module_zone('admin_ocf_groups'));
     }
     $club_forum = NULL;
     if ($group['g_is_private_club'] == 1) {
         $club_forum = $GLOBALS['FORUM_DB']->query_value_null_ok('f_forums f LEFT JOIN ' . $GLOBALS['FORUM_DB']->get_table_prefix() . 'translate t ON t.id=f.f_description', 'f.id', array('text_original' => do_lang('FORUM_FOR_CLUB', $name)));
     }
     $group_name = get_translated_text($group['g_name'], $GLOBALS['FORUM_DB']);
     $GLOBALS['META_DATA'] += array('created' => '', 'creator' => is_null($group['g_group_leader']) ? '' : $GLOBALS['FORUM_DRIVER']->get_username($group['g_group_leader']), 'publisher' => '', 'modified' => '', 'type' => 'Usergroup', 'title' => $group_name, 'identifier' => '_SEARCH:groups:view:' . strval($id), 'description' => '', 'image' => find_theme_image('bigicons/usergroups'));
     require_javascript('javascript_ajax');
     require_javascript('javascript_ajax_people_lists');
     $forum_id = NULL;
     if ($club) {
         $forum_id = $GLOBALS['FORUM_DB']->query_value_null_ok('f_forums', 'id', array('f_name' => $group_name, 'f_category_id' => intval(get_option('club_forum_parent_category')), 'f_parent_forum' => intval(get_option('club_forum_parent_forum'))));
     }
     return do_template('OCF_VIEW_GROUP_SCREEN', array('_GUID' => 'fc6cac5c73f92ab4410b492d58976dbe', 'GROUP_NAME' => $group_name, 'ID' => strval($id), 'FORUM' => is_null($forum_id) ? '' : strval($forum_id), 'CLUB' => $club, 'EDIT_URL' => $edit_url, 'TITLE' => $title, 'LEADER' => $leader, 'PROMOTION_INFO' => $promotion_info, 'ADD_URL' => $add_url, 'APPLY_URL' => $apply_url, 'APPLY_TEXT' => $apply_text, 'PRIMARY_MEMBERS' => $primary_members, 'SECONDARY_MEMBERS' => $secondary_members, 'PROSPECTIVE_MEMBERS' => $prospective_members));
 }
Beispiel #3
0
 /**
  * The UI to show the member directory.
  *
  * @return tempcode		The UI
  */
 function directory()
 {
     require_javascript('javascript_ajax');
     require_javascript('javascript_ajax_people_lists');
     $title = get_page_title('MEMBERS');
     require_code('templates_internalise_screen');
     $test_tpl = internalise_own_screen($title);
     if (is_object($test_tpl)) {
         return $test_tpl;
     }
     if (running_script('iframe')) {
         $get_url = find_script('iframe');
     } else {
         $get_url = find_script('index');
     }
     $hidden = new ocp_tempcode();
     $hidden->attach(build_keep_form_fields('_SELF', true, array('filter')));
     $hidden->attach(form_input_hidden('zone', get_zone_name()));
     $start = get_param_integer('md_start', 0);
     $max = get_param_integer('md_max', 50);
     $sortables = array('m_username' => do_lang_tempcode('USERNAME'), 'm_primary_group' => do_lang_tempcode('PRIMARY_GROUP'), 'm_cache_num_posts' => do_lang_tempcode('COUNT_POSTS'), 'm_join_time' => do_lang_tempcode('JOIN_DATE'));
     $default_sort_order = get_value('md_default_sort_order');
     if (is_null($default_sort_order)) {
         $default_sort_order = 'm_join_time DESC';
     }
     $test = explode(' ', get_param('md_sort', $default_sort_order), 2);
     if (count($test) == 1) {
         $test[] = 'ASC';
     }
     list($sortable, $sort_order) = $test;
     if (strtoupper($sort_order) != 'ASC' && strtoupper($sort_order) != 'DESC' || !array_key_exists($sortable, $sortables)) {
         log_hack_attack_and_exit('ORDERBY_HACK');
     }
     global $NON_CANONICAL_PARAMS;
     $NON_CANONICAL_PARAMS[] = 'md_sort';
     $group_filter = get_param('group_filter', '');
     $_usergroups = $GLOBALS['FORUM_DRIVER']->get_usergroup_list(true, false, false, $group_filter == '' ? NULL : array(intval($group_filter)));
     $usergroups = array();
     require_code('ocf_groups2');
     foreach ($_usergroups as $group_id => $group) {
         $num = ocf_get_group_members_raw_count($group_id, true);
         $usergroups[$group_id] = array('USERGROUP' => $group, 'NUM' => strval($num));
     }
     $query = 'FROM ' . $GLOBALS['FORUM_DB']->get_table_prefix() . 'f_members WHERE id<>' . strval(db_get_first_id());
     if (!has_specific_permission(get_member(), 'see_unvalidated')) {
         $query .= ' AND m_validated=1';
     }
     if ($group_filter != '') {
         if (is_numeric($group_filter)) {
             $title = get_page_title('USERGROUP', true, array(escape_html($usergroups[intval($group_filter)]['USERGROUP'])));
         }
         require_code('ocfiltering');
         $filter = ocfilter_to_sqlfragment($group_filter, 'm_primary_group', 'f_groups', NULL, 'm_primary_group', 'id');
         $query .= ' AND ' . $filter;
     }
     $search = get_param('filter', '');
     $sup = $search != '' ? ' AND m_username LIKE \'' . db_encode_like(str_replace('*', '%', $search)) . '\'' : '';
     if ($sortable == 'm_join_time') {
         $query .= $sup . ' ORDER BY m_join_time ' . $sort_order . ',' . 'id ' . $sort_order;
     } else {
         $query .= $sup . ' ORDER BY ' . $sortable . ' ' . $sort_order;
     }
     $max_rows = $GLOBALS['FORUM_DB']->query_value_null_ok_full('SELECT COUNT(*) ' . $query);
     $rows = $GLOBALS['FORUM_DB']->query('SELECT * ' . $query, $max, $start);
     if (count($rows) == 0) {
         return inform_screen($title, do_lang_tempcode('NO_RESULTS'));
     }
     $members = new ocp_tempcode();
     $member_boxes = array();
     require_code('templates_results_table');
     $fields_title = results_field_title(array(do_lang_tempcode('USERNAME'), do_lang_tempcode('PRIMARY_GROUP'), do_lang_tempcode('COUNT_POSTS'), do_lang_tempcode('JOIN_DATE')), $sortables, 'md_sort', $sortable . ' ' . $sort_order);
     require_code('ocf_members2');
     foreach ($rows as $row) {
         $link = $GLOBALS['FORUM_DRIVER']->member_profile_hyperlink($row['id'], true, $row['m_username']);
         if ($row['m_validated'] == 0) {
             $link->attach(do_lang_tempcode('MEMBER_IS_UNVALIDATED'));
         }
         if ($row['m_validated_email_confirm_code'] != '') {
             $link->attach(do_lang_tempcode('MEMBER_IS_UNCONFIRMED'));
         }
         $member_primary_group = ocf_get_member_primary_group($row['id']);
         $primary_group = ocf_get_group_link($member_primary_group);
         $members->attach(results_entry(array($link, $primary_group, escape_html(integer_format($row['m_cache_num_posts'])), escape_html(get_timezoned_date($row['m_join_time'])))));
         $member_boxes[] = ocf_show_member_box($row['id'], true);
     }
     $results_table = results_table(do_lang_tempcode('MEMBERS'), $start, 'md_start', $max, 'md_max', $max_rows, $fields_title, $members, $sortables, $sortable, $sort_order, 'md_sort');
     $results_browser = results_browser(do_lang_tempcode('MEMBERS'), NULL, $start, 'md_start', $max, 'md_max', $max_rows, NULL, NULL, true, true);
     $symbols = NULL;
     if (get_option('allow_alpha_search') == '1') {
         $alpha_query = $GLOBALS['FORUM_DB']->query('SELECT m_username FROM ' . $GLOBALS['FORUM_DB']->get_table_prefix() . 'f_members WHERE id<>' . strval(db_get_first_id()) . ' ORDER BY m_username ASC');
         $symbols = array(array('START' => '0', 'SYMBOL' => do_lang('ALL')), array('START' => '0', 'SYMBOL' => '#'));
         foreach (array('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z') as $s) {
             foreach ($alpha_query as $i => $q) {
                 if (strtolower(substr($q['m_username'], 0, 1)) == $s) {
                     break;
                 }
             }
             if (substr(strtolower($q['m_username']), 0, 1) != $s) {
                 $i = intval($symbols[count($symbols) - 1]['START']);
             }
             $symbols[] = array('START' => strval(intval($max * floor(floatval($i) / floatval($max)))), 'SYMBOL' => $s);
         }
     }
     return do_template('OCF_MEMBER_DIRECTORY_SCREEN', array('_GUID' => '096767e9aaabce9cb3e6591b7bcf95b8', 'MAX' => strval($max), 'RESULTS_BROWSER' => $results_browser, 'MEMBER_BOXES' => $member_boxes, 'USERGROUPS' => $usergroups, 'HIDDEN' => $hidden, 'SYMBOLS' => $symbols, 'SEARCH' => $search, 'GET_URL' => $get_url, 'TITLE' => $title, 'RESULTS_TABLE' => $results_table));
 }
Beispiel #4
0
/**
 * Get form fields for adding/editing a chatroom.
 *
 * @param  boolean		Whether the room is being made as a private room by the current member
 * @param  SHORT_TEXT	The room name
 * @param  LONG_TEXT		The welcome message
 * @param  SHORT_TEXT	The owner username
 * @param  LONG_TEXT		The comma-separated list of users that may access it (blank: no restriction)
 * @param  LONG_TEXT		The comma-separated list of usergroups that may access it (blank: no restriction)
 * @param  LONG_TEXT		The comma-separated list of users that may NOT access it (blank: no restriction)
 * @param  LONG_TEXT		The comma-separated list of usergroups that may NOT access it (blank: no restriction)
 * @return tempcode		The fields
 */
function get_chatroom_fields($is_made_by_me = false, $room_name = '', $welcome = '', $username = '', $allow2 = '', $allow2_groups = '', $disallow2 = '', $disallow2_groups = '')
{
    require_code('form_templates');
    $fields = new ocp_tempcode();
    $fields->attach(form_input_line(do_lang_tempcode('ROOM_NAME'), do_lang_tempcode('DESCRIPTION_ROOM_NAME'), 'room_name', $room_name, true));
    $fields->attach(form_input_line_comcode(do_lang_tempcode('WELCOME_MESSAGE'), do_lang_tempcode('DESCRIPTION_WELCOME_MESSAGE'), 'c_welcome', $welcome, false));
    if (!$is_made_by_me) {
        $fields->attach(form_input_username(do_lang_tempcode('ROOM_OWNER'), do_lang_tempcode('DESCRIPTION_ROOM_OWNER'), 'room_owner', $username, false));
    }
    $langs = find_all_langs();
    if (count($langs) > 1) {
        $fields->attach(form_input_list(do_lang_tempcode('ROOM_LANG'), do_lang_tempcode('DESCRIPTION_ROOM_LANG'), 'room_lang', nice_get_langs()));
    }
    require_lang('permissions');
    $fields->attach(do_template('FORM_SCREEN_FIELD_SPACER', array('SECTION_HIDDEN' => $allow2 == '' && $allow2_groups == '' && !$is_made_by_me, 'TITLE' => do_lang_tempcode($is_made_by_me ? 'PERMISSIONS' : 'LOWLEVEL_PERMISSIONS'))));
    $fields->attach(form_input_username_multi(do_lang_tempcode('ALLOW_LIST'), do_lang_tempcode('DESCRIPTION_ALLOW_LIST'), 'allow_list', array_map(array($GLOBALS['FORUM_DRIVER'], 'get_username'), $allow2 == '' ? array() : array_map('intval', explode(',', $allow2))), 0, true));
    if (!$is_made_by_me || get_option('group_private_chatrooms') == '1') {
        $usergroup_list = new ocp_tempcode();
        $groups = $GLOBALS['FORUM_DRIVER']->get_usergroup_list(true);
        foreach ($groups as $key => $val) {
            if ($key != db_get_first_id()) {
                if (get_forum_type() == 'ocf') {
                    require_code('ocf_groups2');
                    $num_members = ocf_get_group_members_raw_count($key);
                    if ($num_members >= 1 && $num_members <= 6) {
                        $group_members = ocf_get_group_members_raw($key);
                        $group_member_usernames = '';
                        foreach ($group_members as $group_member) {
                            if ($group_member_usernames != '') {
                                $group_member_usernames = do_lang('LIST_SEP');
                            }
                            $group_member_usernames .= $GLOBALS['FORUM_DRIVER']->get_username($group_member);
                        }
                        $val = do_lang('GROUP_MEMBERS_SPECIFIC', $val, $group_member_usernames);
                    } else {
                        $val = do_lang('GROUP_MEMBERS', $val, number_format($num_members));
                    }
                }
                $usergroup_list->attach(form_input_list_entry(strval($key), $allow2_groups == '*' || count(array_intersect(array($key), $allow2_groups == '' ? array() : explode(',', $allow2_groups))) != 0, $val));
            }
        }
        $fields->attach(form_input_multi_list(do_lang_tempcode('ALLOW_LIST_GROUPS'), do_lang_tempcode($is_made_by_me ? 'DESCRIPTION_ALLOW_LIST_GROUPS_SIMPLE' : 'DESCRIPTION_ALLOW_LIST_GROUPS'), 'allow_list_groups', $usergroup_list));
    }
    $fields->attach(do_template('FORM_SCREEN_FIELD_SPACER', array('SECTION_HIDDEN' => $disallow2 == '' && $disallow2_groups == '', 'TITLE' => do_lang_tempcode('ADVANCED'))));
    $fields->attach(form_input_username_multi(do_lang_tempcode('DISALLOW_LIST'), do_lang_tempcode('DESCRIPTION_DISALLOW_LIST'), 'disallow_list', array_map(array($GLOBALS['FORUM_DRIVER'], 'get_username'), $disallow2 == '' ? array() : array_map('intval', explode(',', $disallow2))), 0, true));
    if (!$is_made_by_me || get_option('group_private_chatrooms') == '1') {
        $usergroup_list = new ocp_tempcode();
        $groups = $GLOBALS['FORUM_DRIVER']->get_usergroup_list(true);
        foreach ($groups as $key => $val) {
            if ($key != db_get_first_id()) {
                if (get_forum_type() == 'ocf') {
                    require_code('ocf_groups2');
                    $num_members = ocf_get_group_members_raw_count($key);
                    if ($num_members >= 1 && $num_members <= 6) {
                        $group_members = ocf_get_group_members_raw($key);
                        $group_member_usernames = '';
                        foreach ($group_members as $group_member) {
                            if ($group_member_usernames != '') {
                                $group_member_usernames = do_lang('LIST_SEP');
                            }
                            $group_member_usernames .= $GLOBALS['FORUM_DRIVER']->get_username($group_member);
                        }
                        $val = do_lang('GROUP_MEMBERS_SPECIFIC', $val, $group_member_usernames);
                    } else {
                        $val = do_lang('GROUP_MEMBERS', $val, number_format($num_members));
                    }
                }
                $usergroup_list->attach(form_input_list_entry(strval($key), $disallow2_groups == '*' || count(array_intersect(array($key), $disallow2_groups == '' ? array() : explode(',', $disallow2_groups))) != 0, $val));
            }
        }
        $fields->attach(form_input_multi_list(do_lang_tempcode('DISALLOW_LIST_GROUPS'), do_lang_tempcode('DESCRIPTION_DISALLOW_LIST_GROUPS'), 'disallow_list_groups', $usergroup_list));
    }
    return $fields;
}
 /**
  * Standard aed_module list function.
  *
  * @return tempcode		The selection list
  */
 function nice_get_entries()
 {
     $fields = new ocp_tempcode();
     $order = get_param_integer('keep_id_order', 0) == 0 ? 'g_promotion_threshold,id' : 'id';
     $group_count = $GLOBALS['FORUM_DB']->query_value('f_groups', 'COUNT(*)');
     $rows = $GLOBALS['FORUM_DB']->query_select('f_groups', array('id', 'g_order', 'g_name', 'g_promotion_target'), $group_count > 300 ? array('g_is_private_club' => 0) : NULL, 'ORDER BY ' . $order);
     require_code('ocf_groups2');
     foreach ($rows as $row) {
         $num_members = ocf_get_group_members_raw_count($row['id'], true, false, true, true);
         if (is_null($row['g_promotion_target'])) {
             $text = do_lang_tempcode('EXTENDED_GROUP_TITLE_NORMAL', escape_html(get_translated_text($row['g_name'], $GLOBALS['FORUM_DB'])), strval($row['id']), array(integer_format($row['g_order'] + 1), integer_format($num_members)));
         } else {
             $text = do_lang_tempcode('EXTENDED_GROUP_TITLE_RANK', escape_html(get_translated_text($row['g_name'], $GLOBALS['FORUM_DB'])), strval($row['id']), array(strval($row['g_promotion_target']), integer_format($row['g_order'] + 1), integer_format($num_members)));
         }
         $fields->attach(form_input_list_entry(strval($row['id']), false, $text));
     }
     return $fields;
 }