function epub_insert in Epub 6
Implementation of hook_insert().
1 call to epub_insert()
- epub_update in ./
epub.module - Implementation of hook_update().
File
- ./
epub.module, line 160 - Provide ePub content type and enable the creation of ePub files from book contents.
Code
function epub_insert($node) {
$result = db_query_range(db_rewrite_sql("SELECT b.nid FROM {node} AS n\n INNER JOIN {book} AS b ON b.nid = n.nid\n WHERE b.nid = b.bid AND n.title = '%s'"), $node->book_outline, 0, 1);
$book = db_fetch_object($result);
$node->bid = $book->bid;
var_dump($node);
exit;
/*
if (!drupal_write_record('epub', $node)) {
node_delete($node->nid);
drupal_set_message(t('Error occurred during the creation of the ePub.'), 'error');
//drupal_goto('node/add/epub');
}*/
}