You are here

function book_update in Drupal 4

Implementation of hook_update().

File

modules/book.module, line 189
Allows users to collaboratively author a book.

Code

function book_update($node) {
  if ($node->revision) {
    db_query("INSERT INTO {book} (nid, vid, parent, weight) VALUES (%d, %d, %d, %d)", $node->nid, $node->vid, $node->parent, $node->weight);
  }
  else {
    db_query("UPDATE {book} SET parent = %d, weight = %d WHERE vid = %d", $node->parent, $node->weight, $node->vid);
  }
}