{$alt}"; if (!empty($photo['name'])) { $html = "[caption id='fb_attachment_{$photo['id']}' width='{$width}' caption='{$alt}']" . $html . '[/caption]'; } return media_send_to_editor($html); } if (!empty($_GET['album']) && !preg_match('/^[0-9]+$/i', $_GET['album'])) { // album ids are bigints unset($_GET['album']); } if (!empty($_GET['album'])) { // show an album $album = $_GET['album']; if ( false === ( $photos = get_transient('sfcphotos-'.$album) ) ) { $photos = sfc_remote($album, 'photos', array('access_token'=>$user['access_token'], 'timeout' => 60)); if ($photos === false) { ?>

".__('Go Back','sfc')."

"; return; } $photos = $photos['data']; $link = admin_url("media-upload.php?post_id=$post_id&type=$type&tab=$redir_tab"); echo "

".__('Go Back','sfc')."

"; echo ''; $i=1; foreach ($photos as $photo) { echo ''; if ($i%3 == 0) echo ''; $i++; } echo '
'; $link = admin_url("media-upload.php?post_id=$post_id&type=$type&tab=$redir_tab&album={$album['id']}&send={$photo['id']}"); echo "

"; echo '
'; } else { if ( false === ( $albums = get_transient('sfcphotos-'.$user['uid']) ) ) { $albums = sfc_remote($user['uid'], 'albums', array('access_token'=>$user['access_token'], 'timeout' => 60)); if ($albums === false) { ?>

'; $i=1; foreach ($albums as $album) { echo ''; $link = admin_url("media-upload.php?post_id=$post_id&type=$type&tab=$redir_tab&album={$album['id']}"); // retrieve the cover image for the album if (false !== ($photo = sfc_photo_get_photo($album['cover_photo']) ) ) { echo "

"; } else { // TODO cover not available } echo "

{$album['name']}

"; echo ''; if ($i%3 == 0) echo ''; $i++; } echo ''; } ?> $user['access_token']) ); if (!empty($photo['images'])) { set_transient('sfcphoto-'.$fbid, $photo, 60*60); } else { $photo = false; } } return $photo; }