You are here

function rb_misc_action_get_import_nid in Rules Bonus Pack 6

Action "Get import nid for content"

File

./rb_misc.module, line 462
Miscellaneous conditions and actions for Rules.

Code

function rb_misc_action_get_import_nid($node, $settings) {

  // Get any import node for this node.
  $result = db_fetch_object(db_query("SELECT feed_nid FROM {feeds_node_item} WHERE nid = %d", $node->nid));

  // If we got any match on import node, return it.
  if ($result) {
    return array(
      'import_nid' => $result->feed_nid,
    );
  }

  // Otherwise, just return. Nothing to save.
  return;
}