function delete_videos() { $ds = DIRECTORY_SEPARATOR; //Get Details about the entity $entityController = new EntityController(); $entities = $entityController->get_video_from_album($_POST['album_ID']); //Delete Full size file while ($entity = $entities->fetchArray()) { $targetFile = dirname(__FILE__) . $ds . 'src' . $ds . $entity['album_ID'] . $ds . "img" . $ds . $entity['id'] . "." . $entity['extension']; if (!unlink($targetFile)) { echo "Error deleting {$targetFile}"; } else { echo "Deleted {$targetFile}"; } //Delete thumbnail file //Video thumbnail has jpg extension $targetFile = dirname(__FILE__) . $ds . 'src' . $ds . $entity['album_ID'] . $ds . "thumb" . $ds . $entity['id'] . ".jpg"; if (!unlink($targetFile)) { echo "Error deleting {$targetFile}"; } else { echo "Deleted {$targetFile}"; } //Remove sql entity $entityController->remove_entity($entity['id']); } }
if(isset($exif['EXIF']['DateTimeOriginal'])){ //Set Datetime into the right format Y-m-d H:i:s $taken_date = new DateTime($exif['EXIF']['DateTimeOriginal']); $taken_date = $taken_date->format('Y-m-d H:i:s'); }else{ $taken_date = null; } //Get Image orientation if(isset($exif['IFD0']['Orientation'])){ $orientation = $exif['IFD0']['Orientation']; }else{ $orientation = '1'; }*/ //TODO /*https://stackoverflow.com/questions/7592263/designing-a-table-to-store-exif-data*/ } $mime = mime_content_type($_FILES['file']['tmp_name']); if (strstr($mime, "video/")) { $file_type = "video"; $video = $_FILES['file']['tmp_name']; $thumbnail = dirname(__FILE__) . '/src/' . $album_ID . '/thumb/thumbnail.jpg'; shell_exec("ffmpeg -i {$video} -deinterlace -an -ss 1 -t 00:00:01 -r 1 -y -vcodec mjpeg -f mjpeg {$thumbnail} 2>&1"); } else { $file_type = "picture"; } $entityController = new EntityController(); $file_ID = $entityController->insert_entity($album_ID, $file_type, $file_extension, "", $filename, $taken_date, $orientation); ?>
<?php session_start(); include 'util/DBController.php'; include 'util/EntityController.php'; $dBController = new DBController(); $entityController = new EntityController(); //Check login if ($_SESSION["login"] == null) { header('Location: welcome.php'); die; } $album_ID = $_GET["album"]; $_SESSION['album_ID'] = $album_ID; ?> <html> <head> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css"> <link href="css/style.css" rel="stylesheet" type="text/css"/> <link href="css/album/style.css" rel="stylesheet" type="text/css"/> <link href="css/album/header.css" rel="stylesheet" type="text/css"/> <link href="css/album/viewer.css" rel="stylesheet" type="text/css"/> <link href="css/album/preview.css" rel="stylesheet" type="text/css"/> <link href="css/album/uploader.css" rel="stylesheet" type="text/css"/> <link href="css/album/delete-panel.css" rel="stylesheet" type="text/css"/> <link href="css/album/delete_album_panel.css" rel="stylesheet" type="text/css"/> <link href="css/album/modify-panel.css" rel="stylesheet" type="text/css"/> <link href="css/album/pure-min.css" rel="stylesheet" type="text/css"/> <link href="css/dropzone/dropzone.css" rel="stylesheet" type="text/css"/>
<?php /** * This trigger the action to delete a file */ include 'util/EntityController.php'; $ds = DIRECTORY_SEPARATOR; //Get Details about the entity $entityController = new EntityController(); $entity = $entityController->get_entity($_POST['delete_panel_delete_ID'])->fetchArray(); //Delete Full size file $targetFile = dirname(__FILE__) . $ds . 'src' . $ds . $entity['album_ID'] . $ds . "img" . $ds . $entity['id'] . "." . $entity['extension']; if (!unlink($targetFile)) { echo "Error deleting {$targetFile}"; } else { echo "Deleted {$targetFile}"; } //Delete thumbnail file if ($entity['type'] == 'video') { //Video thumbnail has jpg extension $targetFile = dirname(__FILE__) . $ds . 'src' . $ds . $entity['album_ID'] . $ds . "thumb" . $ds . $entity['id'] . ".jpg"; if (!unlink($targetFile)) { echo "Error deleting {$targetFile}"; } else { echo "Deleted {$targetFile}"; } } else { $targetFile = dirname(__FILE__) . $ds . 'src' . $ds . $entity['album_ID'] . $ds . "thumb" . $ds . $entity['id'] . "." . $entity['extension']; if (!unlink($targetFile)) { echo "Error deleting {$targetFile}"; } else {
<?php include 'util/EntityController.php'; $entityController = new EntityController(); $entity_ID = $_GET['id']; //Increase View count $entityController->increase_download_count($entity_ID); //Retrieve Entity Information $entity = $entityController->get_entity($entity_ID)->fetchArray(); echo json_encode(array('id' => "{$entity_ID}", 'album_ID' => $entity['album_ID'], 'type' => $entity['type'], 'extension' => $entity['extension'], 'description' => $entity['description'], 'orientation' => $entity['orientation'], 'original_file_name' => $entity['original_file_name'], 'views' => $entity['views'], 'downloads' => $entity['downloads'], 'created_at' => $entity['created_at'], 'updated_at' => $entity['updated_at'], 'taken_date' => $entity['taken_date']));
<?php include 'util/DBController.php'; include 'util/EntityController.php'; $db = new DBController(); $entityController = new EntityController(); //Check login session_start(); if ($_SESSION["login"] == null) { header('Location: welcome.php'); die; } ?> <!DOCTYPE html> <html> <head> <link href="css/style.css" rel="stylesheet" type="text/css"/> <link href="css/index/intro.css" rel="stylesheet" type="text/css"/> <link href="css/index/box.css" rel="stylesheet" type="text/css"/> <link href="css/index/nav.css" rel="stylesheet" type="text/css"/> <link href="css/index/section.css" rel="stylesheet" type="text/css"/> <link href="css/index/control.css" rel="stylesheet" type="text/css"/> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css"> <script src="js/jQuery.js"></script> <script src="js/scroll.js"></script> <script src="js/index/add_album.js"></script> <script src="js/index/section.js"></script> <script src="js/index/nav.js"></script> <script src="js/index/logo.js"></script> <SCRIPT TYPE="text/javascript">
<?php include 'util/EntityController.php'; $entityController = new EntityController(); //Increase View count $entityController->increase_download_count($_POST['id']);
<?php session_start(); include 'util/DBController.php'; include 'util/EntityController.php'; $dBController = new DBController(); $entityController = new EntityController(); //Store all entity ID $images = array(); $pictures = $entityController->get_entity_from_album($_SESSION['album_ID']); while ($thumbnail = $pictures->fetchArray()) { array_push($images, $thumbnail['id']); } function nextPhoto($index) { $currentKey = array_search($index, $GLOBALS['images']); $nextKey = $currentKey + 1; if (array_key_exists($nextKey, $GLOBALS['images'])) { return $GLOBALS['images'][$nextKey]; } else { return $GLOBALS['images'][0]; } } function previousPhoto($index) { $currentKey = array_search($index, $GLOBALS['images']); $nextKey = $currentKey - 1; if (array_key_exists($nextKey, $GLOBALS['images'])) { return $GLOBALS['images'][$nextKey]; } else { return end($GLOBALS['images']);