You are here

function ad_display_image in Advertisement 6.2

Same name and namespace in other branches
  1. 5.2 ad.module \ad_display_image()
  2. 5 ad.module \ad_display_image()
  3. 6.3 ad.module \ad_display_image()
  4. 6 ad.module \ad_display_image()
  5. 7 ad.module \ad_display_image()

Builds the necessary HTML to display an image-based impressions counter.

1 call to ad_display_image()
adserve_cache_display in ./adcache.inc
Default function for displaying advertisements. This is not generally replaced by ad cache modules.

File

./ad.module, line 1577

Code

function ad_display_image($aid, $css = TRUE) {
  global $base_url;
  $adserve = variable_get('adserve', '');
  $cache = variable_get('ad_cache', 'none');
  $variables = "?o=image";
  $variables .= "&a={$aid}";
  if ($cache != 'none') {
    $variables .= '&c=' . $cache . module_invoke('ad_cache_' . $cache, 'adcacheapi', 'display_variables', array());
  }
  $output = '<img src="' . htmlentities(url($base_url . '/' . $adserve . $variables)) . '" height="0" width="0" alt="view counter" />';
  if ($css) {
    return '<div class="ad-image-counter">' . $output . '</div>';
  }
  else {
    return $output;
  }
}