FacebookRestClient::photos_getAlbums PHP Method

photos_getAlbums() public method

Returns the albums created by the given user.
public photos_getAlbums ( integer $uid, array $aids )
$uid integer Optional: the uid of the user whose albums you want. A null value will return the albums of the session user.
$aids array Optional: a list of aids to restrict the query. Note that at least one of the (uid, aids) parameters must be specified.
    public function photos_getAlbums($uid, $aids)
    {
        return $this->call_method('facebook.photos.getAlbums', array('uid' => $uid, 'aids' => $aids));
    }

Usage Example

    $session_info = $client->auth_getSession($auth_token);
    $client->session_key = $session_info['session_key'];
    $uid = $session_info['uid'];
    /* You should not blindly trust cookies to provide valid authentication 
     * information since they are transmitted in the clear and can be easily 
     * modified (especially not for the user id).  We encourage you to use your 
     * own more advanced session management system, we merely do this as an 
     * example.  */
    setcookie('session_key', $session_info['session_key'], $expires);
    setcookie('uid', $uid, $expires);
}
$my_profile = $client->users_getInfo(array($uid), $profile_field_array);
$my_name = $my_profile[$uid]['name'];
$friends_array = array_slice($client->friends_get(), 0, 5);
$coworkers_array = $client->friends_getTyped('WORKED');
$albums = $client->photos_getAlbums($uid);
$album_photos = $client->photos_getFromAlbum($albums[0]['aid'], $uid);
$friend_profiles = $client->users_getInfo($friends_array, $profile_field_array);
$events = $client->events_getInWindow(time(), time() + 86400 * 30);
$photos = $client->photos_getOfUser($uid, 5);
$messages = $client->messages_getCount();
$wall_count = $client->wall_getCount();
$are_friends = $client->friends_areFriends($friends_array[0], $friends_array[1]);
print "<html><head><title>Example PHP5 REST Client</title></head><body>";
print '<a href="sample_client.php?logout=1">logout</a>';
print "<h2>{$my_name}'s info </h2>";
print '<P>Total messages: ' . $messages['total'] . ', unread: ' . $messages['unread'];
print '<P>Wall posts: ' . $wall_count;
print '<p>Friend one and friend two are ' . ($are_friends[0] ? '' : 'not ') . 'friends.';
print_profiles($my_profile);
print "<h2>{$my_name}'s friends</h2>";
All Usage Examples Of FacebookRestClient::photos_getAlbums