本文整理汇总了PHP中UserGroup::get_all_users_by_group方法的典型用法代码示例。如果您正苦于以下问题:PHP UserGroup::get_all_users_by_group方法的具体用法?PHP UserGroup::get_all_users_by_group怎么用?PHP UserGroup::get_all_users_by_group使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UserGroup
的用法示例。
在下文中一共展示了UserGroup::get_all_users_by_group方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: foreach
$i = 1;
foreach ($results as $result) {
if ($i > $max_numbers_of_group) {
break;
}
$id = $result['id'];
$url_open = '<a href="group_view.php?id=' . $id . '">';
$url_close = '</a>';
$icon = '';
$name = cut($result['name'], CUT_GROUP_NAME, true);
if ($result['relation_type'] == GROUP_USER_PERMISSION_ADMIN) {
$icon = Display::return_icon('social_group_admin.png', get_lang('Admin'), array('style' => 'vertical-align:middle;width:16px;height:16px;'));
} elseif ($result['relation_type'] == GROUP_USER_PERMISSION_MODERATOR) {
$icon = Display::return_icon('social_group_moderator.png', get_lang('Moderator'), array('style' => 'vertical-align:middle;width:16px;height:16px;'));
}
$count_users_group = count($userGroup->get_all_users_by_group($id));
if ($count_users_group == 1) {
$count_users_group = $count_users_group . ' ' . get_lang('Member');
} else {
$count_users_group = $count_users_group . ' ' . get_lang('Members');
}
$item_name = $url_open . $name . $icon . $url_close;
$item_actions = '';
$grid_my_groups[] = array($item_name, $url_open . $result['picture'] . $url_close, $item_actions);
$i++;
}
}
// Block My Groups
if (count($grid_my_groups) > 0) {
$my_groups = '';
$count_groups = 0;
示例2: array
$current_uid = api_get_user_id();
// get message user id for inbox/outbox
$message_uid = '';
$message_type = array('inbox', 'outbox');
if (in_array($_GET['type'], $message_type)) {
if ($_GET['type'] == 'inbox') {
$message_uid = $row_users['user_receiver_id'];
} else {
$message_uid = $row_users['user_sender_id'];
}
}
// allow to the correct user for download this file
$not_allowed_to_edit = false;
$userGroup = new UserGroup();
if (!empty($row_users['group_id'])) {
$users_group = $userGroup->get_all_users_by_group($row_users['group_id']);
if (!in_array($current_uid, array_keys($users_group))) {
$not_allowed_to_edit = true;
}
} else {
if ($current_uid != $message_uid) {
$not_allowed_to_edit = true;
}
}
if ($not_allowed_to_edit) {
api_not_allowed();
exit;
}
// set the path directory file
if (!empty($row_users['group_id'])) {
$path_user_info = $userGroup->get_group_picture_path_by_id($row_users['group_id'], 'system', true);