mirror of
https://github.com/webbukkit/dynmap.git
synced 2024-11-30 22:24:06 +01:00
Handle rollover from newImage to Image in MySQL PHP
This commit is contained in:
parent
014760d142
commit
327833832d
@ -81,10 +81,10 @@ if (count($fparts) == 3) { // zoom_x_y
|
|||||||
}
|
}
|
||||||
initDbIfNeeded();
|
initDbIfNeeded();
|
||||||
|
|
||||||
$stmt = $db->prepare('SELECT t.newImage,t.Format,t.HashCode,t.LastUpdate FROM ' . $dbprefix . 'Maps m JOIN ' . $dbprefix . 'Tiles t WHERE m.WorldID=? AND m.MapID=? AND m.Variant=? AND m.ID=t.MapID AND t.x=? AND t.y=? and t.zoom=?');
|
$stmt = $db->prepare('SELECT t.newImage,t.Image,t.Format,t.HashCode,t.LastUpdate FROM ' . $dbprefix . 'Maps m JOIN ' . $dbprefix . 'Tiles t WHERE m.WorldID=? AND m.MapID=? AND m.Variant=? AND m.ID=t.MapID AND t.x=? AND t.y=? and t.zoom=?');
|
||||||
$stmt->bind_param('sssiii', $world, $prefix, $variant, $x, $y, $zoom);
|
$stmt->bind_param('sssiii', $world, $prefix, $variant, $x, $y, $zoom);
|
||||||
$res = $stmt->execute();
|
$res = $stmt->execute();
|
||||||
$stmt->bind_result($timage, $format, $thash, $tlast);
|
$stmt->bind_result($tnewimage, $timage, $format, $thash, $tlast);
|
||||||
if ($stmt->fetch()) {
|
if ($stmt->fetch()) {
|
||||||
if ($format == 0) {
|
if ($format == 0) {
|
||||||
header('Content-Type: image/png');
|
header('Content-Type: image/png');
|
||||||
@ -93,7 +93,11 @@ if ($stmt->fetch()) {
|
|||||||
}
|
}
|
||||||
header('ETag: \'' . $thash . '\'');
|
header('ETag: \'' . $thash . '\'');
|
||||||
header('Last-Modified: ' . gmdate('D, d M Y H:i:s', $tlast / 1000) . ' GMT');
|
header('Last-Modified: ' . gmdate('D, d M Y H:i:s', $tlast / 1000) . ' GMT');
|
||||||
|
if ($tnewimage) {
|
||||||
|
echo $tnewimage
|
||||||
|
} else {
|
||||||
echo $timage;
|
echo $timage;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
header('Location: ../images/blank.png');
|
header('Location: ../images/blank.png');
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user