You are here

function twitter_block_preprocess_twitter_block_tweet in Twitter Block 6

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

Implementation of hook_preprocess().

File

./twitter_block.module, line 168
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;
}