You are here

function twitter_block_get_config in Twitter Block 6

Retrieve the Twitter block configuration options from the db.

1 call to twitter_block_get_config()
twitter_block_block in ./twitter_block.module
Implements hook_block().

File

./twitter_block.module, line 18
A module to provide simple Twitter blocks using the Twitter Search API.

Code

function twitter_block_get_config($delta) {
  static $config;
  if (!isset($config[$delta])) {
    $result = db_query("SELECT search_type, include_rts, search_string, default_title, results_per_page, lang FROM {twitter_block} WHERE delta = '%s'", $delta);

    // @todo There can be only one?
    while ($record = db_fetch_object($result)) {
      $config[$delta] = get_object_vars($record);
    }
  }
  return isset($config[$delta]) ? $config[$delta] : FALSE;
}