From fe60590d192cebfdcd3f8e9cf0c687aea881577e Mon Sep 17 00:00:00 2001 From: kaf Date: Sat, 27 Sep 2014 16:21:54 +0000 Subject: Check spoiler_image size before ussuming it is 128×128px MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- inc/mod/pages.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'inc') diff --git a/inc/mod/pages.php b/inc/mod/pages.php index c21086ed..36dec7bb 100644 --- a/inc/mod/pages.php +++ b/inc/mod/pages.php @@ -1567,10 +1567,12 @@ function mod_spoiler_image($board, $post, $file) { $result = $query->fetch(PDO::FETCH_ASSOC); $files = json_decode($result['files']); + + $size_spoiler_image = @getimagesize($config['spoiler_image']); file_unlink($board . '/' . $config['dir']['thumb'] . $files[$file]->thumb); $files[$file]->thumb = 'spoiler'; - $files[$file]->thumbheight = 128; - $files[$file]->thumbwidth = 128; + $files[$file]->thumbwidth = $size_spoiler[0]; + $files[$file]->thumbheight = $size_spoiler_image[1]; // Make thumbnail spoiler $query = prepare(sprintf("UPDATE ``posts_%s`` SET `files` = :files WHERE `id` = :id", $board)); -- cgit v1.3 From 296e4fd5fa2510623a9680df4fa37ddf0bd6485a Mon Sep 17 00:00:00 2001 From: kaf Date: Wed, 1 Oct 2014 10:40:51 +0000 Subject: Added an option to hide sages --- inc/config.php | 3 +++ templates/post/name.html | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'inc') diff --git a/inc/config.php b/inc/config.php index e2cc2ebd..93fc7687 100644 --- a/inc/config.php +++ b/inc/config.php @@ -529,6 +529,9 @@ // When true, users are instead presented a selectbox for email. Contains, blank, noko and sage. $config['field_email_selectbox'] = false; + // When true, the sage won't be displayed + $config['hide_sage'] = false; + // Attach country flags to posts. $config['country_flags'] = false; diff --git a/templates/post/name.html b/templates/post/name.html index 009b234d..13c676c7 100644 --- a/templates/post/name.html +++ b/templates/post/name.html @@ -1,5 +1,5 @@ {% set capcode = post.capcode|capcode %} -{% if post.email|length > 0 %} +{% if post.email|length > 0 and (config.hide_sage!=true or post.email!='sage') %} {# start email #} already exists!'); $config['error']['fileexistsinthread'] = _('That file already exists in this thread!'); $config['error']['delete_too_soon'] = _('You\'ll have to wait another %s before deleting that.'); -- cgit v1.3