From 287260ee032719cc1172e4a8acae894938263427 Mon Sep 17 00:00:00 2001 From: Cameron Date: Tue, 12 Nov 2013 14:37:43 -0800 Subject: [PATCH] Check the featurebox {SETIMAGE} value before using resize method. --- e107_plugins/featurebox/includes/item.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/e107_plugins/featurebox/includes/item.php b/e107_plugins/featurebox/includes/item.php index c9804b3a2..bfbb73757 100644 --- a/e107_plugins/featurebox/includes/item.php +++ b/e107_plugins/featurebox/includes/item.php @@ -126,10 +126,15 @@ class plugin_featurebox_item extends e_model } parse_str($parm, $parm); $tp = e107::getParser(); - - // $src = $tp->replaceConstants($this->get('fb_image'), 'full'); - // Use {SETIMAGE} inside theme.php to configure. - $src = $tp->thumbUrl($this->get('fb_image')); //XXX TODO TBD Add a pref to use without resizing? Or, detect {SETIMAGE} in template to enable? + + if($tp->thumbWidth > 600 && $tp->thumbHeight > 300) //Guessing it's a featurebox image. Use {SETIMAGE} inside theme.php to configure. + { + $src = $tp->thumbUrl($this->get('fb_image')); //XXX TODO TBD Add a pref to use without resizing? Or, detect {SETIMAGE} in template to enable? + } + else + { + $src = $tp->replaceConstants($this->get('fb_image'), 'full'); + } if(isset($parm['src'])) {