You are here

function nodejs_subscribe_node_insert in Node.js integration 7

Same name and namespace in other branches
  1. 6 nodejs_subscribe/nodejs_subscribe.module \nodejs_subscribe_node_insert()

Implements hook_node_insert().

File

nodejs_subscribe/nodejs_subscribe.module, line 157

Code

function nodejs_subscribe_node_insert($node) {
  if (isset($node->nodejs_subscribe)) {
    if ($node->nodejs_subscribe['nodejs_subscriptions_allowed']) {
      db_query('INSERT INTO {nodejs_subscribe_node} (nid, subscribe) VALUES (:nid, :subscribe)', array(
        ':nid' => $node->nid,
        ':subscribe' => 1,
      ));
    }
  }
}