You are here

function drupagram_account_load in Drupagram 6

Same name and namespace in other branches
  1. 7 drupagram.inc \drupagram_account_load()

Load a Instagram account from {drupagram_account}.

Parameters

$id: Instagram UID

Return value

InstagramUser object

4 calls to drupagram_account_load()
drupagram_account_delete in ./drupagram.inc
Delete a drupagram account and its statuses.
drupagram_drupagram_accounts in ./drupagram.module
An implementation of hook_drupagram_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.
drupagram_fetch_recent_items in ./drupagram.inc
Fetches a user's recent items.
drupagram_user_make_global in ./drupagram.pages.inc

File

./drupagram.inc, line 131
Instagram API functions

Code

function drupagram_account_load($id) {
  $values = db_fetch_array(db_query("SELECT * FROM {drupagram_account} WHERE drupagram_id=%d", $id));
  if ($values['drupagram_id']) {
    $values['id'] = $values['drupagram_id'];
    $account = new InstagramUser($values);
    $account
      ->set_auth($values);
    $account->uid = $values['uid'];
    $account->import = $values['import'];
    $account->is_global = $values['is_global'];
    return $account;
  }
}