You are here

function twitter_block_preprocess_twitter_block_tweet in Twitter Block 7

Same name and namespace in other branches
  1. 6 twitter_block.module \twitter_block_preprocess_twitter_block_tweet()

Implements hook_preprocess().

File

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

Code

function twitter_block_preprocess_twitter_block_tweet(&$variables) {
  $variables['text'] = twitter_block_linkify($variables['tweet']->text);
  $variables['date'] = format_date(strtotime($variables['tweet']->created_at));
  $variables['user_image'] = $variables['api'] == 'rest' ? $variables['tweet']->user->profile_image_url : $variables['tweet']->profile_image_url;
  $variables['name'] = $variables['api'] == 'rest' ? $variables['tweet']->user->name : $variables['tweet']->from_user_name;
  $variables['screen_name'] = $variables['api'] == 'rest' ? $variables['tweet']->user->screen_name : $variables['tweet']->from_user;
}