You are here

function photos_node_insert in Album Photos 7.3

Same name and namespace in other branches
  1. 8.5 photos.module \photos_node_insert()
  2. 8.4 photos.module \photos_node_insert()
  3. 6.0.x photos.module \photos_node_insert()

Implements hook_node_insert().

File

./photos.module, line 796
Implementation of photos.module.

Code

function photos_node_insert($node) {
  if ($node->type == 'photos') {
    $node_album = serialize($node->album);
    db_insert('photos_album')
      ->fields(array(
      'pid' => $node->nid,
      'data' => $node_album,
      'fid' => 0,
      'count' => 0,
    ))
      ->execute();
    photos_set_count('user_album', $node->uid);
  }
}