prepare($sql); $stmt->execute([ "hash" => $_GET["hash"], ]); $submission = $stmt->fetch(PDO::FETCH_OBJ); if (!$submission): $title = "Submission Not Found"; $description = "We couldn't find a submission with that hash."; http_response_code(404); include "partials/head.php"; ?>

We couldn't find a submission with that hash.

prepare($sql); $stmt->execute([ "submission_id" => $submission->id, ]); $submission->readers = $stmt->fetchAll(PDO::FETCH_COLUMN); $IS_OWNER = LOGGED_IN ? $_SESSION["account"]->id === $submission->owner : false; $IS_READER = LOGGED_IN ? in_array($_SESSION["account"]->id, $submission->readers, true) : false; if ($IS_OWNER || $IS_READER || IS_ADMIN || $submission->is_public): $file = file_get_contents( sprintf( "%s/assets/docs/%s/%s", ABS_PATH, $submission->game_id, $submission->basename ) ); if ($file) { header("Content-Type: application/pdf"); header( 'Content-Disposition: inline; filename="' . slugify($submission->title) . '.pdf"' ); echo $file; } else { $title = "Internal Server Error"; $description = "The server encountered an error when attempting to open the requested file."; http_response_code(500); include "partials/head.php"; ?>

The server encountered an error when attempting to open the requested file. Please try again later.

You must log in to view this submission.