You are here

function _book_copy_initial_source in Book Copy 6

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

Recursive function to traverse up a book history tree to find the originating source of the book corresponding to $bid

Parameters

int $bid The current bid to find source books for:

1 call to _book_copy_initial_source()
book_copy_show_history in ./book_copy.module
Initial function to render a books copy history

File

./book_copy.module, line 385

Code

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