mirror of
https://github.com/Fluffy-Bean/image-gallery.git
synced 2025-06-19 00:20:35 +00:00
Setting time to viwers local
Fixing image sizes Dont allow HTML in Description
This commit is contained in:
parent
b5375414bc
commit
d548f967c5
4 changed files with 25 additions and 8 deletions
25
image.php
25
image.php
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue