本文整理汇总了PHP中bp_add_friend_button函数的典型用法代码示例。如果您正苦于以下问题:PHP bp_add_friend_button函数的具体用法?PHP bp_add_friend_button怎么用?PHP bp_add_friend_button使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了bp_add_friend_button函数的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: bp_friends_random_members
function bp_friends_random_members( $total_members = 5 ) {
global $bp;
if ( !$user_ids = wp_cache_get( 'friends_random_users', 'bp' ) ) {
$user_ids = BP_Core_User::get_users( 'random', $total_members );
wp_cache_set( 'friends_random_users', $user_ids, 'bp' );
}
?>
<?php if ( $user_ids['users'] ) { ?>
<ul class="item-list" id="random-members-list">
<?php for ( $i = 0; $i < count( $user_ids['users'] ); $i++ ) { ?>
<li>
<a href="<?php echo bp_core_get_user_domain( $user_ids['users'][$i]->user_id ) ?>"><?php echo bp_core_fetch_avatar( array( 'item_id' => $user_ids['users'][$i]->user_id, 'type' => 'thumb' ) ) ?></a>
<h5><?php echo bp_core_get_userlink( $user_ids['users'][$i]->user_id ) ?></h5>
<?php if ( function_exists( 'xprofile_get_random_profile_data' ) ) { ?>
<?php $random_data = xprofile_get_random_profile_data( $user_ids['users'][$i]->user_id, true ); ?>
<div class="profile-data">
<p class="field-name"><?php echo $random_data[0]->name ?></p>
<?php echo $random_data[0]->value ?>
</div>
<?php } ?>
<div class="action">
<?php if ( function_exists( 'bp_add_friend_button' ) ) { ?>
<?php bp_add_friend_button( $user_ids['users'][$i]->user_id ) ?>
<?php } ?>
</div>
</li>
<?php } ?>
</ul>
<?php } else { ?>
<div id="message" class="info">
<p><?php _e( "There aren't enough site members to show a random sample just yet.", 'buddypress' ) ?></p>
</div>
<?php } ?>
<?php
}
示例2: bp_member_add_friend_button
/**
* Output the "Add Friend" button in the member loop.
*
* @since 1.2.6
*/
function bp_member_add_friend_button()
{
bp_add_friend_button(bp_get_member_user_id());
}
示例3: bp_group_mod_memberlist
function bp_group_mod_memberlist($admin_list = false, $group = false)
{
global $groups_template;
if (empty($group)) {
$group =& $groups_template->group;
}
if ($group_mods = groups_get_group_mods($group->id)) {
?>
<ul id="mods-list" class="item-list<?php
if ($admin_list) {
?>
single-line<?php
}
?>
">
<?php
foreach ((array) $group_mods as $mod) {
?>
<?php
if (!empty($admin_list)) {
?>
<li>
<?php
echo bp_core_fetch_avatar(array('item_id' => $mod->user_id, 'type' => 'thumb', 'width' => 30, 'height' => 30, 'alt' => sprintf(__('Profile picture of %s', 'buddypress'), bp_core_get_user_displayname($mod->user_id))));
?>
<h5>
<?php
echo bp_core_get_userlink($mod->user_id);
?>
<span class="small">
<a href="<?php
bp_group_member_promote_admin_link(array('user_id' => $mod->user_id));
?>
" class="button confirm mod-promote-to-admin" title="<?php
esc_attr_e('Promote to Admin', 'buddypress');
?>
"><?php
_e('Promote to Admin', 'buddypress');
?>
</a>
<a class="button confirm mod-demote-to-member" href="<?php
bp_group_member_demote_link($mod->user_id);
?>
"><?php
_e('Demote to Member', 'buddypress');
?>
</a>
</span>
</h5>
</li>
<?php
} else {
?>
<li>
<?php
echo bp_core_fetch_avatar(array('item_id' => $mod->user_id, 'type' => 'thumb', 'alt' => sprintf(__('Profile picture of %s', 'buddypress'), bp_core_get_user_displayname($mod->user_id))));
?>
<h5><?php
echo bp_core_get_userlink($mod->user_id);
?>
</h5>
<span class="activity"><?php
echo bp_core_get_last_activity(strtotime($mod->date_modified), __('joined %s', 'buddypress'));
?>
</span>
<?php
if (bp_is_active('friends')) {
?>
<div class="action">
<?php
bp_add_friend_button($mod->user_id);
?>
</div>
<?php
}
?>
</li>
<?php
}
?>
<?php
}
?>
//.........这里部分代码省略.........
示例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: bp_activity_latest_update
bp_activity_latest_update(bp_displayed_user_id());
?>
</div>
<?php
}
?>
</div>
<div class="widget">
</div>
<div id="item-meta">
<div id="item-buttons">
<?php
if (function_exists('bp_add_friend_button')) {
?>
<?php
bp_add_friend_button();
?>
<?php
}
?>
<?php
if (is_user_logged_in() && !bp_is_my_profile() && function_exists('bp_send_public_message_link')) {
?>
<div class="generic-button" id="post-mention">
<a href="<?php
bp_send_public_message_link();
?>
" title="<?php
_e('Mention this user in a new public message, this will send the user a notification to get their attention.', 'cc');
?>
示例6: bp_the_site_member_add_friend_button
function bp_the_site_member_add_friend_button()
{
global $site_members_template;
if (function_exists('bp_add_friend_button')) {
echo bp_add_friend_button($site_members_template->member->id);
}
}
示例7: bp_group_member_link
?>
<h5><?php
bp_group_member_link();
?>
</h5>
<span class="activity"><?php
bp_group_member_joined_since();
?>
</span>
<?php
if (function_exists('friends_install')) {
?>
<div class="action">
<?php
bp_add_friend_button(bp_group_member_id());
?>
</div>
<?php
}
?>
</li>
<?php
}
?>
</ul>
<?php
} else {
?>
示例8: bp_group_mod_memberlist
function bp_group_mod_memberlist( $admin_list = false, $group = false ) {
global $groups_template, $group_mods;
if ( !$group )
$group =& $groups_template->group;
$group_mods = groups_get_group_mods( $group->id );
?>
<?php if ( $group_mods ) { ?>
<ul id="mods-list" class="item-list<?php if ( $admin_list ) { ?> single-line<?php } ?>">
<?php foreach ( (array)$group_mods as $mod ) { ?>
<?php if ( $admin_list ) { ?>
<li>
<?php echo bp_core_fetch_avatar( array( 'item_id' => $mod->user_id, 'type' => 'thumb', 'width' => 30, 'height' => 30 ) ) ?>
<h5><?php echo bp_core_get_userlink( $mod->user_id ) ?> <span class="small"> — <a href="<?php bp_group_member_promote_admin_link( array( 'user_id' => $mod->user_id ) ) ?>" class="confirm" title="<?php _e( 'Promote to Admin', 'buddypress' ); ?>"><?php _e( 'Promote to Admin', 'buddypress' ); ?></a> | <a class="confirm" href="<?php bp_group_member_demote_link($mod->user_id) ?>"><?php _e( 'Demote to Member', 'buddypress' ) ?></a></span></h5>
</li>
<?php } else { ?>
<li>
<?php echo bp_core_fetch_avatar( array( 'item_id' => $mod->user_id, 'type' => 'thumb' ) ) ?>
<h5><?php echo bp_core_get_userlink( $mod->user_id ) ?></h5>
<span class="activity"><?php echo bp_core_get_last_activity( strtotime( $mod->date_modified ), __( 'joined %s ago', 'buddypress') ); ?></span>
<?php if ( function_exists( 'friends_install' ) ) : ?>
<div class="action">
<?php bp_add_friend_button( $mod->user_id ) ?>
</div>
<?php endif; ?>
</li>
<?php } ?>
<?php } ?>
</ul>
<?php } else { ?>
<div id="message" class="info">
<p><?php _e( 'This group has no moderators', 'buddypress' ); ?></p>
</div>
<?php }
}
示例9: groups_ajax_member_list
function groups_ajax_member_list()
{
global $bp;
?>
<?php
if (bp_group_has_members('group_id=' . $_REQUEST['group_id'])) {
?>
<?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();
?>
</div>
<?php
}
?>
<ul id="member-list" class="item-list">
<?php
while (bp_group_members()) {
bp_group_the_member();
?>
<li>
<?php
bp_group_member_avatar();
?>
<h5><?php
bp_group_member_link();
?>
</h5>
<span class="activity"><?php
bp_group_member_joined_since();
?>
</span>
<?php
if (function_exists('friends_install')) {
?>
<div class="action">
<?php
bp_add_friend_button(bp_group_member_id());
?>
</div>
<?php
}
?>
</li>
<?php
}
?>
</ul>
<?php
} else {
?>
<div id="message" class="info">
<p><?php
_e('This group has no members.', 'buddypress');
?>
</p>
</div>
<?php
}
?>
<input type="hidden" name="group_id" id="group_id" value="<?php
echo attribute_escape($_REQUEST['group_id']);
?>
" />
<?php
}
示例10: gconnect_member_header
function gconnect_member_header()
{
if (bp_is_active('friends')) {
bp_add_friend_button();
}
if (bp_is_active('activity')) {
bp_send_public_message_button();
}
if (bp_is_active('messages')) {
bp_send_private_message_button();
}
}
示例11: bp_show_friend_suggestions_list
function bp_show_friend_suggestions_list($limit = 5)
{
$user_id = get_current_user_id();
$my_friends = (array) friends_get_friend_user_ids($user_id);
//get all friend ids
$my_friend_req = (array) friend_suggest_get_friendship_requested_user_ids($user_id);
//get all friend request by me
$possible_friends = array();
//we will store the possible friend ids here
foreach ($my_friends as $friend_id) {
$possible_friends = array_merge($possible_friends, (array) friends_get_friend_user_ids($friend_id));
}
//we have the list of friends of friends, we will just remove
//now get only udifferent friend ids(unique)
$possible_friends = array_unique($possible_friends);
//intersect my friends with this array
$my_friends[] = get_current_user_id();
//include me to
$excluded_users = get_user_meta($user_id, 'hidden_friend_suggestions', true);
$excluded_users = array_merge($my_friends, (array) $excluded_users, (array) $my_friend_req);
//we may check the preference of the user regarding , like not add
$possible_friends = array_diff($possible_friends, $excluded_users);
//get those user who are not my friend and also exclude me too
if (!empty($possible_friends)) {
shuffle($possible_friends);
//randomize
$possible_friends = array_slice($possible_friends, 0, $limit);
}
if (!empty($possible_friends)) {
?>
<ul id="members-suggestion-list" class="item-list suggested-friend-item-list">
<?php
foreach ($possible_friends as $possible_friend) {
?>
<li>
<?php
$member_link = bp_core_get_user_domain($possible_friend);
$member_name = bp_core_get_user_displayname($possible_friend);
?>
<div class="item-avatar">
<a href="<?php
echo $member_link;
?>
"><?php
echo bp_core_fetch_avatar(array('type' => 'thumb', 'width' => 50, 'height' => 50, 'item_id' => $possible_friend));
?>
</a>
</div>
<div class="item">
<div class="item-title">
<a href="<?php
echo $member_link;
?>
"><?php
echo $member_name;
?>
</a>
</div>
</div>
<div class="action">
<?php
bp_friend_suggest_hide_link($possible_friend);
?>
<?php
bp_add_friend_button($possible_friend);
?>
</div>
<div class="clear"></div>
</li>
<?php
}
?>
</ul>
<?php
} else {
?>
<div id="message" class="info">
<p><?php
_e("We don't have enough details to suggest a friend yet", 'bp-friends-suggest');
?>
</p>
</div>
<?php
}
?>
<?php
}
示例12: bp_group_mod_memberlist
function bp_group_mod_memberlist($admin_list = false, $group = false)
{
global $groups_template, $group_mods;
if (!$group) {
$group =& $groups_template->group;
}
$group_mods = groups_get_group_mods($group->id);
?>
<?php
if ($group_mods) {
?>
<ul id="mods-list" class="item-list<?php
if ($admin_list) {
?>
single-line<?php
}
?>
">
<?php
foreach ($group_mods as $mod) {
?>
<?php
if ($admin_list) {
?>
<li>
<?php
echo bp_core_get_avatar($mod->user_id, 1, 30, 30);
?>
<h5><?php
echo bp_core_get_userlink($mod->user_id);
?>
<span class="small"> — <a href="<?php
bp_group_member_ban_link();
?>
"><?php
_e('Kick & Ban', 'buddypress');
?>
</a> | <a href="<?php
bp_group_member_demote_link($mod->user_id);
?>
"><?php
_e('Demote to Member', 'buddypress');
?>
</a></span></h5>
</li>
<?php
} else {
?>
<li>
<?php
echo bp_core_get_avatar($mod->user_id, 1);
?>
<h5><?php
echo bp_core_get_userlink($mod->user_id);
?>
</h5>
<span class="activity"><?php
echo bp_core_get_last_activity(strtotime($mod->date_modified), __('joined %s ago', 'buddypress'));
?>
</span>
<?php
if (function_exists('friends_install')) {
?>
<div class="action">
<?php
bp_add_friend_button($mod->user_id);
?>
</div>
<?php
}
?>
</li>
<?php
}
?>
<?php
}
?>
</ul>
<?php
} else {
?>
<div id="message" class="info">
<p><?php
_e('This group has no moderators', 'buddypress');
?>
</p>
</div>
<?php
}
}
示例13: bp_event_member_joined_since
<span class="activity"><?php
bp_event_member_joined_since();
?>
</span>
<?php
do_action('bp_event_members_list_item');
?>
<?php
if (function_exists('friends_install')) {
?>
<div class="action">
<?php
bp_add_friend_button(bp_get_event_member_id(), bp_get_event_member_is_friend());
?>
<?php
do_action('bp_event_members_list_item_action');
?>
</div>
<?php
}
?>
</li>
<?php
}
?>