當前位置: 首頁>>代碼示例>>PHP>>正文


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怎麽用?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;
開發者ID:KRCM13,項目名稱:chamilo-lms,代碼行數:31,代碼來源:profile.php

示例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);
開發者ID:KRCM13,項目名稱:chamilo-lms,代碼行數:31,代碼來源:download.php


注:本文中的UserGroup::get_all_users_by_group方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。