You are here

function og_home_empty in Organic groups 5.3

Same name and namespace in other branches
  1. 5.8 og.module \og_home_empty()
  2. 5 og.module \og_home_empty()
  3. 5.2 og.module \og_home_empty()
  4. 5.7 og.module \og_home_empty()
  5. 6.2 og.module \og_home_empty()
  6. 6 og.module \og_home_empty()
1 call to og_home_empty()
og_view_group in ./og.module

File

./og.module, line 1143

Code

function og_home_empty($node) {
  global $user;
  $dest = drupal_get_destination();
  if (in_array($node->nid, array_keys($user->og_groups))) {
    $msg = t('No posts in this group.');
  }
  else {
    $msg = t('No public posts in this group.');
    if (!$user->uid) {
      $msg .= ' ' . t('You must <a href="!register">register</a> or <a href="!login">login</a> and become a member in order to post messages, and view any private posts.', array(
        '!register' => url("user/register", $dest),
        '!login' => url("user/login", $dest),
      ));
    }
    elseif ($node->og_selective < OG_INVITE_ONLY) {
      $msg .= ' ' . t('Consider <a href="!url">joining this group</a> in order to view its posts.', array(
        '!url' => url("og/subscribe/{$node->nid}", $dest),
      ));
    }
  }
  drupal_set_message($msg);
}