当前位置: 首页>>代码示例>>PHP>>正文


PHP bp_group_has_members函数代码示例

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


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

示例1:

<?php

if (bp_group_has_members('exclude_admins_mods=0')) {
    ?>

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

	<div class="pagination no-ajax">
		<h4 id="member-count" class="pag-count"><span>
			<?php 
    bp_group_member_pagination_count();
    ?>
		</span></h4>

		<div id="member-pagination" class="pagination-links">
			<?php 
    bp_group_member_pagination();
    ?>
		</div>

	</div>

	<?php 
    do_action('bp_before_group_members_list');
    ?>
	<div class="divider"></div>

	<ul id="member-list" class="item-list">
		<?php 
开发者ID:schiz,项目名称:scrollax,代码行数:31,代码来源:members.php

示例2: _e

        }
        ?>
		</div>
	<?php 
    }
    ?>


	<div class="bp-widget">
		<h4><?php 
    _e("Members", "buddypress");
    ?>
</h4>

		<?php 
    if (bp_group_has_members('per_page=15&exclude_banned=false')) {
        ?>

			<?php 
        if (bp_group_member_needs_pagination()) {
            ?>

				<div class="pagination no-ajax">

					<div id="member-count" class="pag-count">
						<?php 
            bp_group_member_pagination_count();
            ?>
					</div>

					<div id="member-admin-pagination" class="pagination-links">
开发者ID:nxtclass,项目名称:NXTClass-themes,代码行数:31,代码来源:admin.php

示例3: save_event

 /**
  * Save or update a new event
  * @version 2.0
  */
 function save_event($post_id, $post = '')
 {
     // Don't do anything if it's not an event
     if ('event' != $post->post_type) {
         return;
     }
     // Verify the nonce before proceeding.
     if (!isset($_POST['event-details-box']) || !wp_verify_nonce($_POST['event-details-box'], basename(__FILE__))) {
         return $post_id;
     }
     /* -----------------------------------
     			SAVE EVENT TIME 
     		------------------------------------*/
     // Retrieve the event time
     $event_time = date('Y-m-d H:i:s', strtotime($_POST['event-time']));
     $prior_time = $post->post_date;
     // Update the post object
     $post->post_date = $event_time;
     remove_action('save_post', array($this, 'save_event'));
     wp_update_post($post);
     add_action('save_post', array($this, 'save_event'), 10, 2);
     /* -----------------------------------
     			SAVE META INFORMATION 
     		------------------------------------ */
     // Define the meta to look for
     $meta = array('event_duration' => $_POST['event-duration'], 'event_capacity' => $_POST['event-capacity'], 'event_rsvp' => $_POST['event-rsvp'], 'event_role' => $_POST['event-role']);
     // Loop through each meta, saving it to the database
     foreach ($meta as $meta_key => $new_meta_value) {
         // Get the meta value of the custom field key.
         $meta_value = get_post_meta($post_id, $meta_key, true);
         // If there is no new meta value but an old value exists, delete it.
         if (current_user_can('delete_post_meta', $post_id, $meta_key) && '' == $new_meta_value && $meta_value) {
             delete_post_meta($post_id, $meta_key, $meta_value);
         } elseif (current_user_can('add_post_meta', $post_id, $meta_key) && $new_meta_value && '' == $meta_value) {
             add_post_meta($post_id, $meta_key, $new_meta_value, true);
         } elseif (current_user_can('edit_post_meta', $post_id, $meta_key) && $new_meta_value && $new_meta_value != $meta_value) {
             update_post_meta($post_id, $meta_key, $new_meta_value);
         }
     }
     // Delete the RSVP meta if the date has changed
     if ($event_time != $prior_time) {
         delete_post_meta($post_id, 'event_rsvps');
     }
     /* -----------------------------------
     			BUDDYPRESS NOTIFICATION
     		------------------------------------ */
     // Get event data
     global $bp, $wpdb;
     if (!$user_id) {
         $user_id = $post->post_author;
     }
     // Figure out which calendars this event belongs to
     $calendars = wp_get_post_terms($post_id, 'calendar');
     $group_slugs = array();
     // For each calendar, check if it's a group calendar
     foreach ($calendars as $calendar) {
         if (is_group_calendar($calendar->term_id)) {
             $groups[] = $calendar;
         }
     }
     // If this event does not belong to a group, we can stop here
     if (empty($groups)) {
         return $post_id;
     }
     // Only register notifications for future or published events
     if (!in_array($post->post_status, array('publish', 'future'))) {
         return $post_id;
     }
     // Loop through each group, adding an activity entry for each one
     foreach ($groups as $group) {
         // Get the group data
         $group_id = groups_get_id($group->slug);
         $group_name = $group->name;
         // Configure the activity entry
         $post_permalink = get_permalink($post_id);
         $activity_action = sprintf('%1$s added the event %2$s to the %3$s.', bp_core_get_userlink($post->post_author), '<a href="' . $post_permalink . '">' . $post->post_title . '</a>', $group_name . ' <a href="' . SITEURL . '/calendar/' . $group->slug . '">group calendar</a>');
         $activity_content = $post->post_content;
         // Check for existing entry
         $activity_id = bp_activity_get_activity_id(array('user_id' => $user_id, 'component' => $bp->groups->id, 'type' => 'new_calendar_event', 'item_id' => $group_id, 'secondary_item_id' => $post_id));
         // Record the entry
         groups_record_activity(array('id' => $activity_id, 'user_id' => $user_id, 'action' => $activity_action, 'content' => $activity_content, 'primary_link' => $post_permalink, 'type' => 'new_calendar_event', 'item_id' => $group_id, 'secondary_item_id' => $post_id));
         // Update the group's last activity meta
         groups_update_groupmeta($group_id, 'last_activity', bp_core_current_time());
         // Maybe notify every group member
         if ($_POST['event-rsvp']) {
             if (bp_group_has_members($args = array('group_id' => $group_id, 'exclude_admins_mods' => false, 'per_page' => 99999))) {
                 while (bp_members()) {
                     bp_the_member();
                     // Remove any existing notifications ( $user_id, $item_id, $component_name, $component_action, $secondary_item_id = false )
                     bp_notifications_delete_notifications_by_item_id(bp_get_group_member_id(), $group_id, $bp->groups->id, 'new_calendar_event', $post_id);
                     // Send a notification ( itemid , groupid , component, action , secondary )
                     bp_notifications_add_notification(array('user_id' => bp_get_group_member_id(), 'item_id' => $group_id, 'secondary_item_id' => $post_id, 'component_name' => $bp->groups->id, 'component_action' => 'new_calendar_event'));
                 }
             }
         }
     }
//.........这里部分代码省略.........
开发者ID:tamriel-foundry,项目名称:apoc2,代码行数:101,代码来源:events.php

示例4:

<?php

if (bp_group_has_members(bp_ajax_querystring('group_members'))) {
    ?>

	<?php 
    /**
     * Fires before the display of the group members content.
     *
     * @since 1.1.0
     */
    do_action('bp_before_group_members_content');
    ?>

	<div id="pag-top" class="pagination">

		<div class="pag-count" id="member-count-top">

			<?php 
    bp_members_pagination_count();
    ?>

		</div>

		<div class="pagination-links" id="member-pag-top">

			<?php 
    bp_members_pagination_links();
    ?>

		</div>
开发者ID:jasonmcalpin,项目名称:BuddyPress,代码行数:31,代码来源:members.php

示例5: _e

        }
        ?>

		<div class="info-group">
			
			<h4><?php 
        _e('Group Members', 'buddypress');
        ?>
</h4>
		
			<form action="<?php 
        bp_group_form_action('members');
        ?>
" method="post" id="group-members-form">
			<?php 
        if (bp_group_has_members()) {
            ?>
			
				<?php 
            if (bp_group_member_needs_pagination()) {
                ?>
					
					<div id="member-count" class="pag-count">
						<?php 
                bp_group_member_pagination_count();
                ?>
					</div>

					<div id="member-pagination" class="pagination-links">
						<?php 
                bp_group_member_pagination();
开发者ID:alvaropereyra,项目名称:shrekcms,代码行数:31,代码来源:list-members.php

示例6:

<?php

if (bp_group_has_members('exclude_admins_mods=0&per_page=' . sq_option('bp_members_perpage', 12))) {
    ?>

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

	<div class="item-list-tabs" id="subnav" role="navigation">
		<ul>

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

		</ul>
	</div>

	<div id="pag-top" class="pagination no-ajax">

		<div class="pag-count" id="member-count-top">

			<?php 
    bp_members_pagination_count();
    ?>

		</div>

		<div class="pagination-links" id="member-pag-top">
开发者ID:6226,项目名称:wp,代码行数:30,代码来源:members.php

示例7: bp_groupblog_member_join

/**
 * bp_groupblog_member_join( $group_id )
 *
 * Runs whenever member permissions are changed and saved - by Boone
 */
function bp_groupblog_member_join($group_id)
{
    $params = array('exclude_admins_mods' => 0, 'per_page' => 10000, 'group_id' => $group_id);
    if (bp_group_has_members($params)) {
        $blog_id = groups_get_groupmeta($group_id, 'groupblog_blog_id');
        $group = groups_get_group(array('group_id' => $group_id));
        while (bp_group_members()) {
            bp_group_the_member();
            $user_id = bp_get_group_member_id();
            if ($group->creator_id != $user_id) {
                bp_groupblog_upgrade_user($user_id, $group_id, $blog_id);
            }
        }
    }
}
开发者ID:adisonc,项目名称:MaineLearning,代码行数:20,代码来源:bp-groupblog.php

示例8: bp_gtm_filter_users

function bp_gtm_filter_users($resps = null)
{
    global $bp;
    if (bp_group_has_members(array('per_page' => 1000, 'exclude_admins_mods' => 0))) {
        $check = array();
        if (!empty($resps) && !empty($bp->action_variables[1]) && $bp->action_variables[1] == 'edit') {
            $check = $resps;
        }
        ?>
        <div class="wrap-roles">
            <?php 
        do_action('bp_before_group_members_list');
        ?>
            <ul id="member-list" class="item-list" role="main">
                <?php 
        while (bp_group_members()) {
            bp_group_the_member();
            ?>
                    <?php 
            $member = bp_get_member_user_login();
            ?>
                    <li  <?php 
            echo in_array($member, $check) ? 'class="red"' : '';
            ?>
 ><input type="checkbox" name="user_ids[<?php 
            esc_attr(bp_member_user_login());
            ?>
]" class="check-user" value="<?php 
            esc_attr(bp_member_user_login());
            ?>
" <?php 
            echo in_array($member, $check) ? 'checked="checked"' : '';
            ?>
 />
                        <?php 
            bp_group_member_avatar_thumb();
            ?>
                        <h5><?php 
            echo $member;
            ?>
</h5>
                        <?php 
            if (bp_is_active('friends')) {
                ?>
                            <div class="action">
                                <?php 
                do_action('bp_directory_members_actions_loop', bp_get_member_user_login());
                ?>
                            </div>
                        <?php 
            }
            ?>
                    </li>
                <?php 
        }
        ?>
            </ul>
            <?php 
        do_action('bp_after_group_members_list');
        ?>
        </div>
    <?php 
    } else {
        ?>
        <div id="message" class="info">
            <p><?php 
        _e("Sorry, no members were found.", 'buddypress');
        ?>
</p>
        </div>
    <?php 
    }
}
开发者ID:adisonc,项目名称:MaineLearning,代码行数:73,代码来源:bp-gtm-templatetags.php

示例9: bp_group_management_admin_edit


//.........这里部分代码省略.........
    }
    ?>


	    <h2><?php 
    _e('Group Management', 'bp-group-management');
    ?>
 : <?php 
    echo bp_get_group_name($group);
    ?>
</h2>

	    <a href="admin.php?page=bp-group-management">&larr; <?php 
    _e('Group index', 'bp-group-management');
    ?>
</a>

		<div class="bp-gm-group-actions">
	    <h3><?php 
    _e('Group actions', 'bp-group-management');
    ?>
</h3>

	    <?php 
    bp_group_management_group_action_buttons($id, $group);
    ?>

	    </div>


		<div class="bp-gm-group-members">

		<?php 
    if (bp_group_has_members('group_id=' . $id . '&exclude_admins_mods=0&exclude_banned=0')) {
        ?>
	    <h3><?php 
        _e('Manage current and banned group members', 'bp-group-management');
        ?>
</h3>

			<?php 
        if (bp_group_member_needs_pagination()) {
            ?>

				<div class="pagination no-ajax">

					<div id="member-count" class="pag-count">
						<?php 
            bp_group_member_pagination_count();
            ?>
					</div>

					<div id="member-admin-pagination" class="pagination-links">
						<?php 
            bp_group_member_admin_pagination();
            ?>
					</div>

				</div>

			<?php 
        }
        ?>

			<ul id="members-list" class="item-list single-line">
				<?php 
开发者ID:adisonc,项目名称:MaineLearning,代码行数:67,代码来源:bp-group-management-bp-functions.php

示例10: groups_ajax_member_admin_list

function groups_ajax_member_admin_list()
{
    global $bp;
    ?>
	
	<?php 
    if (bp_group_has_members('group_id=' . $_REQUEST['group_id'] . '&per_page=' . $_REQUEST['num'])) {
        ?>
	
		<?php 
        if (bp_group_member_needs_pagination()) {
            ?>
			<div id="member-count" class="pag-count">
				<?php 
            bp_group_member_pagination_count();
            ?>
			</div>

			<div id="member-admin-pagination" class="pagination-links">
				<?php 
            bp_group_member_admin_pagination();
            ?>
			</div>
		<?php 
        }
        ?>
	
		<ul id="members-list" class="item-list single-line">
		<?php 
        while (bp_group_members()) {
            bp_group_the_member();
            ?>
			<?php 
            if (bp_group_member_is_banned()) {
                ?>
				<li class="banned-user">
					<?php 
                bp_group_member_avatar_mini();
                ?>

					<h5><?php 
                bp_group_member_link();
                ?>
 <?php 
                _e('(banned)', 'buddypress');
                ?>
 <span class="small"> &mdash; <a href="<?php 
                bp_group_member_unban_link();
                ?>
" title="<?php 
                _e('Kick and ban this member', 'buddypress');
                ?>
"><?php 
                _e('Remove Ban', 'buddypress');
                ?>
</a> </h5>
			<?php 
            } else {
                ?>
				<li>
					<?php 
                bp_group_member_avatar_mini();
                ?>
					<h5><?php 
                bp_group_member_link();
                ?>
  <span class="small"> &mdash; <a href="<?php 
                bp_group_member_ban_link();
                ?>
" title="<?php 
                _e('Kick and ban this member', 'buddypress');
                ?>
"><?php 
                _e('Kick &amp; Ban', 'buddypress');
                ?>
</a> | <a href="<?php 
                bp_group_member_promote_link();
                ?>
" title="<?php 
                _e('Promote this member', 'buddypress');
                ?>
"><?php 
                _e('Promote to Moderator', 'buddypress');
                ?>
</a></span></h5>

			<?php 
            }
            ?>
				</li>
		<?php 
        }
        ?>
		</ul>
	<?php 
    } else {
        ?>

		<div id="message" class="info">
			<p><?php 
//.........这里部分代码省略.........
开发者ID:alvaropereyra,项目名称:shrekcms,代码行数:101,代码来源:bp-groups-ajax.php

示例11: _e

</p>
			</div>

		<?php 
}
?>
	</div>

	<div class="bp-widget group-members-list">
		<h3 class="section-header"><?php 
_e("Members", 'buddypress');
?>
</h3>

		<?php 
if (bp_group_has_members(array('per_page' => 15, 'exclude_banned' => 0))) {
    ?>

			<?php 
    if (bp_group_member_needs_pagination()) {
        ?>

				<div class="pagination no-ajax">

					<div id="member-count" class="pag-count">
						<?php 
        bp_group_member_pagination_count();
        ?>
					</div>

					<div id="member-admin-pagination" class="pagination-links">
开发者ID:buddypress,项目名称:BuddyPress-build,代码行数:31,代码来源:manage-members.php

示例12: while

<?php

/**
 * Apocrypha Theme Members Loop
 * Andrew Clayton
 * Version 2.0
 * 9-22-2014
 */
?>

<?php 
// Group members
if (bp_is_group() && bp_group_has_members('exclude_admins_mods=0') || bp_has_members(bp_ajax_querystring('members'))) {
    ?>

<ul id="members-list" class="directory-list" role="main">
	<?php 
    // Loop through all members
    while (bp_members()) {
        bp_the_member();
        $user = new Apoc_User(bp_get_member_user_id(), 'directory', 60);
        ?>
		<li class="member directory-entry">
			<div class="directory-member reply-author">
				<?php 
        echo $user->block;
        ?>
			</div>

			<div class="directory-content">
开发者ID:tamriel-foundry,项目名称:apoc2,代码行数:30,代码来源:members-loop.php

示例13: _e

                                                <div id="message" class="info">
                                                    <p><?php 
    _e('This group has no members', 'qode');
    ?>
</p>
                                                </div>

                                            <?php 
}
?>
 -->
											
											
											
												<?php 
if (bp_group_has_members("group_id={$buddypress_id}&exclude_admins_mods=1")) {
    ?>
												
												 	<ul id="member-list" class="item-list" role="main">

														<?php 
    while (bp_group_members()) {
        bp_group_the_member();
        if (get_user_by('id', bp_get_group_member_id())->user_status == 2) {
            continue;
        }
        ?>

															<li><a href="<?php 
        bp_group_member_domain();
        ?>
开发者ID:Bnei-Baruch,项目名称:kabacademy,代码行数:31,代码来源:single-namaste_course_old_user_list.php

示例14: vibe_get_option

<?php

if (function_exists('vibe_get_option')) {
    $loop_number = vibe_get_option('loop_number');
}
if (!isset($loop_number) || !is_numeric($loop_number)) {
    $loop_number = 5;
}
$appended = '&per_page=' . $loop_number;
if (bp_group_has_members(bp_ajax_querystring('group_members') . $appended)) {
    ?>

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

	<div id="pag-top" class="pagination no-ajax">

		<div class="pag-count" id="member-count-top">

			<?php 
    bp_members_pagination_count();
    ?>

		</div>

		<div class="pagination-links" id="member-pag-top">

			<?php 
    bp_members_pagination_links();
    ?>
开发者ID:Juni4567,项目名称:meritscholarship,代码行数:31,代码来源:members.php

示例15: user_list_html

 function user_list_html($html, $selected)
 {
     if (bp_group_has_members(array('exclude_admins_mods' => false, 'per_page' => false, 'max' => false))) {
         global $members_template;
         usort($members_template->members, array(&$this, 'sort_by_display_name_cb'));
         $html = '<select name="cp-task-assign" id="cp-task-assign">';
         while (bp_group_members()) {
             bp_group_the_member();
             $html .= '<option value="' . bp_get_group_member_id() . '" ' . selected(bp_get_group_member_id(), $selected, false) . '>' . bp_get_group_member_name() . '</option>';
         }
         $html .= '</select>';
     }
     return $html;
 }
开发者ID:clarkewd,项目名称:CollabPress,代码行数:14,代码来源:cp-bp-groups.php


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