summaryrefslogtreecommitdiff
path: root/index.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2018-10-19 13:40:46 +0300
committerAndrew Dolgov <[email protected]>2018-10-19 13:40:46 +0300
commitfb7a24aca2e2b3719ea808b924c71594d84bbf4e (patch)
tree9ae0554bb1286c23e6ee1d6b1c9ba0573f41dcc6 /index.php
parentff872c4a89ca973cd9c7c83dc57c345cc3ee07e0 (diff)
index: add image timestamp to cover URL
Diffstat (limited to 'index.php')
-rw-r--r--index.php9
1 files changed, 8 insertions, 1 deletions
diff --git a/index.php b/index.php
index 22eac6c..c904d96 100644
--- a/index.php
+++ b/index.php
@@ -222,7 +222,14 @@
while ($line = $sth->fetch()) {
++$rows;
- $cover_link = "backend.php?" . http_build_query(["op" => "cover", "id" => $line["id"]]);
+ $cover_filename = BOOKS_DIR . "/" . $line["path"] . "/" . "cover.jpg";
+
+ if (file_exists($cover_filename))
+ $cover_mtime = filemtime($cover_filename);
+ else
+ $cover_mtime = 0;
+
+ $cover_link = "backend.php?" . http_build_query(["op" => "cover", "id" => $line["id"], "ts" => $cover_mtime]);
$author_link = "?" . http_build_query(["query" => $line["author_sort"]]);
$in_progress = false;