You are here

function og_activity_get_related_uids in Heartbeat 6.3

Function to retrieve all users related to the currently logged in user checking the default variable settings that go with this

1 call to og_activity_get_related_uids()
og_activity_heartbeat_related_uid_info in modules/og_activity/og_activity.module
Implementation of hook_heartbeat_related_uid_info()
1 string reference to 'og_activity_get_related_uids'
og_activity_heartbeat_related_uid_info in modules/og_activity/og_activity.module
Implementation of hook_heartbeat_related_uid_info()

File

modules/og_activity/og_activity.module, line 47

Code

function og_activity_get_related_uids() {
  global $user;
  $uids = array();

  // Organic groups of the logged in user
  if (is_array($user->og_groups)) {
    foreach ($user->og_groups as $group) {
      $result = db_query(og_list_users_sql(0, 0), $group['nid']);
      while ($row = db_fetch_object($result)) {
        $uids[] = $row->uid;
      }

      /*
      // add users that are administrators of the group
      if(variable_get('heartbeat_add_og_admins_to_personal', TRUE) && $group->is_admin) {
        //$uids += array($group['uid']);
      }
      // if user is the administrator and wants to see messages of members
      if(variable_get('heartbeat_add_og_members_to_personal', TRUE) && !$group->is_admin) {
        //$uids += array($group['uid']);
      }
      // if user is a member and wants to see messages of members
      if(variable_get('heartbeat_add_og_related_to_personal', TRUE)) {
         //$uids += array($group['uid']);
      }
      */
    }
  }
  return $uids;
}