function nodejs_subscribe_insert in Node.js integration 7
Same name and namespace in other branches
- 6 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 260
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 (:nid, :uid)', array(
':nid' => $node->nid,
':uid' => $uid,
));
}