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();

View File

@@ -25,6 +25,6 @@
<h2 style="float: left;"><a href="index.php?section=gaby">Wohnung Gaby</a></h2>
<h2 style="float: right;"><a href="index.php?section=amelie">Wohnung Amelie</a></h2>
<br class="clear"/>
<a href="index.php?section=gaby"><img class="left" src="img/haus/wohn/0.jpg"/></a>
<a href="index.php?section=amelie"><img class="right" src="img/haus/wohn/1.jpg"/></a>
<a href="index.php?section=gaby"><img class="left" src="img/haus/wohn/0.jpg?ts=<?php echo time(); ?>"/></a>
<a href="index.php?section=amelie"><img class="right" src="img/haus/wohn/1.jpg?ts=<?php echo time(); ?>"/></a>
</div>

View File

@@ -12,10 +12,11 @@ if (isset($_GET['t'])) {
$link .= "t=" . $_GET['t'] . "&";
}
$ts = time();
if (isset($_GET['f'])) {
$pic = $path . $_GET['f'] . ".jpg";
echo "<div>";
echo " <img class=\"gross\" src=$pic />\n";
echo " <img class=\"gross\" src=\"" . $pic . "?ts=" . $ts . "\" />\n";
echo "</div>\n";
echo "<br class=\"clear\" />\n";
echo "<div id=\"thumb\">\n";
@@ -24,7 +25,7 @@ if (isset($_GET['f'])) {
$pic = $path . $i . ".jpg";
if (file_exists($pic)) {
echo "<div>";
echo " <img class=\"gross\" src=$pic />\n";
echo " <img class=\"gross\" src=\"" . $pic . "?ts=" . $ts . "\" />\n";
echo "</div>\n";
echo "<br class=\"clear\" />\n";
echo "<div id=\"thumb\">\n";
@@ -37,6 +38,6 @@ for ($i = 9; $i >= 0; $i--) {
$thumb = $path . $i . ".jpg";
if (file_exists($thumb)) {
$ref = $link . "f=$i";
echo " <a href=$ref><img src=$thumb /></a>\n";
echo " <a href=\"" , $ref . "\"><img src=\"" .$thumb . "?ts=" . $ts . "\" /></a>\n";
}
}

View File

@@ -12,10 +12,11 @@ if (isset($_GET['t'])) {
$link .= "t=" . $_GET['t'] . "&";
}
$ts = time();
if (isset($_GET['f'])) {
$pic = $path . $_GET['f'] . ".jpg";
echo "<div>";
echo " <img class=\"gross\" src=$pic />\n";
echo " <img class=\"gross\" src=\"" . $pic . "?ts=" . $ts . "\" />\n";
echo "</div>\n";
echo "<br class=\"clear\" />\n";
echo "<div id=\"thumb\">\n";
@@ -25,7 +26,7 @@ if (isset($_GET['f'])) {
for ($i = 0; $i < 10; $i++) {
if (file_exists($pic)) {
echo "<div>";
echo " <img class=\"gross\" src=$pic />\n";
echo " <img class=\"gross\" src=\"" . $pic . "?ts=" . $ts . "\" />\n";
echo "</div>\n";
echo "<br class=\"clear\" />\n";
echo "<div id=\"thumb\">\n";
@@ -38,6 +39,6 @@ for ($i = 9; $i >= 0; $i--) {
$thumb = $path . $i . ".jpg";
if (file_exists($thumb)) {
$ref = $link . "f=$i";
echo " <a href=$ref><img src=$thumb /></a>\n";
echo " <a href=\"" . $ref . "\"><img src=\"" . $thumb . "?ts=" . $ts . "\" /></a>\n";
}
}

View File

@@ -3,10 +3,11 @@
<?php
$sql1 = 'SELECT * FROM gb ORDER BY ID';
$result1 = $db->query($sql1);
$ts = time();
while ($nt1 = $result1->fetch_assoc()) {
$datum = date("d.m.Y", strtotime($nt1['Datum']));
echo "<img class=\"left\" src=\"img/umgebung/gb/" . $nt1['ID'] . ".jpg\" />\n";
echo "<img class=\"left\" src=\"img/umgebung/gb/" . $nt1['ID'] . ".jpg?ts=" . $ts . "\" />\n";
echo "<h3>" . $nt1['Autor'] . " schrieb am " . $datum . ":</h3>\n";
echo "<p>" . nl2br($nt1['Text']) . "</p>\n";
echo "<br class=\"clear\" />\n";

View File

@@ -5,11 +5,12 @@
$sql2 = 'SELECT ID FROM bilder ORDER BY ID';
$result2 = $db->query($sql2);
$foto = "";
$ts = time();
while ($nt2 = $result2->fetch_assoc()) {
$file = 'img/umgebung/bilder/' . $nt2['ID'] . '.jpg';
if (file_exists($file)) {
$foto = $nt2['ID'];
echo '<a href="index.php?section=umgebung&f=' . $nt2['ID'] . '"><img src="' . $file . '" /></a>';
echo '<a href="index.php?section=umgebung&f=' . $nt2['ID'] . '"><img src="' . $file . '?ts=' . $ts . '" /></a>';
}
}
?>
@@ -31,7 +32,7 @@
$file = 'img/umgebung/bilder/' . $foto . '.jpg';
echo "<h2>Bildergalerie</h2>\n";
echo "<h3>$nt1[Head]</h3>\n";
echo '<img src="' . $file . '" />';
echo '<img src="' . $file . '?ts=' . $ts . '" />';
?>