menu_node_get_node($mlid, $load = TRUE)Get the relevant node object for a menu item.
$mlid The menu link id.
$load Boolean value that indicates whether to return the node id or a full $node.
A node id, a complete node object or FALSE on failure.
./menu_node.module, line 48
<?php
function menu_node_get_node($mlid, $load = TRUE) {
$nid = db_result(db_query("SELECT n.nid FROM {node} n INNER JOIN {menu_node} mn ON n.nid = mn.nid WHERE mn.mlid = %d", $mlid));
if (empty($nid)) {
return FALSE;
}
if ($load) {
return node_load($nid);
}
return $nid;
}
?>