Setting time to viwers local

Fixing image sizes
Dont allow HTML in Description
This commit is contained in:
Michał Gdula 2022-09-13 13:24:48 +00:00
parent b5375414bc
commit d548f967c5
4 changed files with 25 additions and 8 deletions

View file

@ -300,6 +300,7 @@ nav .btn {
width: 100%;
max-height: 50vh;
height: auto;
min-height: 30vh;
display: flex;
background-color: rgba(21, 21, 21, 0.7333333333);
-webkit-backdrop-filter: blur(8px);
@ -314,7 +315,7 @@ nav .btn {
}
}
.image {
margin: 0 auto;
margin: auto;
max-width: 100%;
width: auto;
max-height: inherit;

View file

@ -175,6 +175,7 @@
width: 100%;
max-height: 50vh;
height: auto;
min-height: 30vh;
display: flex;
@ -193,7 +194,7 @@
}
.image {
margin: 0 auto;
margin: auto;
max-width: 100%;
width: auto;

View file

@ -163,7 +163,7 @@
<div class="image-description default-window">
<h2>Description</h2>
<p><?php echo $image_alt; ?></p>
<p><?php echo htmlentities($image_alt, ENT_QUOTES); ?></p>
</div>
@ -178,9 +178,24 @@
// Image ID
echo "<p>ID: ".$image['id']."</p>";
// Image Upload date
echo "<p>Last updated: +0 ".$image['upload']."</p>";
// Last time image was updated
$update_time = new DateTime($image['upload']);
echo "<p id='updateTime'>Last updated: ".$update_time->format('d/m/Y H:i:s T')."</p>";
?>
<script>
// Updating time to Viewers local
var updateDate = new Date('<?php echo $update_time->format('m/d/Y H:i:s T'); ?>');
var format = {year: 'numeric',
month: 'short',
day: 'numeric',
hour: '2-digit',
minute: '2-digit'
};
updateDate = updateDate.toLocaleDateString('en-GB', format);
$("#updateTime").html("Last updated: "+updateDate);
</script>
</div>
<div>
<?php
@ -304,8 +319,8 @@
</form>";
flyoutShow(header, description, actionBox);
$('#descriptionInput').val("<?php echo $image['alt']; ?>");
$('#descriptionInput').val("<?php echo str_replace('"', '\"', $image_alt); ?>");
$("#descriptionConfirm").submit(function(event) {
event.preventDefault();
var descriptionInput = $("#descriptionInput").val();

View file

@ -42,7 +42,7 @@ include "app/server/secrete.php";
/*
Classes
*/
include 'app/app.php';
require_once 'app/app.php';
?>
<script>