You are here

function adsense_oldcode_block_view in Google AdSense integration 7

Implements hook_block_view().

File

old/oldcode/adsense_oldcode.module, line 155
Displays Google AdSense ads on Drupal pages.

Code

function adsense_oldcode_block_view($delta) {
  $block = array();
  if (_adsense_page_match()) {
    $ad = _adsense_oldcode_get_block_config($delta);
    $block['content'] = $ad ? adsense_display(array(
      'title' => $ad[0],
      'format' => $ad[1],
      'group' => $ad[2],
      'channel' => $ad[3],
    )) : _adsense_configure_block_message(url('admin/structure/block/manage/adsense_oldcode/' . $delta));
    if (!empty($ad[4])) {
      $block['content'] = "<div style='text-align:{$ad[4]}'>{$block['content']}</div>";
    }
  }
  return $block;
}