You are here

function template_preprocess_twitter_status in Twitter 7.5

Same name and namespace in other branches
  1. 7.6 twitter.module \template_preprocess_twitter_status()

Initialize variables for theme twitter_status.

File

./twitter.module, line 155
Provides API integration with the Twitter microblogging service.

Code

function template_preprocess_twitter_status(&$variables) {
  if (isset($variables['status'])) {
    $status =& $variables['status'];

    // Format the timestamp.
    $time_diff = REQUEST_TIME - $status->created_time;
    $status->time_ago = t('%time ago', array(
      '%time' => format_interval($time_diff, 2),
    ));

    // Format the message.
    $status->text = twitter_filter_message($status->text);
  }
}