本文整理汇总了PHP中bp_get_group_member_id函数的典型用法代码示例。如果您正苦于以下问题:PHP bp_get_group_member_id函数的具体用法?PHP bp_get_group_member_id怎么用?PHP bp_get_group_member_id使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了bp_get_group_member_id函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: invite_anyone_invite_query
/**
* Fetch a list of site members eligible to be invited to a group.
*
* The list is essentially a list of everyone on the site, minus the logged in user and members
* of the current group.
*
* @package Invite Anyone
* @since 1.0
*
* @param int $group_id The group_id you want to exclude
* @param str $search_terms If you want to search on username/display name
* @return array $users An array of located users
*/
function invite_anyone_invite_query($group_id = false, $search_terms = false, $fields = 'all')
{
// Get a list of group members to be excluded from the main query
$group_members = array();
$args = array('group_id' => $group_id, 'exclude_admins_mods' => false);
if ($search_terms) {
$args['search'] = $search_terms;
}
if (bp_group_has_members($args)) {
while (bp_group_members()) {
bp_group_the_member();
$group_members[] = bp_get_group_member_id();
}
}
// Don't include the logged-in user, either
$group_members[] = bp_loggedin_user_id();
$fields = 'ID' == $fields ? 'ID' : 'all';
// Now do a user query
// Pass a null blog id so that the capabilities check is skipped. For BP blog_id doesn't
// matter anyway
$user_query = new Invite_Anyone_User_Query(array('blog_id' => NULL, 'exclude' => $group_members, 'search' => $search_terms, 'fields' => $fields));
return $user_query->results;
}
示例2: bp_group_member_id
function bp_group_member_id()
{
echo bp_get_group_member_id();
}
示例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'));
}
}
}
}
//.........这里部分代码省略.........
示例4: bp_group_member_joined_since
bp_group_member_joined_since();
?>
</span>
<?php
do_action('bp_group_members_list_item');
?>
<?php
if (bp_is_active('friends')) {
?>
<div class="action">
<?php
bp_add_friend_button(bp_get_group_member_id(), bp_get_group_member_is_friend());
?>
<?php
do_action('bp_group_members_list_item_action');
?>
</div>
<?php
}
?>
</li>
<?php
}
示例5: 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;
}
示例6: 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);
}
}
}
}
示例7: bp_group_management_admin_edit
//.........这里部分代码省略.........
<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
while (bp_group_members()) {
bp_group_the_member();
?>
<?php
if (bp_get_group_member_is_banned()) {
?>
<li class="banned-user">
<?php
bp_group_member_avatar_mini();
?>
<?php
$unkicklink = "admin.php?page=bp-group-management&action=edit&id=" . $id . "&member_id=" . bp_get_group_member_id() . "&member_action=unkick";
$unkicklink = function_exists('wp_nonce_url') ? wp_nonce_url($unkicklink, 'bp-group-management-action_unkick') : $unkicklink;
?>
<?php
bp_group_member_link();
?>
<?php
_e('(banned)', 'bp-group-management');
?>
<span class="small"> - <a href="<?php
echo $unkicklink;
?>
" class="confirm" title="<?php
_e('Remove Ban', 'bp-group-management');
?>
"><?php
_e('Remove Ban', 'bp-group-management');
?>
</a>
<?php
} else {
?>
<li>
<?php
bp_group_member_avatar_mini();
?>
<?php
$kicklink = "admin.php?page=bp-group-management&action=edit&id=" . $id . "&member_id=" . bp_get_group_member_id() . "&member_action=kick";
$kicklink = function_exists('wp_nonce_url') ? wp_nonce_url($kicklink, 'bp-group-management-action_kick') : $kicklink;
$removelink = "admin.php?page=bp-group-management&action=edit&id=" . $id . "&member_id=" . bp_get_group_member_id() . "&member_action=remove";
示例8: while
}
?>
-->
<?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();
?>
">
<?php
bp_group_member_avatar_thumb();
?>
</a>
示例9: while
<?php
while (bp_group_members()) {
bp_group_the_member();
?>
<li class="<?php
bp_group_member_css_class();
?>
">
<div class="item-avatar">
<a href="<?php
bp_group_member_url();
?>
">
<?php
echo bp_core_fetch_avatar(array('item_id' => bp_get_group_member_id(), 'type' => 'thumb', 'width' => 50, 'height' => 50, 'alt' => sprintf(__('Profile picture of %s', 'bp-magic'), bp_get_group_member_name())));
?>
</a>
</div>
<div class="item">
<div class="item-title">
<?php
bp_group_member_link();
?>
</div>
</div>
<div class="action">
<?php
if (bp_get_group_member_is_banned()) {
_e('(banned)', 'bp-magic');