• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

PHP get_group_members函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中get_group_members函数的典型用法代码示例。如果您正苦于以下问题:PHP get_group_members函数的具体用法?PHP get_group_members怎么用?PHP get_group_members使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了get_group_members函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: showFormAction

 /**
  * Builds a page with members edit form.
  *
  * @param Request $request Incoming request.
  * @return string Rendered page content.
  * @throws NotFoundException If the operator's group with specified ID is
  *   not found in the system.
  */
 public function showFormAction(Request $request)
 {
     $operator = $this->getOperator();
     $group_id = $request->attributes->getInt('group_id');
     $page = array('groupid' => $group_id, 'errors' => $request->attributes->get('errors', array()));
     $operators = get_operators_list();
     $group = group_by_id($group_id);
     // Check if the group exists
     if (!$group) {
         throw new NotFoundException('The group is not found.');
     }
     $page['formop'] = array();
     $page['currentgroup'] = $group ? htmlspecialchars($group['vclocalname']) : '';
     // Get list of group's members
     $checked_operators = get_group_members($group_id);
     // Prepare the list of all operators
     $page['operators'] = array();
     foreach ($operators as $op) {
         $op['vclocalename'] = $op['vclocalename'];
         $op['vclogin'] = $op['vclogin'];
         $op['checked'] = in_array($op['operatorid'], $checked_operators);
         $page['operators'][] = $op;
     }
     // Set other values and render the page
     $page['stored'] = $request->query->get('stored');
     $page['title'] = getlocal('Members');
     $page['menuid'] = 'groups';
     $page = array_merge($page, prepare_menu($operator));
     $page['tabs'] = $this->buildTabs($request);
     return $this->render('group_members', $page);
 }
开发者ID:abhijitroy07,项目名称:mibew,代码行数:39,代码来源:MembersController.php


示例2: unjoinGroup

function unjoinGroup($group_id, $privacy)
{
    global $db, $current_user;
    if (!is_numeric($group_id)) {
        die;
    }
    //$isMember = isMember($story_id);if($privacy == 'public')
    $sql2 = "delete from " . table_group_member . " where member_user_id = '" . $current_user->user_id . "' and member_group_id = '" . $group_id . "' ";
    $db->query($sql2);
    //member count update decrease
    $member_count = get_group_members($group_id);
    $member_update = "update " . table_groups . " set group_members = '" . $member_count . "' where group_id = '" . $group_id . "' ";
    $db->query($member_update);
}
开发者ID:bendroid,项目名称:pligg-cms,代码行数:14,代码来源:group.php


示例3: getInThisGroupAlsoIN

function getInThisGroupAlsoIN($group, $limit)
{
    $userLimit = 100;
    $members = get_group_members($group->guid, $userLimit, 0);
    $memberIds = array();
    if (!empty($members)) {
        foreach ($members as $member) {
            $memberIds[] = $member->getGUID();
        }
    }
    $in = "r.guid_one IN (" . implode(",", $memberIds) . ")";
    $notIn = "r.guid_two NOT IN (" . $group->guid . ")";
    $groups = elgg_get_entities_from_relationship(array('relationship' => 'member', 'inverse_relationship' => false, 'type' => 'group', 'limit' => $limit, 'offset' => 0, 'count' => false, 'wheres' => array($in, $notIn), 'group_by' => 'r.guid_two', 'order_by' => 'count(r.guid_one) DESC'));
    return $groups;
    /*$content = '';
    	foreach ($groups as $group){
    		$content .= $group->guid;
    	}
    	return $content;*/
}
开发者ID:pingwangcs,项目名称:51zhaohu,代码行数:20,代码来源:functions.php


示例4: tp_get_tag_list

/**
 * get a list of people that can be tagged in an image
 *
 * @param $viewer entity
 * @return array of guid->name for tagging
 */
