You are here

function block_subtitle_get_delta in Block Subtitle 7

Gets the delta for custom blocks.

1 call to block_subtitle_get_delta()
block_subtitle_submit in ./block_subtitle.module
Custom submit handler for block_subtitle.

File

./block_subtitle.module, line 94
This module allows subtitles to be added to blocks

Code

function block_subtitle_get_delta($module) {

  // The blocks table changed to block in block_update_7002()
  $table = db_table_exists('blocks') ? 'blocks' : 'block';

  //get last delta
  $delta = db_select($table, 'b')
    ->fields('b', array(
    'delta',
  ))
    ->condition('module', $module)
    ->orderBy('bid', 'DESC')
    ->range(0, 1)
    ->execute()
    ->fetchField();
  return $delta;
}