You are here

function subscriptions_heldnodes in Subscriptions 5

handling for held nodes

1 call to subscriptions_heldnodes()
subscriptions_cron in ./subscriptions.module
Implementation of cron job.

File

./subscriptions.module, line 635

Code

function subscriptions_heldnodes($heldnode, $poster) {
  $strsent = '!';
  $onode = unserialize($heldnode);
  if ($onode->status) {
    if (!empty($onode->taxonomy)) {
      $omitted_taxa = variable_get('subscriptions_omitted_taxa', array());
      foreach ($onode->taxonomy as $vid => $taxa) {
        if ($vid != 'tags' && !in_array($vid, $omitted_taxa)) {
          if (!is_array($taxa)) {
            $taxa = array(
              $taxa,
            );
          }

          // send taxonomy subscriptions
          foreach ($taxa as $tid) {
            $strsent .= subscriptions_mailvars($tid, $onode->nid, $poster, 'taxa', $strsent);
          }
        }
      }
    }
    $strsent .= subscriptions_mailvars($onode->nid, 0, $poster, 'node', $strsent);
    if ($node->type == 'blog') {
      $strsent .= subscriptions_mailvars($onode->uid, $onode->nid, $poster, 'blog', $strsent);
    }

    // @ TODO this is supposed to handle content type sending
    //        does there need to be an if statment here?
    $strsent .= subscriptions_mailvars($onode->type, $onode->nid, $poster, 'type', $strsent);
  }
}