function tp_get_tag_list($viewer)
{
    $friends = get_user_friends($viewer->getGUID(), '', 999, 0);
    $friend_list = array();
    if ($friends) {
        foreach ($friends as $friend) {
            //error_log("friend $friend->name");
            $friend_list[$friend->guid] = $friend->name;
        }
    }
    // is this a group
    $is_group = tp_is_group_page();
    if ($is_group) {
        $group_guid = page_owner();
        $viewer_guid = $viewer->guid;
        $members = get_group_members($group_guid, 999);
        if (is_array($members)) {
            foreach ($members as $member) {
                if ($viewer_guid != $member->guid) {
                    $group_list[$member->guid] = $member->name;
                    //error_log("group $member->name");
                }
            }
            // combine group and friends list
            $intersect = array_intersect_key($friend_list, $group_list);
            $unique_friends = array_diff_key($friend_list, $group_list);
            $unique_members = array_diff_key($group_list, $friend_list);
            //$friend_list = array_merge($friend_list, $group_list);
            //$friend_list = array_unique($friend_list);
            $friend_list = $intersect + $unique_friends + $unique_members;
        }
    }
    asort($friend_list);
    return $friend_list;
}
开发者ID:rijojoy,项目名称:MyIceBerg,代码行数:41,代码来源:tidypics.php


示例5: pleio_api_format_group

function pleio_api_format_group(ElggGroup $group, $user_guid)
{
    $g = pleio_api_export($group, explode(",", "guid,owner_guid,site_guid,name,description"));
    $metadata = pleio_api_get_metadata($group->guid);
    if ($metadata["swordfish_group"]) {
        $g["swordfish"] = $metadata["swordfish_group"];
        $g["name"] .= " [SwordFish]";
    }
    $g["avatar"] = $metadata["icontime"] ? "1" : "0";
    $g["owner_name"] = get_entity($group->owner_guid)->name;
    $g["public"] = $group->membership == ACCESS_PUBLIC ? 1 : 0;
    $g["member"] = is_group_member($g["guid"], $user_guid) ? 1 : 0;
    $g["description"] = trim(strip_tags($g["description"]));
    $g["member_total"] = get_group_members($g["guid"], 0, 0, 0, true);
    $g["has_invitation"] = 0;
    $g["has_pending_membership_request"] = 0;
    if (!$g["member"]) {
        $g["has_invitation"] = check_entity_relationship($group->guid, 'invited', $user_guid) ? 1 : 0;
        $g["has_pending_membership_request"] = check_entity_relationship($user_guid, 'membership_request', $group->guid) ? 1 : 0;
    }
    return $g;
}
开发者ID:appstaat,项目名称:pleio_api,代码行数:22,代码来源:helpers.php


示例6: array

}
?>
           
            
          <tr>
            <td valign="top">
            
            
            <?php 
