function shoutbox_domain_shoutbox in Shoutbox 6.2
Same name and namespace in other branches
- 7.2 shoutbox_domain/shoutbox_domain.module \shoutbox_domain_shoutbox()
- 7 shoutbox_domain/shoutbox_domain.module \shoutbox_domain_shoutbox()
Implementation of hook_shoutbox()
File
- shoutbox_domain/
shoutbox_domain.module, line 6
Code
function shoutbox_domain_shoutbox($op, &$shout, &$a1 = NULL, $form_state = NULL) {
global $_domain;
switch ($op) {
case 'insert':
if (isset($_domain['domain_id'])) {
$record = new stdClass();
$record->shout_id = $shout->shout_id;
$record->domain_id = $_domain['domain_id'];
drupal_write_record('shoutbox_domain', $record);
}
break;
case 'presave':
if (isset($_domain['domain_id'])) {
$shout->module = 'shoutbox_domain';
}
break;
case 'delete':
db_query("DELETE FROM {shoutbox_domain} WHERE shout_id = %d", $shout->shout_id);
break;
}
}