function adserve_cache_display_ad in Advertisement 5.2
Same name and namespace in other branches
- 6.3 adcache.inc \adserve_cache_display_ad()
- 6.2 adcache.inc \adserve_cache_display_ad()
- 7 adcache.inc \adserve_cache_display_ad()
Load and display an advertisement directly from the database.
File
- ./
adcache.inc, line 247
Code
function adserve_cache_display_ad($id) {
static $modules = array();
$ad = node_load($id);
if (!isset($modules[$ad->adtype])) {
$modules[$ad->adtype] = db_result(db_query("SELECT filename FROM {system} WHERE name = '%s'", "ad_{$detail->adtype}"));
}
_debug_echo("Ad type '{$ad->adtype}', loading module '" . $modules[$ad->adtype] . "'");
return module_invoke("ad_{$ad->adtype}", 'display_ad', $ad);
}