#$page_list = array();
if (!empty($page_list)) {
    echo "<table width='100%' border='0' cellspacing='0' cellpadding='5'>\r\r\n          \t<tr>\r\r\n\t\t\t<td class='listheader' width='1%'>&nbsp;</td>\r\r\n           \t<td class='listheader' nowrap>Group &nbsp;<a class='fancybox fancybox.ajax' href='" . base_url() . "user/load_staff_groups_form')' title='Click to add a user'><img src='" . base_url() . "images/add_item.png' border='0'/></a></td>\r\r\n\t\t\t<td class='listheader' nowrap>Comments</td>\r\r\n\t\t\t<td class='listheader' nowrap>Staff</td>\r\r\n\t\t\t<td class='listheader' nowrap>Date Added</td>\r\r\n\t\t\t</tr>";
    $counter = 0;
    foreach ($page_list as $row) {
        #Get number of users in each group
        $staff = get_group_members($this, $row['id']);
        #Show one row at a time
        echo "<tr id='listrow-" . $row['id'] . "' class='listrow' style='" . get_row_color($counter, 2) . "'>\r\r\n\t\t<td class='leftListCell rightListCell' valign='top' nowrap>";
        #if(check_user_access($this,'delete_deal')){
        echo "<a href='javascript:void(0)' onclick=\"asynchDelete('" . base_url() . "user/delete_staff_group/i/" . encryptValue($row['id']) . "', 'Are you sure you want to remove this staff group? \\nThis operation can not be undone. \\nClick OK to confirm, \\nCancel to cancel this operation and stay on this page.','listrow-" . $row['id'] . "');\" title=\"Click to remove this staff group.\"><img src='" . base_url() . "images/delete.png' border='0'/></a>";
        #}
        #if(check_user_access($this,'update_deals')){
        echo " &nbsp;&nbsp; <a class='fancybox fancybox.ajax' href='" . base_url() . "user/load_staff_groups_form/i/" . encryptValue($row['id']) . "' title=\"Click to edit this group's details.\"><img src='" . base_url() . "images/edit.png' border='0'/></a>";
        #}
        #if(check_user_access($this,'update_deals')){
        echo " &nbsp;&nbsp; <a class='fancybox fancybox.ajax' href='" . base_url() . "user/manage_staff_group_rights/i/" . encryptValue($row['id']) . "' title=\"Click to edit this group's rights.\"><img src='" . base_url() . "images/user_group_settings.png' border='0'/></a>";
        #}
        echo "</td>\t\t\r\r\n\t\t\t\t<td valign='top'>" . $row['groupname'] . "</td>\t\t\r\r\n\t\t\t\t<td valign='top'>" . substr($row['comments'], 0, 20) . "..</td>\r\r\n\t\t\t\t<td valign='top'>" . $staff->num_rows() . "</td>\r\r\n\t\t\t\t<td class='rightListCell' valign='top'>" . date("j M, Y", GetTimeStamp($row['dateadded'])) . "</td>\t\t\r\r\n\t\t\t</tr>";
        $counter++;
    }
    echo "<tr>\r\r\n\t\t<td colspan='5' align='right'  class='layer_table_pagination'>" . pagination($this->session->userdata('search_total_results'), $rows_per_page, $current_list_page, base_url() . "user/manage_staff_groups/p/%d", "user-groups-results") . "</td></tr></table>";
开发者ID:nwtug,项目名称:academia,代码行数:31,代码来源:manage_staff_groups_view.php


示例7: getFriendsOf

 /**
  * For compatibility with Friendable
  *
  * @param string $subtype The GUID of a user to check.
  * @param int    $limit   Limit
  * @param int    $offset  Offset
  *
  * @return bool
  * @deprecated 1.9 Use \ElggGroup::getMembers()
  */
 public function getFriendsOf($subtype = "", $limit = 10, $offset = 0)
 {
     elgg_deprecated_notice("\\ElggGroup::getFriendsOf() is deprecated. Use \\ElggGroup::getMembers()", 1.9);
     return get_group_members($this->getGUID(), $limit, $offset);
 }
开发者ID:sephiroth88,项目名称:Elgg,代码行数:15,代码来源:ElggGroup.php


示例8: elgg_view

 * @copyright Curverider Ltd 2008-2009
 * @link http://elgg.com/
 * 
 * @uses $vars['entity'] The user entity
 */
$icon = elgg_view("groups/icon", array('entity' => $vars['entity'], 'size' => 'small'));
//get the membership type
$membership = $vars['entity']->membership;
if ($membership == 2) {
    $mem = elgg_echo("groups:open");
} else {
    $mem = elgg_echo("groups:closed");
}
//for admins display the feature or unfeature option
if ($vars['entity']->featured_group == "yes") {
    $url = $vars['url'] . "action/groups/featured?group_guid=" . $vars['entity']->guid . "&action=unfeature";
    $wording = elgg_echo("groups:makeunfeatured");
} else {
    $url = $vars['url'] . "action/groups/featured?group_guid=" . $vars['entity']->guid . "&action=feature";
    $wording = elgg_echo("groups:makefeatured");
}
$info .= "<div class=\"groupdetails\"><p>" . $mem . " / <b>" . get_group_members($vars['entity']->guid, 10, 0, 0, true) . "</b> " . elgg_echo("groups:member") . "</p>";
//if admin, show make featured option
if (issuperadminloggedin()) {
    $info .= "<p><a href=\"{$url}\">{$wording}</a></p>";
}
$info .= "</div>";
$info .= "<p><b><a href=\"" . $vars['entity']->getUrl() . "\">" . $vars['entity']->name . "</a></b></p>";
$info .= "<p class=\"owner_timestamp\">" . $vars['entity']->briefdescription . "</p>";
// num users, last activity, owner etc
echo elgg_view_listing($icon, $info);
开发者ID:portokallidis,项目名称:Metamorphosis-Meducator,代码行数:31,代码来源:grouplisting.php


示例9: getmyurl

        $main_smarty->assign('group_shared_display', $main_smarty->get_config_vars('PLIGG_Visual_Group_Is_Private'));
        $main_smarty->assign('group_upcoming_display', $main_smarty->get_config_vars('PLIGG_Visual_Group_Is_Private'));
        $main_smarty->assign('group_published_display', $main_smarty->get_config_vars('PLIGG_Visual_Group_Is_Private'));
        $main_smarty->assign('member_display', $main_smarty->get_config_vars('PLIGG_Visual_Group_Is_Private'));
    }
} else {
    $redirect = '';
    $redirect = getmyurl("groups");
    header("Location: {$redirect}");
    die;
}
//displaying group as story
if (isset($requestID)) {
    group_display($requestID);
}
$main_smarty->assign('get_group_members', get_group_members($requestID));
$view = sanitize(sanitize($_REQUEST["view"], 1), 3);
if ($view == '') {
    $view = 'published';
}
$main_smarty->assign('groupview', $view);
if ($view == 'upcoming') {
    $main_smarty->assign('URL_rss_page', getmyurl('rsspage', '', 'queued', $requestID));
} elseif ($view != 'members') {
    $main_smarty->assign('URL_rss_page', getmyurl('rsspage', '', $view, $requestID));
}
$main_smarty->assign('groupview_published', getmyurl('group_story2', $requestTitle, 'published', $requestID));
$main_smarty->assign('groupview_upcoming', getmyurl('group_story2', $requestTitle, 'upcoming', $requestID));
$main_smarty->assign('groupview_sharing', getmyurl('group_story2', $requestTitle, 'shared', $requestID));
$main_smarty->assign('groupview_members', getmyurl('group_story2', $requestTitle, 'members', $requestID));
$main_smarty->assign('group_edit_url', getmyurl('editgroup', $requestID));
开发者ID:pantofla,项目名称:waterfan,代码行数:31,代码来源:group_story.php


