You are here

function twitter_block_custom_block_save in Twitter Block 7

Same name and namespace in other branches
  1. 7.2 twitter_block.module \twitter_block_custom_block_save()

Saves a user-created Twitter block in the database.

Parameters

$edit: Associative array of fields to save. Array keys:

  • info: Block description.
  • search_type: Type of search to perform.
  • include_rts: Whether to include retweets.
  • search_string: String to search for.
  • results_per_page: Number of tweets to display.
  • lang: Language to restrict tweets to.

$delta: Block ID of the block to save.

Return value

Always returns TRUE.

1 call to twitter_block_custom_block_save()
twitter_block_block_save in ./twitter_block.module
Implements hook_block_save().

File

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

Code

function twitter_block_custom_block_save($edit, $delta) {
  db_update('twitter_block')
    ->fields(array(
    'info' => $edit['info'],
    'search_type' => $edit['search_type'],
    'include_rts' => $edit['include_rts'],
    'search_string' => $edit['search_string'],
    'results_per_page' => $edit['results_per_page'],
    'lang' => $edit['lang'],
  ))
    ->condition('bid', $delta)
    ->execute();
  return TRUE;
}