function shoutbox_domain_query_shouts_alter in Shoutbox 7
Same name and namespace in other branches
- 7.2 shoutbox_domain/shoutbox_domain.module \shoutbox_domain_query_shouts_alter()
Implements hook_query_TAG_alter().
File
- shoutbox_domain/
shoutbox_domain.module, line 56
Code
function shoutbox_domain_query_shouts_alter(QueryAlterableInterface $query) {
if (module_exists('domain')) {
$_domain = domain_get_domain();
if ($query
->hasTag('shouts') && isset($_domain['domain_id'])) {
$query
->join('shoutbox_domain', 'd', 's.shout_id = d.shout_id');
$domain_id = (int) $_domain['domain_id'];
$query
->condition('d.domain_id', $domain_id, '=');
}
}
}