示例10: group_tools_menu_entity_handler

function group_tools_menu_entity_handler($hook, $type, $return_value, $params)
{
    $entity = $params["entity"];
    if (elgg_in_context("widgets_groups_show_members") && elgg_instanceof($entity, "group")) {
        // number of members
        $num_members = get_group_members($entity->guid, 10, 0, 0, true);
        $members_string = elgg_echo('groups:member');
        $options = array('name' => 'members', 'text' => $num_members . ' ' . $members_string, 'href' => false, 'priority' => 200);
        $return_value[] = ElggMenuItem::factory($options);
        return $return_value;
    }
}
开发者ID:remy40,项目名称:gvrs,代码行数:12,代码来源:hooks.php


示例11: header

    header("Location: signin.php");
    exit(0);
}
if (!isset($_GET['id'])) {
    // um
    header('Status: 404');
    die('missing id');
}
$db = connect_db();
if (!is_member($db, get_logged_in_user_id(), $_REQUEST['id'])) {
    header("Status: 403 Forbidden");
    exit("403 Forbidden");
}
$user_groups = get_user_groups($db, get_logged_in_user_id());
$group = get_group($db, $_GET['id']);
$members = get_group_members($db, $_GET['id']);
?>

<!DOCTYPE html>
<html>
  <head>
    <title> Members Editing | Study Group Finder </title>
    <script src="js/jquery-1.12.1.min.js" type="text/javascript"></script>
    <script>
        function reload(id){
            self.location="members_edit.php?id="+id;
        }
    </script>
    <?php 
