本文整理匯總了PHP中BP_Groups_Member::check_is_admin方法的典型用法代碼示例。如果您正苦於以下問題:PHP BP_Groups_Member::check_is_admin方法的具體用法?PHP BP_Groups_Member::check_is_admin怎麽用?PHP BP_Groups_Member::check_is_admin使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類BP_Groups_Member
的用法示例。
在下文中一共展示了BP_Groups_Member::check_is_admin方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: groups_is_user_admin
/**
* Check whether a user is an admin of a given group.
*
* @param int $user_id ID of the user.
* @param int $group_id ID of the group.
*
* @return bool
*/
function groups_is_user_admin($user_id, $group_id)
{
return BP_Groups_Member::check_is_admin($user_id, $group_id);
}
示例2: get_invitable_friend_count
function get_invitable_friend_count($user_id, $group_id)
{
// Setup some data we'll use below
$is_group_admin = BP_Groups_Member::check_is_admin($user_id, $group_id);
$friend_ids = BP_Friends_Friendship::get_friend_user_ids($user_id);
$invitable_count = 0;
for ($i = 0, $count = count($friend_ids); $i < $count; ++$i) {
// If already a member, they cannot be invited again
if (BP_Groups_Member::check_is_member((int) $friend_ids[$i], $group_id)) {
continue;
}
// If user already has invite, they cannot be added
if (BP_Groups_Member::check_has_invite((int) $friend_ids[$i], $group_id)) {
continue;
}
// If user is not group admin and friend is banned, they cannot be invited
if (false === $is_group_admin && BP_Groups_Member::check_is_banned((int) $friend_ids[$i], $group_id)) {
continue;
}
$invitable_count++;
}
return $invitable_count;
}