You are here

function adsense_search_block_info in Google AdSense integration 7

Implements hook_block_info().

File

old/search/adsense_search.module, line 55
Displays Google AdSense ads on Drupal pages.

Code

function adsense_search_block_info() {
  $blocks = array();
  $max = variable_get('adsense_search_number_blocks', ADSENSE_SEARCH_NUMBER_BLOCKS_DEFAULT);
  for ($count = 0; $count < $max; $count++) {
    if ($ad = _adsense_search_get_block_config($count)) {
      $title = $ad[0];
    }
    else {
      $title = t('AdSense Search: unconfigured !d', array(
        '!d' => $count + 1,
      ));
    }
    $blocks[$count] = array(
      'info' => $title,
      'cache' => DRUPAL_NO_CACHE,
    );
  }
  return $blocks;
}