function twitter_twitter_accounts in Twitter 6.3
Same name and namespace in other branches
- 6.5 twitter.module \twitter_twitter_accounts()
- 6.2 twitter.module \twitter_twitter_accounts()
- 6.4 twitter.module \twitter_twitter_accounts()
- 7.6 twitter.module \twitter_twitter_accounts()
- 7.3 twitter.module \twitter_twitter_accounts()
- 7.4 twitter.module \twitter_twitter_accounts()
- 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()
File
- ./
twitter.module, line 246
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;
}