From e0e8c0f0b38d84d749f0d0d3ff109ee5381a5fc3 Mon Sep 17 00:00:00 2001 From: Florin-Ciprian Bodin Date: Fri, 19 Jun 2020 20:56:35 +0300 Subject: [PATCH] Update FileItem.php --- classes/FileItem.php | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/classes/FileItem.php b/classes/FileItem.php index a52c970..56cfd52 100644 --- a/classes/FileItem.php +++ b/classes/FileItem.php @@ -82,13 +82,29 @@ class FileItem extends Item $this -> downloads = (DOWNLOAD_COUNT && $downloads -> is_set($parent_dir . $filename) ? (int)($downloads -> __get($parent_dir . $filename)) : 0); $this -> link = Url::html_output($_SERVER['PHP_SELF']) . '?dir=' . Url::translate_uri(substr($this -> parent_dir, strlen($config -> __get('base_dir')))) . '&file=' . Url::translate_uri($filename); - if (THUMBNAIL_HEIGHT && in_array(self::ext($filename), array('png', 'jpg', 'jpeg', 'gif', 'bmp'))) + + if (THUMBNAIL_HEIGHT && in_array(self::ext($filename), array('png', 'jpg', 'jpeg', 'jfif', 'gif', 'bmp'))) { $this -> thumb_link = ' ' . $words -> __get('thumbnail of') . ' ' . $filename
-			. ''; + . '?thumbnail='. Url::translate_uri($this -> parent_dir . $filename) . '"' + . ' alt="' . $words -> __get('thumbnail of') . ' ' . $filename . '"' + . ' />'; } + if (THUMBNAIL_HEIGHT && in_array(self::ext($filename), array('svg', 'xml'))) + { + $icon_svg = ICON_PATH ? Url::translate_uri($config -> __get('icon_path') . 'svg.png') : Url::translate_uri($this -> parent_dir . $filename); + $heightwidth = in_array(self::ext($filename), array('svg', 'xml')) ? ' height="' . '150' . '" width="' . '150' . '" ' : ' '; + $this -> thumb_link = ' ' . $words -> __get('thumbnail of') . ' ' . $filename . ''; + //. ' ' . $words -> __get('thumbnail of') . ' ' . $filename . ''; + } + $size = $this -> size -> __get('bytes'); if (MD5_SHOW && $size > 0 && $size / 1048576 <= $config -> __get('md5_show')) { @@ -115,4 +131,4 @@ class FileItem extends Item } } -?> \ No newline at end of file +?>