include 'includes/_head.html';
?>
开发者ID:magical,项目名称:cs290-project,代码行数:31,代码来源:members_edit.php


示例12: main

/**
 * Update permissions according to what ECM says.
 */
function main()
{
    $url = ECM_URL . '/api/bindings/' . ECM_EXTERNAL_APP . '/groups';
    logln("Fetching data from {$url}...");
    $groups = fetch_ecm_data($url);
    logln("Fetched " . sizeof($groups) . " groups");
    foreach ($groups as $g) {
        $group_id = (int) $g['group'];
        logln("Updating group {$group_id}...");
        $new_members = $g['members'];
        $old_members = get_group_members($group_id);
        $members_to_remove = array_diff($old_members, $new_members);
        $members_to_add = array_diff($new_members, $old_members);
        update_group($group_id, $members_to_remove, $members_to_add);
    }
}
开发者ID:i5okie,项目名称:ecm,代码行数:19,代码来源:phpbb3_sync.php


示例13: event_calendar_add_personal_events_from_group

function event_calendar_add_personal_events_from_group($event_guid, $group_guid)
{
    $members = get_group_members($group_guid, 100000);
    foreach ($members as $member) {
        $member_id = $member->getGUID();
        event_calendar_add_personal_event($event_guid, $member_id);
    }
}
开发者ID:lionding2009,项目名称:Elgg-Event-Calendar,代码行数:8,代码来源:model.php


示例14: elgg_view

 * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
 * @author Curverider Ltd
 * @copyright Curverider Ltd 2008-2010
 * @link http://elgg.com/
 *
 * @uses $vars['entity'] The user entity
 */
$icon = elgg_view("groups/icon", array('entity' => $vars['entity'], 'size' => 'tiny'));
//get the membership type
$membership = $vars['entity']->membership;
if ($membership == 2) {
    $mem = elgg_echo("groups:open");
} else {
    $mem = elgg_echo("groups:closed");
}
$info .= "<p class='entity_subtext groups'>" . $mem . " / <b>" . get_group_members($vars['entity']->guid, 10, 0, 0, true) . "</b> " . elgg_echo("groups:member");
//for admins only - display the feature or unfeature option
if (isadminloggedin()) {
    if ($vars['entity']->featured_group == "yes") {
        $url = elgg_add_action_tokens_to_url($vars['url'] . "action/groups/featured?group_guid=" . $vars['entity']->guid . "&action=unfeature");
        $wording = elgg_echo("groups:makeunfeatured");
    } else {
        $url = elgg_add_action_tokens_to_url($vars['url'] . "action/groups/featured?group_guid=" . $vars['entity']->guid . "&action=feature");
        $wording = elgg_echo("groups:makefeatured");
    }
    // display 'make featured' option
    $info .= "<br /><a href=\"{$url}\">{$wording}</a>";
}
$info .= "</p>";
$info .= "<p class='entity_title'><a href=\"" . $vars['entity']->getUrl() . "\">" . $vars['entity']->name . "</a></p>";
$info .= "<p class='entity_subtext'>" . $vars['entity']->briefdescription . "</p>";
开发者ID:adamboardman,项目名称:Elgg,代码行数:31,代码来源:grouplisting.php


示例15: print_comments

