You are here

function theme_twitter_user_accounts in Twitter 7.5

Same name and namespace in other branches
  1. 6.5 twitter.module \theme_twitter_user_accounts()
  2. 7.6 twitter.module \theme_twitter_user_accounts()

Default callback for theme('twitter_user_accounts');

Renders a list of Twitter accounts for the user profile page.

1 theme call to theme_twitter_user_accounts()
twitter_user_view_alter in ./twitter.module
Implements hook_user_view_alter()

File

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

Code

function theme_twitter_user_accounts($variables) {
  module_load_include('inc', 'twitter');
  $accounts = $variables['accounts'];
  $items = array();
  foreach ($accounts as $twitter_account) {
    $tweets = twitter_tweets($twitter_account->screen_name);

    // If we have tweets for this Twitter account, link to the View. If not, link to Twitter.
    if (count($tweets)) {
      $items[] = l('@' . $twitter_account->screen_name, 'tweets/' . $twitter_account->screen_name);
    }
    else {
      $items[] = _twitter_user_profile($twitter_account->screen_name);
    }
  }
  return theme('item_list', array(
    'items' => $items,
  ));
}