Add timestamps to images.

This commit is contained in:
2023-12-31 09:35:34 +01:00
parent 66af0a2bb7
commit 4da5fc3f9c
11 changed files with 28 additions and 17 deletions

View File

@@ -2,7 +2,8 @@
<?php
if (!isset($_POST['Speichern'])) {
echo "<img src=\"../img/angebot/" . $_POST['Titel'] . ".jpg\" /><br />";
$ts = time();
echo "<img src=\"../img/angebot/" . $_POST['Titel'] . ".jpg?ts=" . $ts . "\" /><br />";
$sql1 = 'SELECT * FROM Angebot WHERE ID = "' . $_POST['Titel'] . '"';
$result1 = $db->query($sql1);
$nt1 = $result1->fetch_assoc();

View File

@@ -27,6 +27,7 @@ if ('will' == $_GET['t']) {
$ref = "index.php?section=fotos&t=" . $_GET['t'];
if (!isset($_GET['action'])) {
$ts = time();
echo "<p>Auf ein vorhandenes Bild klicken um es zu löschen<br />";
echo "Auf einen Platzhalter klicken um ein neues Bild hochzuladen</p>";
for ($i = 0; $i < 10; $i++) {
@@ -34,7 +35,7 @@ if (!isset($_GET['action'])) {
if (file_exists($pic)) {
$link = $ref . "&action=del&pic=" . $i;
echo "<a href=\"$link\">";
echo "<img style=\"margin: 20px 20px 20px 20px; border: 2px solid red;\" src=\"" . str_replace(__DIR__ . '/../../../public', '', $pic) . "\" width=\"100px\" height=\"100px\"/>";
echo "<img style=\"margin: 20px 20px 20px 20px; border: 2px solid red;\" src=\"" . str_replace(__DIR__ . '/../../../public', '', $pic) . "?ts=" . $ts . "\" width=\"100px\" height=\"100px\"/>";
} else {
$link = $ref . "&action=add&pic=" . $i;
echo "<a href=\"$link\">";

View File

@@ -2,7 +2,9 @@
if (!isset($_POST['Speichern'])) {
echo "<p>Dieses Bild löschen?</p>\n";
$file = "../img/umgebung/bilder/" . $_POST['Titel'] . ".jpg";
$ts = time();
$file = "../img/umgebung/bilder/" . $_POST['Titel'] . ".jpg?ts=" . $ts;
echo "<img src=\"$file\"><br />\n";
$sql1 = 'SELECT * FROM bilder WHERE ID = "' . $_POST['Titel'] . '"';
$result1 = $db->query($sql1);

View File

@@ -3,7 +3,8 @@
<?php
if (!isset($_POST['Speichern'])) {
echo "<img src=\"../img/umgebung/bilder/" . $_POST['Titel'] . ".jpg\" /><br />";
$ts = time();
echo "<img src=\"../img/umgebung/bilder/" . $_POST['Titel'] . ".jpg?ts=" . $ts . "\" /><br />";
$sql1 = 'SELECT Head FROM bilder WHERE ID = "' . $_POST['Titel'] . '"';
$result1 = $db->query($sql1);
$nt1 = $result1->fetch_assoc();

View File

@@ -5,6 +5,7 @@ $ref = "index.php?section=fotos&t=" . $_GET['t'];
if (!isset($_GET['action'])) {
echo "<p>Auf ein Bild klicken um es zu ersetzen<br />";
$ts = time();
for ($i = 0; $i < 2; $i++) {
$pic = $path . $i . ".jpg";
@@ -16,7 +17,7 @@ if (!isset($_GET['action'])) {
echo "<p>Wohnung Amelie:</p>\n";
}
echo "<a href=\"$link\">";
echo "<img style=\"border: 2px solid red;\" src=\"$pic\" width=\"100px\" height=\"100px\"/>";
echo "<img style=\"border: 2px solid red;\" src=\"$pic?ts=$ts\" width=\"100px\" height=\"100px\"/>";
echo "</a>\n";
echo "<br />&nbsp;";
} else {

View File

@@ -2,7 +2,8 @@
<?php
if (!isset($_POST['Speichern'])) {
echo "<img src=\"../img/umgebung/gb/" . $_POST['Titel'] . ".jpg\" /><br />";
$ts = time();
echo "<img src=\"../img/umgebung/gb/" . $_POST['Titel'] . ".jpg?ts=" . $ts . "\" /><br />";
$sql1 = 'SELECT Autor, Text, Datum FROM gb WHERE ID = "' . $_POST['Titel'] . '"';
$result1 = $db->query($sql1);
$nt1 = $result1->fetch_assoc();