Skip to content

Instantly share code, notes, and snippets.

@kevinchampion
Created December 7, 2012 17:22
Show Gist options
  • Save kevinchampion/4234830 to your computer and use it in GitHub Desktop.
Save kevinchampion/4234830 to your computer and use it in GitHub Desktop.
hook_nodeapi memory error
/**
* Implemention of hook_nodeapi().
*/
function mcard_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) {
if ($op == 'view') {
if ($node->type == 'discount_provider') {
$bc[] = l('Home', '');
$bc[] = l('Treasury', 'treasury');
$bc[] = l('Mcard', 'treasury/mcard');
$bc[] = l('Discounts' , 'treasury/mcard/discounts');
drupal_set_breadcrumb($bc);
drupal_set_title(check_plain(t("Mcard Discounts: @title", array('@title' => $node->title))));
drupal_add_css(drupal_get_path('module', 'mcard') . '/css/discounts.css');
$node->content['mcard_discounts_list'] = array(
'#value' => views_embed_view('mcard_discounts', 'attachment_3', $node->nid),
'#weight' => 1000,
);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment