/** * Obtener una foto especifica. * * @param integer $albumId id del album * @param integer $photoId id de la foto * @return Zend_Gdata_Photos_PhotoEntry */ public function getPhoto($albumId, $photoId) { $photoQuery = new Zend_Gdata_Photos_PhotoQuery(); $photoQuery->setAlbumId($albumId); $photoQuery->setPhotoId($photoId); $photoQuery->setType('entry'); $entry = $this->_photos->getPhotoEntry($photoQuery); return $entry; }
public function picasaDelete($photoId) { $token = $this->get_login_token(); $client = new Zend_Gdata_HttpClient(); $client->setAuthSubToken($token); $client->setClientLoginToken($token); $gphoto = new Zend_Gdata_Photos($client); $photoQuery = $gphoto->newPhotoQuery(); $photoQuery->setUser($this->config['user']); $photoQuery->setAlbumId($this->config['album_id']); $photoQuery->setPhotoId($photoId); $photoQuery->setType('entry'); $entry = $gphoto->getPhotoEntry($photoQuery); $gphoto->deletePhotoEntry($entry, true); }
/** * Adds a new tag to the specified photo * * @param Zend_Http_Client $client The authenticated client * @param string $user The user's account name * @param integer $album The album's id * @param integer $photo The photo's id * @param string $tag The tag to add to the photo * @return void */ function addTag($client, $user, $album, $photo, $tag) { $photos = new Zend_Gdata_Photos($client); $entry = new Zend_Gdata_Photos_TagEntry(); $entry->setTitle($photos->newTitle($tag)); $photoQuery = new Zend_Gdata_Photos_PhotoQuery(); $photoQuery->setUser($user); $photoQuery->setAlbumId($album); $photoQuery->setPhotoId($photo); $photoQuery->setType('entry'); $photoEntry = $photos->getPhotoEntry($photoQuery); $result = $photos->insertTagEntry($entry, $photoEntry); if ($result) { outputPhotoFeed($client, $user, $album, $photo); } else { echo "There was an issue with the tag creation."; } }