示例#1
0
	public static function construct_sgcat_chooser_options($topname = null)
	{
		$selectoptions = array();

		if ($topname)
		{
			$selectoptions['-1'] = $topname;
		}

		require_once(DIR . '/includes/functions_socialgroup.php');
		// get category options
		$categories = fetch_socialgroup_category_options();
		$categoryoptions = '';

		foreach ($categories as $categoryid => $category)
		{
			$selectoptions[$categoryid] = $category['title'];
		}

		return $selectoptions;
	}
示例#2
0
        fetch_online_status($user, true);
        construct_im_icons($user, true);
        ($hook = vBulletinHook::fetch_hook('group_memberbit')) ? eval($hook) : false;
        eval('$member_list .= "' . fetch_template('memberinfo_small') . '";');
    }
    $vbulletin->db->free_result($groupmembers);
    $navbits = array('group.php' . $vbulletin->session->vars['sessionurl_q'] => $vbphrase['social_groups'], 'group.php?' . $vbulletin->session->vars['sessionurl'] . 'cat=' . $group['socialgroupcategoryid'] => $group['categoryname'], 'group.php?' . $vbulletin->session->vars['sessionurl'] . 'groupid=' . $group['groupid'] => $group['name'], '' => $vbphrase['member_list']);
    $custompagetitle = $group['name'] . ' - ' . $vbphrase['member_list'];
    $pagenav = construct_page_nav($pagenumber, $perpage, $totalmembers, 'group.php?' . $vbulletin->session->vars['sessionurl'] . 'do=viewmembers&groupid=' . $group['groupid'] . ($perpage ? "&pp={$perpage}" : ''));
    eval('$memberinfo_css = "' . fetch_template('memberinfo_css') . '";');
    $templatename = 'socialgroups_memberlist';
}
// #######################################################################
if ($_REQUEST['do'] == 'search') {
    $navbits = array('group.php' . $vbulletin->session->vars['sessionurl_q'] => $vbphrase['social_groups'], '' => $vbphrase['advanced_search']);
    $categories = fetch_socialgroup_category_options(false, true);
    $category_options = '';
    foreach ($categories as $category) {
        $optionvalue = $category['socialgroupcategoryid'];
        $optionselected = '';
        $optiontitle = $category['title'];
        eval('$category_options .= "' . fetch_template('option') . '";');
    }
    unset($categories);
    $templatename = 'socialgroups_search';
}
// #######################################################################
if ($_REQUEST['do'] == 'message') {
    $vbulletin->input->clean_array_gpc('r', array('perpage' => TYPE_UINT, 'pagenumber' => TYPE_UINT));
    $perpage = $vbulletin->GPC['perpage'];
    $pagenumber = $vbulletin->GPC['pagenumber'];
示例#3
0
 private function showCategoryOptions($selected)
 {
     global $vbphrase;
     require_once DIR . '/includes/functions_databuild.php';
     fetch_phrase_group('search');
     $categories = fetch_socialgroup_category_options(false);
     if (!is_array($selected)) {
         $selected = array($selected);
     }
     if (count($categories) > 0) {
         $select = render_option_template($vbphrase['any_category'], '', !count($selected) ? 'selected="selected"' : '');
         foreach ($categories as $categoryid => $category) {
             $select .= render_option_template(htmlspecialchars_uni($category['title']), $categoryid, in_array($categoryid, $selected) ? 'selected="selected"' : '');
         }
         return $select;
     } else {
         return false;
     }
 }
示例#4
0
文件: group.php 项目: Kheros/MMOver
     case 'edit':
         if (!can_edit_group($group)) {
             print_no_permission();
         }
         $typeselected["{$group['type']}"] = ' selected="selected"';
         $phrase = $vbphrase['edit_group'];
         $action = 'doedit';
         $checked['enable_group_messages'] = $group['options'] & $vbulletin->bf_misc_socialgroupoptions['enable_group_messages'] ? ' checked="checked"' : '';
         $checked['enable_group_albums'] = $group['options'] & $vbulletin->bf_misc_socialgroupoptions['enable_group_albums'] ? ' checked="checked"' : '';
         $checked['mod_queue'] = $group['options'] & $vbulletin->bf_misc_socialgroupoptions['owner_mod_queue'] ? ' checked="checked"' : '';
         $checked['join_to_view'] = $group['options'] & $vbulletin->bf_misc_socialgroupoptions['join_to_view'] ? ' checked="checked"' : '';
         $checked['only_owner_discussions'] = $group['options'] & $vbulletin->bf_misc_socialgroupoptions['only_owner_discussions'] ? ' checked="checked"' : '';
         break;
 }
 // get category options
 $categories = fetch_socialgroup_category_options();
 $categoryoptions = '';
 foreach ($categories as $categoryid => $category) {
     $optiontitle = $category['title'];
     $optionvalue = $categoryid;
     $optionselected = $categoryid == $group['socialgroupcategoryid'] ? ' selected="selected"' : '';
     $categoryoptions .= render_option_template($optiontitle, $optionvalue, $optionselected, $optionclass);
 }
 unset($categories);
 if ($_REQUEST['do'] == 'edit') {
     $show['title'] = (can_moderate(0, 'caneditsocialgroups') or $group['members'] <= 1);
 } else {
     $show['title'] = true;
 }
 $show['mod_queue'] = ($vbulletin->options['sg_allow_owner_mod_queue'] and !$vbulletin->options['social_moderation'] and $groupowner['permissions']['socialgrouppermissions'] & $vbulletin->bf_ugp_socialgrouppermissions['canmanageowngroups'] and $vbulletin->options['socnet_groups_msg_enabled']);
 $show['join_to_view'] = ($vbulletin->options['sg_allow_join_to_view'] and ($vbulletin->options['socnet_groups_msg_enabled'] or $vbulletin->options['socnet_groups_pictures_enabled']));
