domain_get_node_match

Versions
domain
domain_get_node_match($nid)

Get the best matching domain for a node link.

Parameters

$nid The node id.

Return value

The domain array for the best matching domain for links to this node.

▾ 4 functions call domain_get_node_match()

domain_block in ./domain.module
Implement hook_block()
domain_invalid_domain_requested in ./domain.module
Redirect a request to an invalid domain.
domain_source_nodeapi in domain_source/domain_source.module
Implement hook_nodeapi()
domain_url_outbound_alter in ./settings_custom_url.inc
Implement hook_url_outbound_alter().

Code

./domain.module, line 1196

<?php
function domain_get_node_match($nid) {
  static $domain = array();
  if (isset($domain[$nid])) {
    return $domain[$nid];
  }
  // Load the domain data for this node -- but only take the first match.
  $id = db_result(db_query_range("SELECT gid FROM {domain_access} WHERE nid = %d AND realm = '%s' ORDER BY gid", $nid, 'domain_id', 0, 1));
  $source = domain_lookup($id);
  drupal_alter('domain_source', $source, $nid);
  $domain[$nid] = $source;
  return $source;
}
?>

Contact

  • agentrickard [at] gmail [dot] com

Donations

My Amazon.com Wish List