You are here

function theme_adsense_placeholder in Google AdSense integration 6

Same name and namespace in other branches
  1. 7 adsense.module \theme_adsense_placeholder()

Generate a box to display instead of the ad when it is disabled.

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_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.
_adsense_search_results in old/search/adsense_search.results.inc
Creates the Adsense for Search page for site-embedded search results.

File

./adsense.module, line 626
Displays Google AdSense ads on Drupal pages.

Code

function theme_adsense_placeholder($text, $width, $height) {

  // Use inline CSS, as some ad-blocking software blocks CSS files.
  $style = 'border:solid 1px;display:inline-block;overflow:hidden;text-align:center;word-wrap:break-word;';
  $style .= !empty($width) && !empty($height) ? 'width:' . ($width - 2) . 'px;height:' . ($height - 2) . 'px;' : '';
  return "<div class='adsense adsense-placeholder' style='{$style}'>{$text}</div>";
}