You are here

function adserve_cache_display_ad in Advertisement 6.3

Same name and namespace in other branches
  1. 5.2 adcache.inc \adserve_cache_display_ad()
  2. 6.2 adcache.inc \adserve_cache_display_ad()
  3. 7 adcache.inc \adserve_cache_display_ad()

Load and display an advertisement directly from the database.

File

./adcache.inc, line 267

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_{$ad->adtype}"));
  }
  _debug_echo("Ad type '{$ad->adtype}', loading module '" . $modules[$ad->adtype] . "'");
  return module_invoke("ad_{$ad->adtype}", 'display_ad', $ad);
}