• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP bp_has_groups函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中bp_has_groups函数的典型用法代码示例。如果您正苦于以下问题:PHP bp_has_groups函数的具体用法?PHP bp_has_groups怎么用?PHP bp_has_groups使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了bp_has_groups函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: widget

	function widget($args, $instance) {
		global $bp;

	    extract( $args );

		echo $before_widget;
		echo $before_title
		   . $widget_name
		   . $after_title; ?>

		<?php if ( bp_has_groups( 'type=popular&per_page=' . $instance['max_groups'] . '&max=' . $instance['max_groups'] ) ) : ?>
			<div class="item-options" id="groups-list-options">
				<span class="ajax-loader" id="ajax-loader-groups"></span>
				<a href="<?php echo site_url() . '/' . $bp->groups->slug ?>" id="newest-groups"><?php _e("Newest", 'buddypress') ?></a> |
				<a href="<?php echo site_url() . '/' . $bp->groups->slug ?>" id="recently-active-groups"><?php _e("Active", 'buddypress') ?></a> |
				<a href="<?php echo site_url() . '/' . $bp->groups->slug ?>" id="popular-groups" class="selected"><?php _e("Popular", 'buddypress') ?></a>
			</div>

			<ul id="groups-list" class="item-list">
				<?php while ( bp_groups() ) : bp_the_group(); ?>
					<li>
						<div class="item-avatar">
							<a href="<?php bp_group_permalink() ?>"><?php bp_group_avatar_thumb() ?></a>
						</div>

						<div class="item">
							<div class="item-title"><a href="<?php bp_group_permalink() ?>" title="<?php bp_group_name() ?>"><?php bp_group_name() ?></a></div>
							<div class="item-meta"><span class="activity"><?php bp_group_member_count() ?></span></div>
						</div>
					</li>

				<?php endwhile; ?>
			</ul>
			<?php wp_nonce_field( 'groups_widget_groups_list', '_wpnonce-groups' ); ?>
			<input type="hidden" name="groups_widget_max" id="groups_widget_max" value="<?php echo esc_attr( $instance['max_groups'] ); ?>" />

		<?php else: ?>

			<div class="widget-error">
				<?php _e('There are no groups to display.', 'buddypress') ?>
			</div>

		<?php endif; ?>

		<?php echo $after_widget; ?>
	<?php
	}
开发者ID:n-sane,项目名称:zaroka,代码行数:47,代码来源:bp-groups-widgets.php


示例2: getGroups

 function getGroups($force = false)
 {
     //need a user id for this
     if (empty($this->ID)) {
         return false;
     }
     //check cache
     if (isset($this->groups) && !$force) {
         return $this->groups;
     }
     //remove the bp-site-groups filter
     remove_filter('groups_get_groups', 'bpsg_groups_get_groups');
     //get corresponding class ids for buddypress groups this user is a member of
     $groups = array();
     if (bp_has_groups(array('user_id' => $this->ID))) {
         while (bp_groups()) {
             bp_the_group();
             $group_id = bp_get_group_id();
             $groups[] = groups_get_group(array('group_id' => $group_id));
         }
     }
     //add the bp-site-groups filter back
     add_filter('groups_get_groups', 'bpsg_groups_get_groups');
     $this->groups = $groups;
     return $this->groups;
 }
开发者ID:danielcoats,项目名称:schoolpress,代码行数:26,代码来源:class.SPStudent.php


示例3: test_private_group_where_loggedin_user_has_requested_membership

 /**
  * @group BP6319
  */
 public function test_private_group_where_loggedin_user_has_requested_membership()
 {
     $u = $this->factory->user->create();
     $g = $this->factory->group->create(array('status' => 'private'));
     $this->set_current_user($u);
     groups_send_membership_request($u, $g);
     if (bp_has_groups(array('include' => array($g)))) {
         while (bp_groups()) {
             bp_the_group();
             $found = get_echo('bp_group_status_message');
         }
     }
     $expected = __('This is a private group. Your membership request is awaiting approval from the group administrator.', 'buddypress');
     $this->assertSame($expected, $found);
 }
开发者ID:CompositeUK,项目名称:clone.BuddyPress,代码行数:18,代码来源:bpGroupStatusMessage.php


