コード例 #1
0
ファイル: Process.php プロジェクト: rcrrich/cunity
 /**
  * @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
ファイル: User.php プロジェクト: rcrrich/cunity
 /**
  * @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
ファイル: ProfileEdit.php プロジェクト: rcrrich/cunity
 /** @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
ファイル: Album.php プロジェクト: rcrrich/cunity
 /**
  * @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
ファイル: Process.php プロジェクト: rcrrich/cunity
 /**
  *
  */
 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();
 }