From 4ddcc77c775e42aab3bb0df3fa2942c6da345db9 Mon Sep 17 00:00:00 2001 From: Michael Date: Sat, 25 Nov 2017 10:07:49 +0000 Subject: [PATCH] Always show small preview pictures, not the big ones --- doc/htconfig.md | 1 + include/items.php | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/htconfig.md b/doc/htconfig.md index 9e0a2184df..3f5b28b917 100644 --- a/doc/htconfig.md +++ b/doc/htconfig.md @@ -23,6 +23,7 @@ Example: To set the directory value please add this line to your .htconfig.php: ## system ## * **allowed_link_protocols** (Array) - Allowed protocols in links URLs, add at your own risk. http is always allowed. +* **always_show_preview** (Boolean) - Only show small preview picures. Default value is false. * **birthday_input_format** - Default value is "ymd". * **block_local_dir** (Boolean) - Blocks the access to the directory of the local users. * **auth_cookie_lifetime** (Integer) - Number of days that should pass without any activity before a user who chose "Remember me" when logging in is considered logged out. Defaults to 7. diff --git a/include/items.php b/include/items.php index c2247277f1..cffa127288 100644 --- a/include/items.php +++ b/include/items.php @@ -207,7 +207,8 @@ function add_page_info_data($data) { $preview = str_replace(array("[", "]"), array("[", "]"), htmlentities($data["images"][0]["src"], ENT_QUOTES, 'UTF-8', false)); // if the preview picture is larger than 500 pixels then show it in a larger mode // But only, if the picture isn't higher than large (To prevent huge posts) - if (($data["images"][0]["width"] >= 500) && ($data["images"][0]["width"] >= $data["images"][0]["height"])) { + if (!Config::get('system', 'always_show_preview') && ($data["images"][0]["width"] >= 500) + && ($data["images"][0]["width"] >= $data["images"][0]["height"])) { $text .= " image='".$preview."'"; } else { $text .= " preview='".$preview."'"; -- 2.39.5