示例4: training_wpo_buddypress_group_header

    function training_wpo_buddypress_group_header()
    {
        global $groups_template;
        ?>
	<div id="item-header" class="pb-group pb-item-header" role="complementary">
		<div class="container">
				<?php 
        if (bp_has_groups()) {
            while (bp_groups()) {
                bp_the_group();
                ?>
				<?php 
                bp_get_template_part('groups/single/group-header');
                ?>
			<?php 
            }
        }
        ?>
		</div>
	</div><!-- #item-header -->


<?php 
    }
开发者ID:morganloehr,项目名称:chris-verna,代码行数:24,代码来源:function.php


示例5: _e

				<div id="whats-new-post-in-box">

					<?php 
    _e('Post in', 'buddypress');
    ?>
:

					<select id="whats-new-post-in" name="whats-new-post-in">
						<option selected="selected" value="0"><?php 
    _e('My Profile', 'buddypress');
    ?>
</option>

						<?php 
    if (bp_has_groups('user_id=' . bp_loggedin_user_id() . '&type=alphabetical&max=100&per_page=100&populate_extras=0')) {
        while (bp_groups()) {
            bp_the_group();
            ?>

								<option value="<?php 
            bp_group_id();
            ?>
"><?php 
            bp_group_name();
            ?>
</option>

							<?php 
        }
    }
开发者ID:kosir,项目名称:thatcamp-org,代码行数:30,代码来源:post-form.php


示例6: while

<?php

/**
 * BuddyPress - Groups Home
 *
 * @package BuddyPress
 * @subpackage bp-legacy
 */
?>
<div id="buddypress">

	<?php 
