From 3fc02a3a12cf7b16ddc4987c1b2ebf3c5226e2c8 Mon Sep 17 00:00:00 2001 From: Stefan Brand Date: Fri, 11 Feb 2022 17:19:03 +0100 Subject: [PATCH] Change Thumb URL Creation --- index.php | 2 +- lib/thumbs.class.php | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/index.php b/index.php index 21b5835..1303259 100644 --- a/index.php +++ b/index.php @@ -30,7 +30,7 @@ $sort = $_GET['so'] ?? 1; session_start(); // Initialize Thumbnail Handler -$t = new Thumb(Helpers::end_dir($imagedir.$dir), $thumbdir, 200, 200); +$t = new Thumb(Helpers::end_dir($imagedir.$dir), $thumbdir, $thumburl, 200, 200); // Filelist Cache Handling $cdir = $dir; diff --git a/lib/thumbs.class.php b/lib/thumbs.class.php index 0245c40..7b2a16b 100644 --- a/lib/thumbs.class.php +++ b/lib/thumbs.class.php @@ -3,6 +3,7 @@ class thumb { protected string $imagedir; protected string $thumbdir; + protected string $thumburl; protected int $w = 200; protected int $h = 200; @@ -29,9 +30,10 @@ class thumb { ] ]; - public function __construct($idir, $tdir, $width, $heigth) { + public function __construct($idir, $tdir, $turl, $width, $heigth) { $this->imagedir = $idir; $this->thumbdir = $tdir; + $this->thumburl = $turl; $this->w = $width; $this->h = $heigth; } @@ -79,7 +81,7 @@ class thumb { imagedestroy($image); imagedestroy($thumbnail); } - return $dstname.'.'.$ext; + return $this->thumburl.$dstname.'.'.$ext; } }