You are here

function expire_get_domains in Cache Expiration 6

Same name and namespace in other branches
  1. 7 expire.domain.inc \expire_get_domains()

Get domains the node is currently published to

Parameters

$node: node object

Return value

array array('$gid' => $gid)

1 call to expire_get_domains()
expire_get_base_urls in ./expire.module
Get all base url's where this node can appear. Domain access support.

File

./expire.module, line 582
Provides logic for page cache expiration

Code

function expire_get_domains(&$node) {
  $domains = array();
  if ($node->nid) {
    $result = db_query("SELECT gid FROM {domain_access} WHERE nid = %d", $node->nid);
    while ($row = db_fetch_array($result)) {
      $gid = $row['gid'];
      $domains[$gid] = $gid;
    }
  }
  elseif ($node->mail && $node->name) {
    $result = db_query("SELECT domain_id FROM {domain_editor} WHERE uid = %d", $node->uid);
    while ($row = db_fetch_array($result)) {
      $gid = $row['domain_id'];
      $domains[$gid] = $gid;
    }
  }
  return $domains;
}