if (bp_has_groups()) {
    while (bp_groups()) {
        bp_the_group();
        ?>

	<?php 
        /**
         * Fires before the display of the group home content.
         *
         * @since 1.2.0
         */
        do_action('bp_before_group_home_content');
        ?>

	<div id="item-header" role="complementary">

		<?php 
        /**
         * If the cover image feature is enabled, use a specific header
开发者ID:toby-bushell,项目名称:triumph,代码行数:31,代码来源:home.php


示例7: profiles_header_widget

/**
 *  members sidebar header widget
 *
 * @package Custom Community
 * @since 1.8.3
 */
function profiles_header_widget($args)
{
    extract($args);
    $options = get_option("profiles_header_position");
    if (!is_array($options)) {
        $options = array('profiles_header_position' => 'horizontal');
    }
    if ($options[profiles_header_position] != 'horizontal') {
        locate_template(array('members/single/member-header-sidebar.php'), true, false);
    } else {
        if (bp_has_groups()) {
            while (bp_groups()) {
                bp_the_group();
                locate_template(array('members/single/member-header.php'), true, false);
            }
        }
    }
}
开发者ID:paulmedwal,项目名称:edxforumspublic,代码行数:24,代码来源:widgets.php


示例8: _e

		<form action="" method="post" id="forums-search-form" class="dir-form">

			<h3><?php _e( 'Group Forums Directory', 'buddypress' ) ?><?php if ( is_user_logged_in() ) : ?> &nbsp;<a class="button" href="#new-topic" id="new-topic-button"><?php _e( 'New Topic', 'buddypress' ) ?></a><?php endif; ?></h3>

			<?php do_action( 'bp_before_directory_forums_content' ) ?>

			<div id="forums-dir-search" class="dir-search">
				<?php bp_directory_forums_search_form() ?>
			</div>
		</form>

		<div id="new-topic-post">
			<?php if ( is_user_logged_in() ) : ?>

				<?php if ( bp_has_groups( 'user_id=' . bp_loggedin_user_id() . '&type=alphabetical&max=100&per_page=100' ) ) : ?>

					<form action="" method="post" id="forum-topic-form" class="standard-form">

						<?php do_action( 'groups_forum_new_topic_before' ) ?>

						<a name="post-new"></a>
						<h5><?php _e( 'Post a New Topic:', 'buddypress' ) ?></h5>

						<label><?php _e( 'Title:', 'buddypress' ) ?></label>
						<input type="text" name="topic_title" id="topic_title" value="" />

						<label><?php _e( 'Content:', 'buddypress' ) ?></label>
						<textarea name="topic_text" id="topic_text"></textarea>

						<label><?php _e( 'Tags (comma separated):', 'buddypress' ) ?></label>
开发者ID:n-sane,项目名称:zaroka,代码行数:30,代码来源:index.php


示例9: get_group

 function get_group()
 {
     // Setup args
     $args = array('type' => 'active', 'max' => 5, 'populate_extras' => false);
     // Retrieve groups
     if (bp_has_groups($args)) {
         // Re-shuffle the array to draw a random group
         global $groups_template;
         shuffle($groups_template->groups);
         // Only load the first group
         bp_the_group();
         // Build the HTML
         $this->html = $this->build_html();
     }
 }
开发者ID:tamriel-foundry,项目名称:apoc2,代码行数:15,代码来源:widgets.php


示例10: run_stat_hub_csv

 /**
  * Create the hub overview CSV when requested.
  *
  * @since    1.0.0
  */
 public function run_stat_hub_csv()
 {
     global $wpdb;
     $bp = buddypress();
     // Output headers so that the file is downloaded rather than displayed.
     header('Content-Type: text/csv; charset=utf-8');
     header('Content-Disposition: attachment; filename=cc-hubs-overview.csv');
     // Create a file pointer connected to the output stream.
     $output = fopen('php://output', 'w');
     // Write a header row.
     $row = array('Hub ID', 'Name', 'Slug', 'Status', 'Date Created', 'Last Activity', 'Parent Hub ID', 'Total Members', 'Creator ID', 'Creator Email', 'Forum', 'BP Docs', 'CC Hub Home Page', 'CC Hub Pages', 'CC Hub Narratives', 'Custom Plugins');
     fputcsv($output, $row);
     // Groups Loop
     if (bp_has_groups(array('order' => 'ASC', 'orderby' => 'date_created', 'page' => null, 'per_page' => null, 'max' => false, 'show_hidden' => true, 'user_id' => null, 'meta_query' => false, 'include' => false, 'exclude' => false, 'populate_extras' => false, 'update_meta_cache' => false))) {
         while (bp_groups()) {
             bp_the_group();
             $group_id = bp_get_group_id();
             $group_object = groups_get_group(array('group_id' => (int) $group_id, 'populate_extras' => true));
             // Hub ID
             $row = array($group_id);
             // Name
             $row[] = bp_get_group_name();
             // Slug
             $row[] = bp_get_group_slug();
             // Status
             $row[] = bp_get_group_status();
             // Date Created
             $row[] = $group_object->date_created;
             // Date of last activity
             $row[] = $group_object->last_activity;
             // Parent Hub ID
             $row[] = $wpdb->get_var($wpdb->prepare("SELECT g.parent_id FROM {$bp->groups->table_name} g WHERE g.id = %d", $group_id));
             // Total Members
             $row[] = groups_get_total_member_count($group_id);
             // Creator ID
             $creator_id = $group_object->creator_id;
             $row[] = $creator_id;
             // Creator Email
             $creator = get_user_by('id', $creator_id);
             $row[] = $creator->user_email;
             // Forum
             $row[] = $group_object->enable_forum;
             // BP Docs
             if (function_exists('bp_docs_is_docs_enabled_for_group')) {
                 $row[] = bp_docs_is_docs_enabled_for_group($group_id);
             } else {
                 $row[] = '';
             }
             // CC Hub Home Page
             if (function_exists('cc_get_group_home_page_post') && cc_get_group_home_page_post($group_id)->have_posts()) {
                 $row[] = 1;
             } else {
                 $row[] = 0;
             }
             // CC Hub Pages
             $row[] = (bool) groups_get_groupmeta($group_id, "ccgp_is_enabled");
             // CC Hub Narratives
             $row[] = (bool) groups_get_groupmeta($group_id, "ccgn_is_enabled");
             // Custom Plugins
             // To make your group-specific plugin be counted, so something like this:
             /*	add_filter( 'cc_stats_custom_plugins', 'prefix_report_custom_plugin', 10, 2 );
              *	function prefix_report_custom_plugin( $custom_plugins, $group_id ) {
              *		if ( $group_id == sa_get_group_id() ) {
              *			$custom_plugins[] = "CC Salud America";
              *		}
              *		return $custom_plugins;
              *	}
              */
             $custom_plugins = apply_filters('cc_stats_custom_plugins', array(), $group_id);
             $custom_plugins = implode(' ', $custom_plugins);
             $row[] = $custom_plugins;
             // Write the row.
             fputcsv($output, $row);
         }
     }
     fclose($output);
     exit;
 }
开发者ID:careshub,项目名称:cc-stats,代码行数:83,代码来源:class-cc-stats-admin.php


示例11: create_field

 function create_field($field)
 {
     // defaults?
     $field = array_merge($this->defaults, $field);
     // Change Field into a select
     $field['type'] = 'select';
     $field['choices'] = array();
     // set the user ID if you want to return only groups that this user is a member of.
     $user_id = $field['groups'] == 1 ? FALSE : get_current_user_id();
     $args = array('per_page' => 999, 'user_id' => $user_id);
     if (bp_has_groups($args)) {
         while (bp_groups()) {
             bp_the_group();
             $field['choices'][bp_get_group_id()] = bp_get_group_name();
         }
     }
     // create field
     do_action('acf/create_field', $field);
 }
开发者ID:rabidgadfly,项目名称:acf-field-buddypress-groups,代码行数:19,代码来源:acf-buddypress_groups-v4.php


示例12: on_bp_gtm_admin_groups

    function on_bp_gtm_admin_groups($bp_gtm)
    {
        global $bp;
        ?>
        <table id="bp-gtm-admin-table" class="widefat link-group">
            <thead>
                <tr class="header">
                    <td colspan="2"><?php 
        _e('Which groups should have GTM System turned on?', 'bp_gtm');
        ?>
</td>
                    <td class="own_roles"><?php 
        _e('Own roles?', 'bp_gtm');
        ?>
</td>
                </tr>
            </thead>
            <tbody id="the-list">
                <tr>
                    <td><input type="checkbox" class="bp_gtm_allgroups" name="bp_gtm_allgroups" <?php 
        echo 'all' == $bp_gtm['groups'] ? 'checked="checked" ' : '';
        ?>
 value="all" /></td>
                    <td><?php 
        _e('All groups', 'bp_gtm');
        ?>
</td>
                    <td class="own_roles">&nbsp;</td>
                </tr>
                <?php 
        $arg['type'] = 'alphabetical';
        $arg['per_page'] = '1000';
        if (bp_has_groups($arg)) {
            while (bp_groups()) {
                bp_the_group();
                $description = preg_replace(array('<<p>>', '<</p>>', '<<br />>', '<<br>>'), '', bp_get_group_description_excerpt());
                echo '<tr>
                                <td><input name="bp_gtm_groups[' . bp_get_group_id() . ']" class="bp_gtm_groups" type="checkbox" ' . ('all' == $bp_gtm['groups'] || $bp_gtm['groups'][bp_get_group_id()] == 'on' ? 'checked="checked" ' : '') . 'value="on" /></td>
                                <td><a href="' . bp_get_group_permalink() . $bp->gtm->slug . '/" target="_blank">' . bp_get_group_name() . '</a> &rarr; ' . $description . '</td>
                                <td class="own_roles"><input name="bp_gtm_groups_own_roles[' . bp_get_group_id() . ']" class="bp_gtm_groups_own_roles" type="checkbox" ' . ((!empty($bp_gtm['groups_own_roles']) || !empty($bp_gtm['groups_own_roles'][bp_get_group_id()])) && 'all' == $bp_gtm['groups_own_roles'] || !empty($bp_gtm['groups_own_roles'][bp_get_group_id()]) && $bp_gtm['groups_own_roles'][bp_get_group_id()] == bp_get_group_id() ? 'checked="checked" ' : '') . 'value="' . bp_get_group_id() . '" /></td>
                            </tr>';
            }
        }
        ?>
            </tbody>
            <tfoot>
                <tr class="header">
                    <td><input type="checkbox" class="bp_gtm_allgroups" name="bp_gtm_allgroups" <?php 
        echo 'all' == $bp_gtm['groups'] ? 'checked="checked" ' : '';
        ?>
 value="all" /></td>
                    <td><?php 
        _e('All groups', 'bp_gtm');
        ?>
</td>
                    <td>&nbsp;</td>
                </tr>
            </tfoot>
        </table>
        <?php 
    }
开发者ID:adisonc,项目名称:MaineLearning,代码行数:61,代码来源:bp-gtm-admin.php


示例13: while

<?php

/**
 * BuddyPress - Users Groups
 *
 * @package BuddyPress
 * @subpackage bp-legacy
 */
$n_groups_to_show = 4;
$n_groups_shown = 0;
if (bp_has_groups('user_id=' . bp_displayed_user_id())) {
    ?>
    <h5 class="side-header">Groups</h5>
    <div id="side-organizations">
        <ul id="group-list" class="item-list" role="main">
            <?php 
    while (bp_groups()) {
        bp_the_group();
        ?>
                <?php 
        // limit number of groups to show in the list
        if ($n_groups_shown < $n_groups_to_show) {
            ?>
                    <li>
                        <a href="<?php 
            bp_group_permalink();
            ?>
">
                            <?php 
            bp_group_avatar('type=thumb&width=50&height=50');
            ?>
开发者ID:par-orillonsoft,项目名称:myfossil-theme,代码行数:31,代码来源:groups.php


示例14: get_header

<?php get_header() ?>

	<div id="content">
		<div class="padder">
			<?php if ( bp_has_groups() ) : while ( bp_groups() ) : bp_the_group(); ?>

			<?php do_action( 'bp_before_group_home_content' ) ?>

			<div id="item-header">
				<?php locate_template( array( 'groups/single/group-header.php' ), true ) ?>
			</div>

			<div id="item-nav">
				<div class="item-list-tabs no-ajax" id="sub-nav">
					<ul>
						<?php bp_get_options_nav() ?>

						<?php do_action( 'bp_group_options_nav' ) ?>
					</ul>
				</div>
			</div>

			<div id="item-body">
				<?php do_action( 'template_notices' ) ?>

				<?php do_action( 'bp_before_group_body' ) ?>
	<?php if(bp_is_gallery_home())
			 locate_template( array( 'gallery/groups/home.php' ), true ) ;
			 
		else if(bp_is_gallery_create())
			locate_template( array( 'gallery/groups/create.php' ), true ) ;
开发者ID:r-chopra17,项目名称:p2bp,代码行数:31,代码来源:index.php


示例15: gmw_fl_get_bp_groups

/**
 * GMW FL function - get list of groups in checkboxes or dropdown
 */
function gmw_fl_get_bp_groups($gmw, $usage, $groups, $name)
{
    if (!bp_is_active('groups')) {
        return;
    }
    $output = '';
    if ($usage == 'checkbox') {
        $output .= '<span class="search-all">' . $gmw['labels']['search_form']['select_groups'] . '</span>';
        $output .= '<ul id="gmw-' . $gmw['ID'] . '-' . $name . '-checkboxes-wrapper" class="gmw-' . $name . '-checkboxes-wrapper gmw-' . $gmw['prefix'] . '-' . $name . '-checkboxes-wrapper">';
    } else {
        $output .= '<label for="gmw-bp-groups-' . $usage . '-' . $gmw['ID'] . '">' . $gmw['labels']['search_form']['select_groups'] . '</label>';
        $output .= '<select name="' . $name . '" id="gmw-bp-groups-dropdown-' . $gmw['ID'] . '" class="gmw-bp-groups-dropdown gmw-' . $gmw['prefix'] . '-bp-groups-dropdown">';
        $output .= '<option value="">' . $gmw['labels']['search_form']['no_groups'] . '</option>';
        $output .= '<option value="' . implode(',', $groups) . '">' . $gmw['labels']['search_form']['all_groups'] . '</option>';
    }
    if (bp_has_groups()) {
        while (bp_groups()) {
            bp_the_group();
            $gid = bp_get_group_id();
            if (!in_array($gid, $groups)) {
                continue;
            }
            $gname = bp_get_group_name();
            if ($usage == 'checkbox') {
                $output .= '<li id="gmw-' . $gmw['ID'] . '-' . $name . '-' . $gid . '-checkbox-wrapper" class="gmw-' . $name . '-checkbox-wrapper gmw-' . $gmw['prefix'] . '-' . $name . '-checkbox-wrapper">';
                $output .= '<input type="checkbox" id="gmw-' . $gmw['ID'] . '-' . $name . '-' . $gid . '-checkbox" value="' . $gid . '" name=' . $name . '[]" />';
                $output .= '<label for="gmw-' . $gmw['ID'] . '-' . $name . '-' . $gid . '-checkbox">' . $gname . '</label>';
                $output .= '</li>';
            } else {
                $output .= '<option value="' . $gid . '">' . $gname . '</option>';
            }
        }
    }
    if ($usage == 'checkbox') {
        $output .= '<ul>';
    } else {
        $output .= '</select>';
    }
    return apply_filters('gmw_fl_get_bp_groups', $output, $gmw, $usage, $groups, $name);
}
开发者ID:sedici,项目名称:wpmu-istec,代码行数:43,代码来源:gmw-fl-template-functions.php


示例16: widget

    /**
     * Extends our frontend output method.
     *
     * @param array $args     Array of arguments for the widget.
     * @param array $instance Widget instance data.
     */
    public function widget($args, $instance)
    {
        /**
         * Filters the user ID to use with the widget instance.
         *
         * @since 1.5.0
         *
         * @param string $value Empty user ID.
         */
        $user_id = apply_filters('bp_group_widget_user_id', '0');
        extract($args);
        if (empty($instance['group_default'])) {
            $instance['group_default'] = 'popular';
        }
        if (empty($instance['title'])) {
            $instance['title'] = __('Groups', 'buddypress');
        }
        /**
         * Filters the title of the Groups widget.
         *
         * @since 1.8.0
         * @since 2.3.0 Added 'instance' and 'id_base' to arguments passed to filter.
         *
         * @param string $title    The widget title.
         * @param array  $instance The settings for the particular instance of the widget.
         * @param string $id_base  Root ID for all widgets of this type.
         */
        $title = apply_filters('widget_title', $instance['title'], $instance, $this->id_base);
        /**
         * Filters the separator of the group widget links.
         *
         * @since 2.4.0
         *
         * @param string $separator Separator string. Default '|'.
         */
        $separator = apply_filters('bp_groups_widget_separator', '|');
        echo $before_widget;
        $title = !empty($instance['link_title']) ? '<a href="' . bp_get_groups_directory_permalink() . '">' . $title . '</a>' : $title;
        echo $before_title . $title . $after_title;
        $max_groups = !empty($instance['max_groups']) ? (int) $instance['max_groups'] : 5;
        $group_args = array('user_id' => $user_id, 'type' => $instance['group_default'], 'per_page' => $max_groups, 'max' => $max_groups);
        ?>

		<?php 
        if (bp_has_groups($group_args)) {
            ?>
			<div class="item-options" id="groups-list-options">
				<a href="<?php 
            bp_groups_directory_permalink();
            ?>
" id="newest-groups"<?php 
            if ($instance['group_default'] == 'newest') {
                ?>
 class="selected"<?php 
            }
            ?>
><?php 
            _e("Newest", 'buddypress');
            ?>
</a>
				<span class="bp-separator" role="separator"><?php 
            echo esc_html($separator);
            ?>
</span>
				<a href="<?php 
            bp_groups_directory_permalink();
            ?>
" id="recently-active-groups"<?php 
            if ($instance['group_default'] == 'active') {
                ?>
 class="selected"<?php 
            }
            ?>
><?php 
            _e("Active", 'buddypress');
            ?>
</a>
				<span class="bp-separator" role="separator"><?php 
            echo esc_html($separator);
            ?>
</span>
				<a href="<?php 
            bp_groups_directory_permalink();
            ?>
" id="popular-groups" <?php 
            if ($instance['group_default'] == 'popular') {
                ?>
 class="selected"<?php 
            }
            ?>
><?php 
            _e("Popular", 'buddypress');
            ?>
</a>
//.........这里部分代码省略.........
开发者ID:boonebgorges,项目名称:BuddyPress-1,代码行数:101,代码来源:bp-groups-widgets.php


示例17: bp_docs_doc_associated_group_markup

/**
 * Outputs the markup for the Associated Group settings section
 *
 * @since 1.2
 */
function bp_docs_doc_associated_group_markup()
{
    // First, try to set the preselected group by looking at the URL params
    $selected_group_slug = isset($_GET['group']) ? $_GET['group'] : '';
    // Support for BP Group Hierarchy
    if (false !== ($slash = strrpos($selected_group_slug, '/'))) {
        $selected_group_slug = substr($selected_group_slug, $slash + 1);
    }
    $selected_group = BP_Groups_Group::get_id_from_slug($selected_group_slug);
    if ($selected_group && !current_user_can('bp_docs_associate_with_group', $selected_group)) {
        $selected_group = 0;
    }
    // If the selected group is still 0, see if there's something in the db
    if (!$selected_group && is_singular()) {
        $selected_group = bp_docs_get_associated_group_id(get_the_ID());
    }
    // Last check: if this is a second attempt at a newly created Doc,
    // there may be a previously submitted value
    if (empty($selected_group) && !empty(buddypress()->bp_docs->submitted_data->associated_group_id)) {
        $selected_group = intval(buddypress()->bp_docs->submitted_data->associated_group_id);
    }
    $selected_group = intval($selected_group);
    $groups_args = array('per_page' => false, 'populate_extras' => false, 'type' => 'alphabetical');
    if (!bp_current_user_can('bp_moderate')) {
        $groups_args['user_id'] = bp_loggedin_user_id();
    }
    // Populate the $groups_template global
    global $groups_template;
    $old_gt = $groups_template;
    bp_has_groups($groups_args);
    // Filter out the groups where associate_with permissions forbid
    $removed = 0;
    foreach ($groups_template->groups as $gtg_key => $gtg) {
        if (!current_user_can('bp_docs_associate_with_group', $gtg->id)) {
            unset($groups_template->groups[$gtg_key]);
            $removed++;
        }
    }
    // cleanup, if necessary from filter above
    if ($removed) {
        $groups_template->groups = array_values($groups_template->groups);
        $groups_template->group_count = $groups_template->group_count - $removed;
        $groups_template->total_group_count = $groups_template->total_group_count - $removed;
    }
    ?>
	<tr>
		<td class="desc-column">
			<label for="associated_group_id"><?php 
    _e('Which group should this Doc be associated with?', 'bp-docs');
    ?>
</label>
			<span class="description"><?php 
    _e('(Optional) Note that the Access settings available for this Doc may be limited by the privacy settings of the group you choose.', 'bp-docs');
    ?>
</span>
		</td>

		<td class="content-column">
			<select name="associated_group_id" id="associated_group_id">
				<option value=""><?php 
    _e('None', 'bp-docs');
    ?>
</option>
				<?php 
    foreach ($groups_template->groups as $g) {
        ?>
					<option value="<?php 
        echo esc_attr($g->id);
        ?>
" <?php 
        selected($selected_group, $g->id);
        ?>
><?php 
        echo esc_html($g->name);
        ?>
</option>
				<?php 
    }
    ?>
			</select>

			<div id="associated_group_summary">
				<?php 
    bp_docs_associated_group_summary();
    ?>
			</div>
		</td>
	</tr>
	<?php 
    $groups_template = $old_gt;
}
开发者ID:ExpectancyLearning,项目名称:buddypress-docs,代码行数:96,代码来源:templatetags.php


示例18: _e

		</div>

		<div id="whats-new-options">
			<div id="whats-new-submit">
				<span class="ajax-loader"></span> &nbsp;
				<input type="submit" name="aw-whats-new-submit" id="aw-whats-new-submit" value="<?php _e( 'Post Update', 'buddypress' ) ?>" />
			</div>

			<?php if ( function_exists('bp_has_groups') && !bp_is_my_profile() && !bp_is_group() ) : ?>
				<div id="whats-new-post-in-box">
					<?php _e( 'Post in', 'buddypress' ) ?>:

					<select id="whats-new-post-in" name="whats-new-post-in">
						<option selected="selected" value="0"><?php _e( 'My Profile', 'buddypress' ) ?></option>

						<?php if ( bp_has_groups( 'user_id=' . bp_loggedin_user_id() . '&type=alphabetical&max=100&per_page=100&populate_extras=0' ) ) : while ( bp_groups() ) : bp_the_group(); ?>
							<option value="<?php bp_group_id() ?>"><?php bp_group_name() ?></option>
						<?php endwhile; endif; ?>
					</select>
				</div>
				<input type="hidden" id="whats-new-post-object" name="whats-new-post-object" value="groups" />
			<?php elseif ( bp_is_group_home() ) : ?>
				<input type="hidden" id="whats-new-post-object" name="whats-new-post-object" value="groups" />
				<input type="hidden" id="whats-new-post-in" name="whats-new-post-in" value="<?php bp_group_id() ?>" />
			<?php endif; ?>

			<?php do_action( 'bp_activity_post_form_options' ) ?>

		</div><!-- #whats-new-options -->
	</div><!-- #whats-new-content -->
开发者ID:n-sane,项目名称:zaroka,代码行数:30,代码来源:post-form.php


示例19: invite_anyone_screen_one_content


//.........这里部分代码省略.........
        _e('The message will also contain a custom footer containing links to accept the invitation or opt out of further email invitations from this site.', 'invite-anyone');
        ?>
</p>
					<textarea name="invite_anyone_custom_message" id="invite-anyone-custom-message" cols="40" rows="10"><?php 
        echo invite_anyone_invitation_message($returned_message);
        ?>
</textarea>
			<?php 
    } else {
        ?>
				<label for="invite-anyone-custom-message"><?php 
        _e('Message:', 'invite-anyone');
        ?>
</label>
					<textarea name="invite_anyone_custom_message" id="invite-anyone-custom-message" disabled="disabled"><?php 
        echo invite_anyone_invitation_message($returned_message);
        ?>
</textarea>

				<input type="hidden" name="invite_anyone_custom_message" value="<?php 
        echo invite_anyone_invitation_message();
        ?>
" />
			<?php 
    }
    ?>

		</li>

		<?php 
    if (invite_anyone_are_groups_running()) {
        ?>
			<?php 
        if ($iaoptions['can_send_group_invites_email'] == 'yes' && bp_has_groups("per_page=10000&type=alphabetical&user_id=" . bp_loggedin_user_id())) {
            ?>
			<li>
				<p><?php 
            _e('(optional) Select some groups. Invitees will receive invitations to these groups when they join the site.', 'invite-anyone');
            ?>
</p>
				<ul id="invite-anyone-group-list">
					<?php 
            while (bp_groups()) {
                bp_the_group();
                ?>
						<?php 
                // Enforce per-group invitation settings
                if (!bp_groups_user_can_send_invites(bp_get_group_id()) || 'anyone' !== invite_anyone_group_invite_access_test(bp_get_group_id())) {
                    continue;
                }
                ?>
						<li>
						<input type="checkbox" name="invite_anyone_groups[]" id="invite_anyone_groups-<?php 
                bp_group_id();
                ?>
" value="<?php 
                bp_group_id();
                ?>
" <?php 
                if ($from_group == bp_get_group_id() || array_search(bp_get_group_id(), $returned_groups)) {
                    ?>
checked<?php 
                }
                ?>
 />
开发者ID:kd5ytx,项目名称:Empirical-Wordpress,代码行数:66,代码来源:by-email.php


示例20: do_action

<?php

do_action('bp_before_groups_loop');
?>

<?php 
if (bp_has_groups(bp_ajax_querystring('groups') . '&max=4')) {
    ?>

	<?php 
    do_action('bp_before_directory_groups_list');
    ?>

	<ul id="groups-list" class="item-list" role="main">

	<?php 
    while (bp_groups()) {
        bp_the_group();
        ?>

		<li class="col-xs-12 col-md-6 col-sm-4 buddypress-listing">

			<div class="item">
            	<a href="<?php 
        bp_group_permalink();
        ?>
" class="wpsvse-tooltip" data-toggle="tooltip" data-placement="top" title="<?php 
        bp_group_name();
        ?>
 - <?php 
        bp_group_member_count();
开发者ID:melgar3d,项目名称:wpsvse,代码行数:31,代码来源:front.php



注:本文中的bp_has_groups函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP bp_has_members函数代码示例发布时间:2022-05-24
下一篇:
PHP bp_has_forum_topics函数代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap