You are here

function simplenews_load in Simplenews 5

Implementation of hook_load().

File

./simplenews.module, line 469

Code

function simplenews_load($node) {
  $newsletter = db_fetch_object(db_query('SELECT * FROM {simplenews_newsletters} WHERE nid = %d', $node->nid));

  // Newsletter vid is stored in simplenews->vid.
  // This will prevent overwrite of node->vid.
  // A better solution would be a node->simplenews with all newsletter data.
  $newsletter->simplenews_vid = $newsletter->vid;
  unset($newsletter->vid);
  return $newsletter;
}