You are here

function og_node_view in Organic groups 5.2

Same name and namespace in other branches
  1. 5.8 og.module \og_node_view()
  2. 5 og.module \og_node_view()
  3. 5.3 og.module \og_node_view()
  4. 5.7 og.module \og_node_view()

Same as node_view but without calling theme('node') This is needed to get the proper teaser for nodes (e.g.Event, Location, CCK node types)

1 call to og_node_view()
og_mail in ./og.module
Send this node/comment via email to all email subscribers. Called from og_nodeapi() and og_comment() TODO: this mail feature is a bit messy. rethink.

File

./og.module, line 1738

Code

function og_node_view($node) {
  $node = (object) $node;

  // Remove the delimiter (if any) that separates the teaser from the body.
  // TODO: this strips legitimate uses of '<!--break-->' also.
  $node->body = str_replace('<!--break-->', '', $node->body);
  if ($node->log != '' && !$teaser && $node->moderate) {
    $node->body .= '<div class="log"><div class="title">' . t('Log') . ':</div>' . filter_xss($node->log) . '</div>';
  }

  // The 'view' hook can be implemented to overwrite the default function
  // to display nodes.
  if (node_hook($node, 'view')) {
    node_invoke($node, 'view', $teaser, $page);
  }
  else {
    $node = node_prepare($node, $teaser);
  }

  // Allow modules to change $node->body before viewing.
  node_invoke_nodeapi($node, 'view', $teaser, $page);
  return $node->teaser;
}