You are here

function og_activity_messages_alter in Organic groups 6.2

Implementation of hook_activity_messages_alter().

File

includes/og.activity.inc, line 51
: Provides Activity module hooks for Organic groups.

Code

function og_activity_messages_alter(&$messages, $type, $objects) {

  // If its been invoked from hook_og.
  if ($type == 'og') {
    $sql = og_list_users_sql(1, 1, 'u.uid');
    $admin_members = db_query($sql, $objects['node']->nid);

    // For every group admin, add the message per language.
    while ($member = db_fetch_object($admin_members)) {
      foreach (array_keys($messages) as $language_id) {
        if (!empty($messages[$language_id][$objects['node']->uid])) {
          $messages[$language_id][$member->uid] = $messages[$language_id][$objects['node']->uid];
        }
      }
    }
  }
}