function _adsense_get_ad in Google AdSense integration 5.2        
                          
                  
                        Same name and namespace in other branches
- 5 adsense.module \_adsense_get_ad()
 
 
1 call to _adsense_get_ad()
  - adsense_display in ./adsense.module
 
  
 
File
 
   - ./adsense.module, line 1010
 
  
Code
function _adsense_get_ad($format, $group, $channel) {
  $module = variable_get(ADSENSE_ID_MODULE, 'adsense_basic');
  if ($module != 'adsense_basic') {
    
    $ad = _adsense_format($format, $group, $channel);
    return $ad;
  }
  $cache_key = "adsense-{$group}-{$format}-{$channel}";
  $cache = cache_get($cache_key);
  if ($cache) {
    
    $ad = '<!--adsense: cached-->' . $cache->data;
  }
  else {
    
    $ad = _adsense_format($format, $group, $channel);
    
    cache_set($cache_key, 'cache', $ad, CACHE_PERMANENT);
  }
  return $ad;
}