You are here

function theme_twitter_user_accounts in Twitter 7.6

Same name and namespace in other branches
  1. 6.5 twitter.module \theme_twitter_user_accounts()
  2. 7.5 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 205
Provides API integration with the Twitter microblogging service.

Code

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

    // If we have tweets for this Twitter account, link to the View. If not, link to Twitter.
    if (module_exists('views') && twitter_tweets($twitter_account->screen_name)) {
      $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,
  ));
}