Пример #1
0
 /**
  * @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();
     }
 }
Пример #2
0
 /**
  * @return array
  */
 public function getProfileImages()
 {
     if ($this->images !== null) {
         return $this->images;
     }
     $images = new GalleryImages();
     $this->images = $images->fetchAll($images->select()->where("id=?", $this->profileImage)->orWhere("id=?", $this->titleImage));
     return $this->images;
 }
Пример #3
0
 /** @noinspection PhpUnusedPrivateMethodInspection */
 private function changeimage()
 {
     $gimg = new GalleryImages();
     $result = $gimg->uploadProfileImage();
     if ($result !== false) {
         $view = new View(true);
         $view->addData($result);
         $view->sendResponse();
     } else {
         new Message("Sorry!", "Something went wrong on our server!");
     }
 }
Пример #4
0
 /**
  * @return int|string
  */
 private function getLastImageId()
 {
     $images = new GalleryImages();
     $res = $images->fetchRow($images->select()->where("albumid=?", $this->id)->order("time")->limit(1));
     if ($res === null) {
         return 0;
     } else {
         return $res->id;
     }
 }
Пример #5
0
 /**
  *
  */
 private function loadImages()
 {
     $images = new GalleryImages();
     $result = $images->getImages($_POST['albumid'], ["limit" => $_POST['limit'], "offset" => $_POST['offset']]);
     $view = new View($result !== false);
     $view->addData(["result" => $result]);
     $view->sendResponse();
 }