daily_update

Definition

daily_update($node)
daily/daily_container.inc, line 162

Description

Implementation of hook_update(): Respond to node updating for nodetype Daily Container.

Updates the database table {daily_container}

Related topics

Namesort iconDescription
Daily Container node type functionsAll functions which define the node type Daily Container.
Hook implementationsFunctions that implement standard Drupal hooks.

Code

<?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);
  }
}
?>