function _adsense_dimensions in Google AdSense integration 7
Helper function to get ad width and height from the format.
Parameters
string $format: Ad format.
Return value
array|null Width and height of the ad, or NULL
3 calls to _adsense_dimensions()
- adsense_ad_formats in ./
adsense.module - This is the array that holds all ad formats.
- theme_adsense_ad in ./
adsense.module - Default AdSense ad unit theming.
- _adsense_managed_get_ad in managed/
adsense_managed.module - Generates the AdSense ad.
File
- ./
adsense.module, line 562 - Displays Google AdSense ads on Drupal pages.
Code
function _adsense_dimensions($format) {
if (preg_match('!^(\\d+)x(\\d+)(.*)$!', $format, $matches)) {
return array(
'width' => $matches[1],
'height' => $matches[2],
);
}
return NULL;
}