You are here

function twitter_twitter_accounts in Twitter 6.5

Same name and namespace in other branches
  1. 6.2 twitter.module \twitter_twitter_accounts()
  2. 6.3 twitter.module \twitter_twitter_accounts()
  3. 6.4 twitter.module \twitter_twitter_accounts()
  4. 7.6 twitter.module \twitter_twitter_accounts()
  5. 7.3 twitter.module \twitter_twitter_accounts()
  6. 7.4 twitter.module \twitter_twitter_accounts()
  7. 7.5 twitter.module \twitter_twitter_accounts()

Implements hook_twitter_accounts().

Return value

array All Twitter accounts for this user; the anonymous user will return an empty array.

1 call to twitter_twitter_accounts()
twitter_user_settings in ./twitter.pages.inc
Form builder that lists Twitter accounts.

File

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

Code

function twitter_twitter_accounts($account) {
  if ($account->uid == 0) {
    return array();
  }
  module_load_include('inc', 'twitter');
  $twitter_accounts = array();
  $sql = "SELECT twitter_uid FROM {twitter_account} WHERE uid = %d";
  $results = db_query($sql, $account->uid);
  while ($row = db_fetch_array($results)) {
    $key = $row['twitter_uid'];
    $twitter_accounts[] = twitter_account_load($key);
  }
  return $twitter_accounts;
}