/** * @throws \Exception */ private function cropImage() { if (!isset($_GET['x']) || empty($_GET['x'])) { new PageNotFound(); } $imageid = $_GET['x']; $eventid = $_GET['y']; $images = new GalleryImages(); $events = new Events(); $eventData = $events->getEventData($eventid); $result = $images->getImageData($imageid); if ($eventData['userid'] == $_SESSION['user']->userid) { $view = new EventCrop(); $eventData['date'] = new DateTime($data['start']); $view->assign(["event" => $eventData, "result" => $result[0], "type" => $_GET['y'], "image" => getimagesize("../data/uploads/" . Cunity::get("settings")->getSetting("core.filesdir") . "/" . $result[0]['filename'])]); $view->show(); } else { new PageNotFound(); } }
/** * */ private function loadImage() { $socialData = []; $images = new GalleryImages(); $albums = new GalleryAlbums(); $result = $images->getImageData($this->id); $view = new View(true); if ($result !== null) { $result = $result[0]; $albumData = $albums->getAlbumData($result['albumid']); $likeTable = new Likes(); $socialData['likes'] = $likeTable->getLikes($this->id, "image"); $socialData['dislikes'] = $likeTable->getLikes($this->id, "image", 1); if ($result['commentcount'] > 0) { $comments = new Comments(); $socialData['comments'] = $comments->get($this->id, "image", false, 13); } else { $socialData['comments'] = []; } $view->addData(array_merge($socialData, $result, ["album" => $albumData])); } else { $view->setStatus(false); } $view->sendResponse(); }