You are here

function twitter_pull_preprocess in Twitter Pull 7

Same name and namespace in other branches
  1. 7.2 twitter_pull.module \twitter_pull_preprocess()

File

./twitter_pull.module, line 61
Twitter Pull module.

Code

function twitter_pull_preprocess(&$variables, $hook) {
  switch ($hook) {
    case 'twitter_pull_listing':
      if (!empty($variables['tweets']) && is_array($variables['tweets'])) {
        foreach ($variables['tweets'] as $key => $tweet) {
          $tweet->time_ago = t('!time ago.', array(
            '!time' => format_interval(time() - $tweet->timestamp),
          ));
          $variables['tweets'][$key] = $tweet;
        }
      }
      break;
  }
}