function node_prepare

6.x node.module node_prepare($node, $teaser = FALSE)

Apply filters and build the node's standard elements.

5 calls to node_prepare()
blog_view in drupal-6.x/modules/blog/blog.module
Implementation of hook_view().
hook_update_index in documentation-6.x/developer/hooks/core.php
Update Drupal's full-text index for this module.
hook_view in documentation-6.x/developer/hooks/node.php
Display a node.
node_build_content in drupal-6.x/modules/node/node.module
Builds a structured array representing the node's content.
node_feed in drupal-6.x/modules/node/node.module
A generic function for generating RSS feeds from a set of nodes.

File

drupal-6.x/modules/node/node.module, line 1047
The core that allows content to be submitted to the site. Modules and scripts may programmatically submit nodes using the usual form API pattern.

Code

function node_prepare($node, $teaser = FALSE) {
  // First we'll overwrite the existing node teaser and body with
  // the filtered copies! Then, we'll stick those into the content
  // array and set the read more flag if appropriate.
  $node->readmore = $node->teaser != $node->body;

  if ($teaser == FALSE) {
    $node->body = check_markup($node->body, $node->format, FALSE);
  }
  else {
    $node->teaser = check_markup($node->teaser, $node->format, FALSE);
  }

  $node->content['body'] = array(
    '#value' => $teaser ? $node->teaser : $node->body,
    '#weight' => 0,
  );

  return $node;
}