daily_update($node)
daily/daily_container.inc, line 162
Implementation of hook_update(): Respond to node updating for nodetype Daily Container.
Updates the database table {daily_container}
| Name | Description |
|---|---|
| Daily Container node type functions | All functions which define the node type Daily Container. |
| Hook implementations | Functions that implement standard Drupal hooks. |
<?php
function daily_update($node) {
if ($node->old_vid) {
/* Insert a new revision */
db_query("INSERT INTO {daily_container} (vid, nid, tid, nr) VALUES (%d, %d, %d, %d)", $node->vid, $node->nid, $node->tid, $node->nr);
}
else {
/* Just update the node */
db_query("UPDATE {daily_container} SET tid=%d, nr=%d WHERE vid=%d", $node->tid, $node->nr, $node->vid);
}
}
?>