'; $output .= '
'.'is_node_page'.'
'. t('Find out if the current page is a node page.') .'
'; $output .= '
'.'node_load_current'.'
'. t('Grab the current "active" node.') .'
'; $output .= ''; } return $output; } /** * Find out if the current page is a node page. * @return TRUE if the page is a node, FALSE if it is another page. */ function is_node_page() { if (arg(0) == 'node' && is_numeric(arg(1))) { return TRUE; } return FALSE; } /** * Grab the current 'active' node. * An active node is the one node 123 as shown on page with path node/123, or * its aliased path(s). * @return $node object if the page is a node, empty $node object if it is not a * node, or if we cannot see it, for any valid reason. */ function node_load_current() { $node = new stdClass(); if (is_node_page()) { $node = node_load(arg(1)); } return $node; }