本文整理汇总了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;
}