示例#5
0
 /**
  * vBForum_Search_Type_SocialGroup::listUi()
  *This function generates the search elements for a user to search for groups
  * @param mixed $prefs : the array of user preferences
  * @param mixed $contenttypeid : the content type for which we are going to
  *    search
  * @param array registers : any additional elements to be registered. These are
  * 	just passed to the template
  * @param string $template_name : name of the template to use for display. We have
  *		a default template.
  * @param boolean $groupable : a flag to tell whether the interface should display
  * 	grouping option(s).
  * @return $html: complete html for the search elements
  */
 public function listUi($prefs = null, $contenttypeid = null, $registers = null, $template_name = null)
 {
     global $vbulletin, $vbphrase;
     if (!isset($template_name)) {
         $template_name = 'search_input_socialgroup';
     }
     if (!isset($contenttypeid)) {
         $contenttypeid = vB_Search_Core::get_instance()->get_contenttypeid('vBForum', 'SocialGroup');
     }
     $template = vB_Template::create($template_name);
     $template->register('securitytoken', $vbulletin->userinfo['securitytoken']);
     $template->register('contenttypeid', $contenttypeid);
     $template->register('show', $show);
     // Get categories
     $categories = fetch_socialgroup_category_options();
     $category_options = '<option value="">' . $vbphrase['any_category'] . '</option>';
     if (!isset($prefs['cat'])) {
         $prefs['cat'] = array();
     }
     foreach ($categories as $key => $name) {
         $category_options .= "<option value=\"{$key}\"" . (in_array($key, $prefs['cat']) ? ' selected="selected" ' : '') . " >" . $name['title'] . "</option>\n";
     }
     $template->register('category_options', $category_options);
     $this->setPrefs($template, $prefs, array('select' => array('titleonly', 'messageless', 'discussionless', 'pictureless', 'memberless', 'group_filter_date_lteq_month', 'group_filter_date_gteq_month', 'sortby'), 'cb' => array('nocache'), 'value' => array('query', 'messagelimit', 'discussionlimit', 'picturelimit', 'memberlimit', 'group_filter_date_lteq_day', 'group_filter_date_lteq_year', 'group_filter_date_gteq_day', 'group_filter_date_gteq_year', 'memberlimit')));
     vB_Search_Searchtools::searchIntroRegisterHumanVerify($template);
     if (isset($registers) and is_array($registers)) {
         foreach ($registers as $key => $value) {
             $template->register($key, htmlspecialchars_uni($value));
         }
     }
     ($hook = vBulletinHook::fetch_hook('search_listui_complete')) ? eval($hook) : false;
     return $template->render();
 }
示例#6
0
	/**
	 * This list the group categories for search
	 *
	 * @param mixed $config - array of current configuration for this widget
	 * @return
	 */
	private function getGroupCategories($config)
	{
		global $vbphrase;
		require_once DIR . '/includes/functions_socialgroup.php';

		$categories = fetch_socialgroup_category_options();
		$category_options = '<option value="">' . $vbphrase['any_category'] . '</option>';

		if (! isset($config['cat']))
		{
			$config['cat'] = array();
		}
		else if (! is_array($config['cat']))
		{
			$config['cat'] = array($config['cat']);
		}

		foreach ($categories AS $key => $name)
		{
			$category_options .= "<option value=\"$key\""
				. (in_array($key, $config['cat'])  ? ' selected="selected" ' : '' )
				. " >" . $name['title'] . "</option>\n";
		}
		return $category_options;
	}