From 36cabf1330881b1083fe96e632b5d30a57b602ca Mon Sep 17 00:00:00 2001 From: Cameron Date: Thu, 24 Mar 2016 17:44:03 -0700 Subject: [PATCH] Forum: "Maximum width of uploaded image" setting is now respected. When set to 0 the size is determined by the forum/theme template. --- e107_plugins/forum/languages/English/English_admin.php | 2 +- e107_plugins/forum/shortcodes/batch/view_shortcodes.php | 9 +++++++++ .../forum/templates/forum_viewtopic_template.php | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/e107_plugins/forum/languages/English/English_admin.php b/e107_plugins/forum/languages/English/English_admin.php index 51b48942c..c84146a51 100644 --- a/e107_plugins/forum/languages/English/English_admin.php +++ b/e107_plugins/forum/languages/English/English_admin.php @@ -153,7 +153,7 @@ define("FORLAN_131", "to set max file size, allowed types etc"); define("FORLAN_132", "Emphasize Sticky Threads"); define("FORLAN_133", "Give extra emphasis to sticky threads (separate thread sections and headers)"); define("FORLAN_134", "Maximum width of uploaded image"); -define("FORLAN_135", "Leave blank to disable auto resizing of images"); +define("FORLAN_135", "Leave blank to let the theme template decide."); define("FORLAN_136", "Create link to full size image"); define("FORLAN_137", "Enabling this will resize larger images and also create a link to the original full size image. If disabled, original image will be discarded"); define("FORLAN_138", "Prune these forums"); diff --git a/e107_plugins/forum/shortcodes/batch/view_shortcodes.php b/e107_plugins/forum/shortcodes/batch/view_shortcodes.php index 9add821a2..4bb14f364 100644 --- a/e107_plugins/forum/shortcodes/batch/view_shortcodes.php +++ b/e107_plugins/forum/shortcodes/batch/view_shortcodes.php @@ -11,12 +11,15 @@ if (!defined('e107_INIT')) { exit; } class plugin_forum_view_shortcodes extends e_shortcode { protected $e107; + protected $defaultImgAttachSize = false; function __construct() { parent::__construct(); $this->e107 = e107::getInstance(); $this->forum = new e107forum(); + + $this->defaultImgAttachSize = e107::pref('forum','maxwidth',false); // don't resize here if set to 0. } function sc_top($parm='') @@ -105,6 +108,12 @@ class plugin_forum_view_shortcodes extends e_shortcode $txt = ''; $attachArray = e107::unserialize($this->postInfo['post_attachments']); + + + if(!empty($this->defaultImgAttachSize)) + { + $tp->thumbWidth($this->defaultImgAttachSize); // set the attachment size. + } //print_a($attachArray); foreach($attachArray as $type=>$vals) diff --git a/e107_plugins/forum/templates/forum_viewtopic_template.php b/e107_plugins/forum/templates/forum_viewtopic_template.php index e2454ff71..2b5be011a 100644 --- a/e107_plugins/forum/templates/forum_viewtopic_template.php +++ b/e107_plugins/forum/templates/forum_viewtopic_template.php @@ -331,7 +331,7 @@ $FORUM_VIEWTOPIC_TEMPLATE['thread'] = "