function theme_google_admanager_block in DFP Small Business (Google Ad Manager) 6
Same name and namespace in other branches
- 5 google_admanager.module \theme_google_admanager_block()
- 6.2 google_admanager.module \theme_google_admanager_block()
- 7.2 google_admanager.module \theme_google_admanager_block()
Theme function the Ad Slot code
Parameters
$id google admanager account id:
$id google admanager slot name:
Return value
google admanager slot script
1 call to theme_google_admanager_block()
- _google_admanager_substitute_tags in ./
google_admanager.module - Replace all Admanager tags with their corresponding files or images.
1 theme call to theme_google_admanager_block()
- google_admanager_block in ./
google_admanager.module - Implementing hook_block
File
- ./
google_admanager.module, line 313
Code
function theme_google_admanager_block($id, $ad_slot, $cache = FALSE) {
$script = '<script type="text/javascript">GA_googleFillSlot("' . $ad_slot . '");</script>';
if ($cache) {
$script = '<script type="text/javascript">GA_googleAddSlot("' . $id . '", "' . $ad_slot . '");</script>' . $script;
}
else {
google_admanager_add_js('GA_googleAddSlot("' . $id . '", "' . $ad_slot . '");');
}
if (variable_get('google_admanager_lazy', FALSE)) {
google_admanager_add_block('<div id="gam-content-' . $ad_slot . '" class="gam-banner">' . $script . '</div>');
$script = '';
}
return '<div id="gam-holder-' . $ad_slot . '" class="gam-holder">' . $script . '</div>';
}