function print_comments($rec_id)
{
    $query = "SELECT concat(usr.ugr_FirstName,' ',usr.ugr_LastName) as Realname, cmt_Added, cmt_Text\n\t          FROM recThreadedComments\n\t\t\t  LEFT JOIN sysUGrps usr ON usr.ID = cmt_OwnerUgrpID\n\t          WHERE cmt_RecID = {$rec_id}\n\t          AND ! cmt_Deleted\n\t          ORDER BY cmt_Added";
    $res = mysql_query($query);
    if (mysql_num_rows($res) > 0) {
        print "<h3>Comments</h3>\n";
        while ($row = mysql_fetch_assoc($res)) {
            print "<p>" . $row["Realname"] . " - " . $row["cmt_Added"] . "</p>\n";
            print "<p>" . $row["cmt_Text"] . "</p>\n";
        }
    }
}
mysql_connection_select(DATABASE);
if ($groupID) {
    $gres = mysql_query("select grp.ugr_Name from sysUGrps grp where grp.ugr_ID = {$groupID}");
    $row = mysql_fetch_assoc($gres);
    $grp_name = $row["ugr_Name"];
    print "<h1>Blog report for group {$grp_name}</h1>\n";
    print_heading($date);
    $members = get_group_members($groupID);
    foreach ($members as $member) {
        print_blog_entries($member["id"], $member["firstname"] . " " . $member["lastname"], $date);
    }
} else {
    $ures = mysql_query("select concat(usr.ugr_FirstName,' ',usr.ugr_LastName) as Realname from sysUGrps usr usr where usr.ugr_ID = {$userID}");
    $row = mysql_fetch_assoc($ures);
    $usr_name = $row["Realname"];
    print "<h1>Blog report for user {$usr_name}</h1>\n";
    print_heading($date);
    print_blog_entries($userID, $usr_name, $date);
}
开发者ID:HeuristNetwork,项目名称:heurist,代码行数:31,代码来源:reportForUGrpBlog.php


示例16: pleio_api_swordfish_group_connect

function pleio_api_swordfish_group_connect($group_id = 0, $swordfish_group_id = "")
{
    $group_id = intval($group_id);
    $swordfish_group_id = sanitise_string($swordfish_group_id);
    $user = elgg_get_logged_in_user_entity();
    $group = get_entity($group_id);
    $result = "connect:" . ($group->setMetaData("swordfish_group", $swordfish_group_id) ? "Y" : "N");
    foreach (get_group_members($group_id, 10, 0) as $member) {
        $url = pleio_api_swordfish_baseurl($group->site_guid) . "add-user-to-group";
        $swordfish_name = "pleio";
        $params = array("gid" => $swordfish_group_id, "userid" => pleio_api_swordfish_username($member->username), "fullname" => $member->name, "email" => $member->email);
        $result .= "," . $params["userid"] . ":";
        $r = pleio_api_call_swordfish_api($swordfish_name, $url, "POST", $params);
        $result .= $r->ok ? "Y" : "N";
    }
    return $result;
}
开发者ID:appstaat,项目名称:pleio_api,代码行数:17,代码来源:methods.php


示例17: getMembers

 /**
  * Get a list of group members.
  *
  * @param int  $limit  Limit
  * @param int  $offset Offset
  * @param bool $count  Count
  *
  * @return mixed
  */
 public function getMembers($limit = 10, $offset = 0, $count = false)
 {
     return get_group_members($this->getGUID(), $limit, $offset, 0, $count);
 }
开发者ID:elainenaomi,项目名称:labxp2014,代码行数:13,代码来源:ElggGroup.php


