function ad_external_adapi in Advertisement 6.3
Same name and namespace in other branches
- 5.2 external/ad_external.module \ad_external_adapi()
- 5 external/ad_external.module \ad_external_adapi()
- 6 external/ad_external.module \ad_external_adapi()
- 6.2 external/ad_external.module \ad_external_adapi()
- 7 external/ad_external.module \ad_external_adapi()
Implementation of hook_adapi().
File
- external/
ad_external.module, line 97 - Enhances the ad module to support externally hosted ads, served via IFrames. It is recommended that you configure "Administer >> Content management >> Ads >> Settings >> Global settings >> Display type" to…
Code
function ad_external_adapi($op, $node) {
switch ($op) {
case 'load':
return db_fetch_array(db_query('SELECT * FROM {ad_external} WHERE aid = %d', $node['aid']));
case 'insert':
db_query("INSERT INTO {ad_external} (aid, url) VALUES(%d, '%s')", $node->nid, $node->url);
break;
case 'update':
db_query("UPDATE {ad_external} SET url = '%s' WHERE aid = %d", $node->url, $node->nid);
break;
case 'delete':
db_query('DELETE FROM {ad_external} WHERE aid = %d', $node->nid);
break;
case 'form':
return ad_external_node_form($node);
case 'view':
return ad_external_node_view($node);
case 'redirect':
// TODO: Would it ever make sense to have redirects for this ad type?
watchdog('ad', 'Unexpected redirect attempt in external ad type.');
return;
case 'type':
return array(
'external' => array(
'name' => t('External ad'),
'module' => 'ad_external',
'description' => t('An external advertisement, displayed in an IFrame.'),
'help' => t('An external advertisement, displayed in an IFrame.'),
),
);
}
}