You are here

function forum_view in Drupal 4

Same name and namespace in other branches
  1. 5 modules/forum/forum.module \forum_view()

Implementation of hook_view().

File

modules/forum.module, line 296
Enable threaded discussions about general topics.

Code

function forum_view(&$node, $teaser = FALSE, $page = FALSE) {
  if ($page) {
    $vocabulary = taxonomy_get_vocabulary(variable_get('forum_nav_vocabulary', ''));

    // Breadcrumb navigation
    $breadcrumb = array();
    $breadcrumb[] = array(
      'path' => 'forum',
      'title' => $vocabulary->name,
    );
    if ($parents = taxonomy_get_parents_all($node->tid)) {
      $parents = array_reverse($parents);
      foreach ($parents as $p) {
        $breadcrumb[] = array(
          'path' => 'forum/' . $p->tid,
          'title' => $p->name,
        );
      }
    }
    $breadcrumb[] = array(
      'path' => 'node/' . $node->nid,
    );
    menu_set_location($breadcrumb);
  }
  $node = node_prepare($node, $teaser);
  $node->body .= theme('forum_topic_navigation', $node);
}