You are here

function simpleads_block_view in SimpleAds 7

Same name and namespace in other branches
  1. 7.2 includes/blocks.inc \simpleads_block_view()

Implements hook_block_view().

File

./simpleads.module, line 250

Code

function simpleads_block_view($delta = '') {
  $blocks = array();
  $result = db_select('simpleads_blocks', 'sb')
    ->fields('sb')
    ->execute();
  foreach ($result as $block) {
    $data = unserialize($block->settings);
    if ($data['block_delta'] == $delta) {
      $blocks = array(
        'subject' => check_plain($data['block_subject']),
        'content' => theme('simpleads_block', array(
          'tid' => $block->tid,
          'ads_limit' => $data['ads_limit'],
          'ads_page' => $data['ads_page'],
          'ads_width' => $data['ads_width'],
          'ads_height' => $data['ads_height'],
        )),
      );
    }
  }
  return $blocks;
}