forum_view

Definition

forum_view(&$node, $teaser = FALSE, $page = FALSE)
modules/forum.module, line 296

Description

Implementation of hook_view().

Code

<?php
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);
}
?>
 
 

Drupal is a registered trademark of Dries Buytaert.