function prepare($args) { parent::prepare($args); $args = $this->returnToArgs(); $this->user = common_current_user(); $this->photoid = $args[1]['photoid']; $this->photo = GNUsocialPhoto::getKV('id', $this->photoid); return true; }
function getThumbUri() { $photo = GNUsocialPhoto::getKV('album_id', $this->album_id); if (empty($photo)) { return '/theme/default/default-avatar-profile.png'; } //For now... return $photo->thumb_uri; }
protected function prepare(array $args = array()) { parent::prepare($args); $args = $this->returnToArgs(); $this->photoid = $args[1]['photoid']; $this->photo = GNUsocialPhoto::getKV('id', $this->photoid); $this->notice = Notice::getKV('id', $this->photo->notice_id); $this->user = Profile::getKV('id', $this->notice->profile_id); $this->conv = $this->notice->getConversation(); return true; }
function deleteAlbum() { $cur = common_current_user(); if (empty($cur)) { return; } $album_id = $this->trimmed('album'); $album = GNUsocialPhotoAlbum::getKV('album_id', $album_id); if (empty($album)) { $this->showForm(_('This album does not exist or has been deleted.')); return; } //Check if the album has any photos in it before deleting $photos = GNUsocialPhoto::getKV('album_id', $album_id); if (empty($photos)) { $album->delete(); $this->showForm(_('Album deleted'), true); } else { $this->showForm(_('Cannot delete album when there are photos in it!'), false); } }
function onStartShowNoticeItem($action) { $photo = GNUsocialPhoto::getKV('notice_id', $action->notice->id); if ($photo) { $action->out->elementStart('div', 'entry-title'); $action->showAuthor(); $action->out->elementStart('a', array('href' => $photo->getPageLink())); $action->out->element('img', array('src' => $photo->thumb_uri, 'width' => 256, 'height' => 192)); $action->out->elementEnd('a'); $action->out->elementEnd('div'); $action->showNoticeInfo(); $action->showNoticeOptions(); return false; } return true; }