You are here

function twitter_twitter_accounts in Twitter 6.4

Same name and namespace in other branches
  1. 6.5 twitter.module \twitter_twitter_accounts()
  2. 6.2 twitter.module \twitter_twitter_accounts()
  3. 6.3 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()

An implementation of hook_twitter_accounts. We want to move this into a separate module eventually, but sticking the code here and using a hook lets other modules solve the 'what accounts can a user post with' problem in cleaner ways.

1 call to twitter_twitter_accounts()
twitter_user_settings in ./twitter.pages.inc

File

./twitter.module, line 245
Establishes an interface to communicate with Twitter

Code

function twitter_twitter_accounts($account) {
  module_load_include('inc', 'twitter');
  $twitter_accounts = array();
  $sql = "SELECT twitter_uid FROM {twitter_account} WHERE uid = %d";
  if (user_access('use global twitter account', $account)) {
    $sql .= " OR is_global=1";
  }
  $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;
}