Exemplo n.º 1
0
 public function deletePic($idAlbum, $picId)
 {
     static::auth();
     $photoQuery = new Zend_Gdata_Photos_PhotoQuery();
     $photoQuery->setUser("default");
     $photoQuery->setAlbumId($idAlbum);
     $photoQuery->setPhotoId($picId);
     $photoQuery->setType('entry');
     try {
         $entry = static::$service->getPhotoEntry($photoQuery);
         static::$service->deletePhotoEntry($entry, true);
         static::$status['error'] = false;
         static::$status['message'] = "Success !";
     } catch (Zend_Gdata_App_Exception $e) {
         static::$status['message'] = $e->getMessage();
     }
     return static::$status;
 }
Exemplo n.º 2
0
/**
 * 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.";
    }
}
Exemplo n.º 3
0
 /**
  * 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;
 }