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

@@ -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 . '" />';
?>