You are here

function headerimage_node_insert in Header image 7

Implementation of hook_node_insert().

File

./headerimage.module, line 631
headerimage.module Conditionally display an node in a block.

Code

function headerimage_node_insert($node) {
  if (!empty($node->type) && in_array($node->type, variable_get('headerimage_node_type', array()), true)) {
    $conditions = headerimage_node_conditions($node);
    db_insert('headerimage')
      ->fields(array(
      'nid' => $node->nid,
      'block' => $node->headerimage_block,
      'weight' => $node->headerimage_weight,
      'conditions' => serialize($conditions),
    ))
      ->execute();
  }
}