book_location
- Versions
- 4.6 – 5
book_location($node, $nodes = array())
Return the path (call stack) to a certain book page.
Code
modules/book.module, line 310
<?php
function book_location($node, $nodes = array()) {
$parent = db_fetch_object(db_query(db_rewrite_sql('SELECT n.nid, n.title, b.parent, b.weight FROM {node} n INNER JOIN {book} b ON n.nid = b.nid WHERE n.nid = %d'), $node->parent));
if ($parent->title) {
$nodes = book_location($parent, $nodes);
$nodes[] = $parent;
}
return $nodes;
}
?>Login or register to post comments 