示例18: die

            $member = $db->get_row("SELECT * FROM " . table_group_member . " WHERE member_group_id = {$group_id} AND member_user_id = '" . $current_user->user_id . "' ");
            $canIhaveAccess = $member->member_status == 'active' && $member->member_role == 'admin';
        }
    }
    if (!$canIhaveAccess) {
        die("You don't have enough rights");
    }
    //check for request
    $request_exists = $db->get_row($sql = "SELECT * FROM " . table_group_member . " WHERE member_user_id = {$user_id}");
    if ($request_exists) {
        global $db, $current_user;
        $sql = "update " . table_group_member . "  set member_status = '" . $member_status . "' where member_user_id = " . $user_id . " and member_group_id = " . $group_id . " ";
        //echo $sql;
        $result1 = $db->query($sql);
        //update count
        $member_count = get_group_members($group_id);
        $member_update = "update " . table_groups . " set group_members = '" . $member_count . "' where group_id = '" . $group_id . "'";
        $results1 = $db->query($member_update);
    }
    //page redirect
    $requestTitle = $db->get_var("SELECT group_safename FROM " . table_groups . " WHERE group_id = {$group_id}");
    $redirect = str_replace("&amp;", "&", getmyurl('group_story2', $requestTitle, 'members'));
    header("Location: {$redirect}");
    die;
}
//to withdraw join group request
if ($_REQUEST['activate'] == 'withdraw') {
    $group_id = $_REQUEST['group_id'];
    $user_id = $_REQUEST['user_id'];
    if (!is_numeric($user_id) || !is_numeric($group_id)) {
        die;
开发者ID:Grprashanthkumar,项目名称:ColfusionWeb,代码行数:31,代码来源:join_group.php


示例19: update_operator_groups

/**
 * Updates set of groups the operator belongs to.
 *
 * Triggers {@link \Mibew\EventDispatcher\Events::GROUP_UPDATE_OPERATORS} event.
 *
 * @param int $operator_id ID of the operator.
 * @param array $new_value List of operator's groups IDs.
 */
function update_operator_groups($operator_id, $new_value)
{
    // Get difference of groups the operator belongs to before and after the
    // update.
    $original_groups = get_operator_group_ids($operator_id);
    $groups_union = array_unique(array_merge($original_groups, $new_value));
    $groups_intersect = array_intersect($original_groups, $new_value);
    $updated_groups = array_diff($groups_union, $groups_intersect);

    // Get members of all updated groups. It will be used to trigger the
    // "update" event later.
    $original_relations = array();
    foreach ($updated_groups as $group_id) {
        $original_relations[$group_id] = get_group_members($group_id);
    }

    // Update group members
    $db = Database::getInstance();
    $db->query(
        "DELETE FROM {operatortoopgroup} WHERE operatorid = ?",
        array($operator_id)
    );

    foreach ($new_value as $group_id) {
        $db->query(
            "INSERT INTO {operatortoopgroup} (groupid, operatorid) VALUES (?,?)",
            array($group_id, $operator_id)
        );
    }

    // Trigger the "update" event
    foreach ($original_relations as $group_id => $operators) {
        $args = array(
            'group' => group_by_id($group_id),
            'original_operators' => $operators,
            'operators' => get_group_members($group_id),
        );
        EventDispatcher::getInstance()->triggerEvent(Events::GROUP_UPDATE_OPERATORS, $args);
    }
}
开发者ID:nico13051995,项目名称:IntITA,代码行数:48,代码来源:operator.php


示例20: verifyparam

}
$groupid = verifyparam("gid", "/^\\d{1,9}\$/");
$page = array('groupid' => $groupid);
$page['operators'] = get_operators();
$errors = array();
$group = group_by_id($groupid);
if (!$group) {
    $errors[] = getlocal("page.group.no_such");
} else {
    if (isset($_POST['gid'])) {
        $new_members = array();
        foreach ($page['operators'] as $op) {
            if (verifyparam("op" . $op['operatorid'], "/^on\$/", "") == "on") {
                $new_members[] = $op['operatorid'];
            }
        }
        update_group_members($groupid, $new_members);
        header("Location: {$webimroot}/operator/groupmembers.php?gid={$groupid}&stored");
        exit;
    }
}
$page['formop'] = array();
$page['currentgroup'] = $group ? topage(htmlspecialchars($group['vclocalname'])) : "";
foreach (get_group_members($groupid) as $rel) {
    $page['formop'][] = $rel['operatorid'];
}
$page['stored'] = isset($_GET['stored']);
prepare_menu($operator);
setup_group_settings_tabs($groupid, 1);
start_html_output();
require '../view/groupmembers.php';
开发者ID:laiello,项目名称:cartonbank,代码行数:31,代码来源:groupmembers.php



注:本文中的get_group_members函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP get_group_name函数代码示例发布时间:2022-05-15
下一篇:
PHP get_group_id函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap