You are here

function adserve_cache in Advertisement 6.3

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

Wrapper for calling adserve_cache functions.

10 calls to adserve_cache()
adserve_ad in ./adserve.inc
The main adserve logic.
adserve_cache_display in ./adcache.inc
Default function for displaying advertisements. This is not generally replaced by ad cache modules.
adserve_cache_get_ad_ids in ./adcache.inc
Default wrapper function for displaying advertisements. This generally is not replaced by ad caches modules.
adserve_cache_hook in ./adcache.inc
Invoke the appropraite hook.
adserve_counter_image in ./imageserve.inc
Generate a tiny image with GD, used to count when an ad has been displayed on a cached page.

... See full list

File

./adcache.inc, line 6

Code

function adserve_cache() {
  static $functions = array();
  $args = func_get_args();
  $function = array_shift($args);
  _debug_echo("adserve_cache function({$function})");
  if (!isset($functions[$function])) {
    $cache = adserve_variable('adcache');
    $test = "ad_cache_{$cache}_{$function}";
    if (!function_exists($test)) {
      _debug_echo("Cache function '{$test}' does not exist.\n");
      $test = "adserve_cache_{$function}";
    }
    $functions[$function] = $test;
  }
  if (function_exists($functions[$function])) {
    _debug_memory();
    _debug_echo("Invoking cache function '" . $functions[$function] . "'.");
    return call_user_func_array($functions[$function], $args);
  }
  else {
    _debug_echo("Cache function '" . $functions[$function] . "' does not exist.\n");
  }
  return array();
}