book_location_down

Хочешь помочь с переводом? Это очень просто и быстро. Лишь зарегистрируйся, и можешь тут же начать переводить.

modules/book/book.module, строка 356

Версии
5
book_location_down($node, $nodes = array())

Given a node, this function returns an array of 'book node' objects representing the path in the book tree from the given node down to the last sibling of it.

Параметры

$node A book node object where the path starts.

Возвращаемое значение

An array of book node objects representing the path nodes from the given node. Returns an empty array if the node does not exist or is not part of a book hierarchy or there are no siblings.

▾ 2 функции вызывают book_location_down()

book_location_down in modules/book/book.module
Given a node, this function returns an array of 'book node' objects representing the path in the book tree from the given node down to the last sibling of it.
book_prev in modules/book/book.module
Fetches the node object of the previous page of the book.

Код

<?php
function book_location_down($node, $nodes = array()) {
  $last_direct_child = 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.vid = b.vid WHERE n.status = 1 AND b.parent = %d ORDER BY b.weight DESC, n.title DESC'), $node->nid));
  if ($last_direct_child) {
    $nodes[] = $last_direct_child;
    $nodes = book_location_down($last_direct_child, $nodes);
  }
  return $nodes;
}
?>
Войдите или зарегистрируйтесь, чтобы получить возможность отправлять комментарии

Вход в систему