Esempio n. 1
0
 /**
  * Returns the information of a photo object.
  *
  * @access	public
  * @param	null
  * @return	null
  */
 public function getItem($uri)
 {
     // Get the photo id
     $photoId = EBMM::getFilename($uri);
     // If the account is already associated, we just need to get the photos from Flickr
     $client = EB::oauth()->getClient(EBLOG_OAUTH_FLICKR);
     $client->setAccess($this->oauth->access_token);
     $client->setParams($this->oauth->params);
     // Get the photo item from flickr
     $result = $client->getPhoto($photoId);
     // Decorate the photo object for MM
     $photo = $this->decorate($result, $uri);
     return $photo;
 }
Esempio n. 2
0
 /**
  * Retrieves information about a particular photo
  *
  * @since	5.0
  * @access	public
  * @param	string
  * @return
  */
 public function getItem($uri)
 {
     if (!$this->exists()) {
         return false;
     }
     // If this is an album request, we should list down all photos
     if ($this->isAlbum($uri)) {
         return $this->getItems($uri);
     }
     // Get the photo id
     $id = (int) EBMM::getFilename($uri);
     // Load the photo item
     $photo = FD::table('Photo');
     $photo->load($id);
     // Get the album object
     $album = $photo->getAlbum();
     $item = new stdClass();
     $item->place = 'easysocial';
     $item->title = $photo->get('title');
     $item->url = $photo->getSource('original');
     $item->uri = $uri;
     $item->path = 'easysocial';
     $item->type = 'image';
     $item->icon = '';
     $item->size = 0;
     $item->modified = $photo->created;
     $item->key = EBMM::getKey($uri);
     $item->thumbnail = $photo->getSource('thumbnail');
     $item->preview = $photo->getSource('thumbnail');
     $item->variations = $this->getVariations($photo, $album);
     return $item;
 }
Esempio n. 3
0
 /**
  * Returns information about a photo in an album
  *
  * @since	5.0
  * @access	public
  * @param	string
  * @return
  */
 public function getItem($uri)
 {
     if (!$this->exists()) {
         return false;
     }
     if ($this->isAlbum($uri)) {
         return $this->getItems($uri);
     }
     // Get the photo id
     $id = (int) EBMM::getFilename($uri);
     $photo = JTable::getInstance('Photo', 'CTable');
     $photo->load($id);
     // Get the filesize
     $size = @filesize(JPATH_ROOT . '/' . $photo->original);
     $album = JTable::getInstance('Album', 'CTable');
     $album->load($photo->albumid);
     $item = EBMM::file($uri, 'image');
     $item->place = 'jomsocial';
     $item->title = $photo->caption;
     $item->url = $photo->getOriginalURI();
     $item->path = 'jomsocial';
     $item->size = $size;
     $item->modified = $photo->created;
     $item->thumbnail = $photo->getThumbURI();
     $item->preview = $photo->getThumbURI();
     $item->size = 0;
     $item->variations = $this->getVariations($photo, $album);
     return $item;
 }