function theme_adsense_placeholder in Google AdSense integration 7
Same name and namespace in other branches
- 6 adsense.module \theme_adsense_placeholder()
Generate a box to display instead of the ad when it is disabled.
Parameters
array $vars: Theme variables.
Return value
string string with the HTML text to create the box.
5 theme calls to theme_adsense_placeholder()
- adsense_display in ./adsense.module 
- Generates the Google AdSense Ad.
- _adsense_csev2_results in cse/adsense_csev2.results.inc 
- Creates the CSE v2 search results page for site-embedded search results.
- _adsense_cse_results in cse/adsense_cse.results.inc 
- Creates the CSE search results page for site-embedded search results.
- _adsense_managed_get_ad in managed/adsense_managed.module 
- Generates the AdSense ad.
- _adsense_oldcode_get_ad in old/oldcode/ adsense_oldcode.module 
- Generates the AdSense ad.
File
- ./adsense.module, line 666 
- Displays Google AdSense ads on Drupal pages.
Code
function theme_adsense_placeholder(array $vars) {
  // Use inline CSS, as some ad-blocking software blocks CSS files.
  $style = !empty($vars['width']) && !empty($vars['height']) ? 'width:' . ($vars['width'] - 2) . 'px;height:' . ($vars['height'] - 2) . 'px;' : '';
  return "<div class='adsense adsense-placeholder' style='{$style}'>{$vars['text']}</div>";
}