You are here

function subscriptions_content_node_load in Subscriptions 6

Same name and namespace in other branches
  1. 5.2 subscriptions_content.module \subscriptions_content_node_load()
  2. 7 subscriptions_content.module \subscriptions_content_node_load()
  3. 2.0.x subscriptions_content/subscriptions_content.module \subscriptions_content_node_load()

Custom function for loading nodes. Loads not only the node but also any attached comments that are in the queue.

Function name stored in {subscriptions_queue}.load_func and called by subscriptions_mail().

Parameters

$nid: Node ID.

$sqid: Subscriptions queue ID.

$is_new: TRUE if this is a new-node notification.

Return value

node as array().

3 string references to 'subscriptions_content_node_load'
subscriptions_content_nodeapi in ./subscriptions_content.module
Implementation of hook_nodeapi().
_subscriptions_content_access in ./subscriptions_content.module
Implementation of hook_access(), subhook of hook_subscriptions().
_subscriptions_content_node_mailvars in ./subscriptions_content.module
Fill given array of mailvars with given node values.

File

./subscriptions_content.module, line 734
Subscriptions to content events

Code

function subscriptions_content_node_load($nid, $sqid, $is_new) {

  // Do not cache because for different users the node can be different,
  //  subscriptions_mail_cron caches per uid.
  $node = _subscriptions_content_load($nid, 0);
  if (empty($node)) {
    return;
  }
  if ($is_new) {
    $node->_subscriptions_is_new = TRUE;
  }
  else {
    $node->_subscriptions_is_updated = TRUE;
  }
  return $node;
}