You are here

function forum_node_insert in Drupal 7

Same name and namespace in other branches
  1. 8 core/modules/forum/forum.module \forum_node_insert()
  2. 9 core/modules/forum/forum.module \forum_node_insert()
  3. 10 core/modules/forum/forum.module \forum_node_insert()

Implements hook_node_insert().

File

modules/forum/forum.module, line 397
Provides discussion forums.

Code

function forum_node_insert($node) {
  if (_forum_node_check_node_type($node)) {
    if (!empty($node->forum_tid)) {
      $nid = db_insert('forum')
        ->fields(array(
        'tid' => $node->forum_tid,
        'vid' => $node->vid,
        'nid' => $node->nid,
      ))
        ->execute();
    }
  }
}