You are here

function nodejs_subscribe_insert in Node.js integration 6

Same name and namespace in other branches
  1. 7 nodejs_subscribe/nodejs_subscribe.module \nodejs_subscribe_insert()

Create subscription to a node for a given user.

Parameters

mixed $node:

mixed $uid:

Return value

boolean

1 call to nodejs_subscribe_insert()
nodejs_subscribe_subscribe_node in nodejs_subscribe/nodejs_subscribe.module
Page callback for subscribing/unsubscribing to a node.

File

nodejs_subscribe/nodejs_subscribe.module, line 349

Code

function nodejs_subscribe_insert($node, $uid) {
  nodejs_add_user_to_channel($uid, 'nodejs_subscribe_node_' . $node->nid);
  return db_query('INSERT INTO {nodejs_subscribe_subscription} (nid, uid) VALUES (%d, %d)', $node->nid, $uid);
}