All pastes #82981 Raw Edit

merlinofchaos

public php v1 · immutable
·published 2006-07-09 05:29 UTC
rendered paste body
function sws_nodeapi(&$node, $op, $teaser = NULL, $page = NULL) {  if ($op == 'view' && $page) {    switch ($node->type) {      case 'disknode':        $path = 'community/downloads';        break;      case 'event':        $path = 'event';        break;      case 'product':        $path = 'store';        break;    }    if ($path) {      global $_menu;      $mid = $_menu['items'][menu_get_active_item()]['pid'];      $pid = $_menu['path index'][$path];      $_menu['items'][$mid]['pid'] = $pid;      menu_set_active_item($_GET['q'] . '/view');      drupal_set_breadcrumb(menu_get_active_breadcrumb());    }  }}