You are here

function _book_copy_tree in Book Copy 6

Same name and namespace in other branches
  1. 7 book_copy.module \_book_copy_tree()

Recursive function used to build tree information for a book

Parameters

int $bid The nid to build tree information for:

1 call to _book_copy_tree()
_book_copy_get_book_history in ./book_copy.module
This function calls the recursive _book_copy_tree() to build book history data

File

./book_copy.module, line 367

Code

function _book_copy_tree($bid) {
  $result = db_query("SELECT * FROM {book_copy_history} WHERE sbid = %d", $bid);
  $children = array();
  while ($row = db_fetch_array($result)) {
    $children[$row['bid']] = array(
      'copied' => $row['copied'],
      'children' => _book_copy_tree($row['bid']),
    );
  }
  return $children;
}