From a47cadb9b9db37598eeb4fab7242dba01cc3b953 Mon Sep 17 00:00:00 2001 From: Cameron Date: Tue, 7 May 2013 18:32:38 -0700 Subject: [PATCH] Blurry avatar fix and usersettings template fix. Also added $tp->setThumbSize($w,$h,$crop); --- .../batch/usersettings_shortcodes.php | 18 ++++++++++++--- e107_core/templates/usersettings_template.php | 16 ++++++-------- e107_handlers/e_parse_class.php | 22 +++++++++++++++++++ e107_handlers/form_handler.php | 6 +++-- usersettings.php | 5 +++-- 5 files changed, 51 insertions(+), 16 deletions(-) diff --git a/e107_core/shortcodes/batch/usersettings_shortcodes.php b/e107_core/shortcodes/batch/usersettings_shortcodes.php index 949b4520f..446ce7d11 100755 --- a/e107_core/shortcodes/batch/usersettings_shortcodes.php +++ b/e107_core/shortcodes/batch/usersettings_shortcodes.php @@ -78,8 +78,9 @@ class usersettings_shortcodes extends e_shortcode function sc_realname($parm) - { - $options = array('title'=> '', 'size' => 40); + { + $pref = e107::getPref(); + $options = array('title'=> '', 'size' => 40,'required'=>$pref['signup_option_realname']); return e107::getForm()->text('realname',$this->var['user_login'], 100, $options); } @@ -198,9 +199,12 @@ class usersettings_shortcodes extends e_shortcode } - + /** + * @DEPRECATED - it is integreated with sc_signature now. + */ function sc_signature_help($parm) { + return; $pref = e107::getPref(); if(!check_class(varset($pref['signature_access'],0))) { @@ -398,5 +402,13 @@ class usersettings_shortcodes extends e_shortcode return $ret; } + + function sc_updatesettingsbutton($parm='') + { + + return ""; + + } + } ?> \ No newline at end of file diff --git a/e107_core/templates/usersettings_template.php b/e107_core/templates/usersettings_template.php index 0d6cb9c56..aba865845 100755 --- a/e107_core/templates/usersettings_template.php +++ b/e107_core/templates/usersettings_template.php @@ -80,15 +80,11 @@ $sc_style['LOGINNAME']['post'] = "\n"; $sc_style['SIGNATURE']['pre'] = "".LAN_USER_71.req($pref['signup_option_signature'])." "; -$sc_style['SIGNATURE']['post'] = "\n"; - - - //$sc_style['SIGNATURE']['pre'] = " // "; // $sc_style['SIGNATURE_HELP']['pre'] = ""; \ -// $sc_style['SIGNATURE_HELP']['post'] = ""; +$sc_style['SIGNATURE_HELP']['post'] = ""; $USER_EXTENDED_CAT = "{CATNAME}"; @@ -169,13 +165,15 @@ $USERSETTINGS_EDIT = " {USERCLASSES} {USEREXTENDED_ALL} + - {SIGNATURE} - - - + {SIGNATURE=cols=58&rows=4} + {SIGNATURE_HELP} +
+ {UPDATESETTINGSBUTTON} +
"; diff --git a/e107_handlers/e_parse_class.php b/e107_handlers/e_parse_class.php index 59cdcfb91..6859daa59 100644 --- a/e107_handlers/e_parse_class.php +++ b/e107_handlers/e_parse_class.php @@ -1834,6 +1834,28 @@ class e_parse extends e_parser return $text; } + + public function setThumbSize($w=null,$h=null,$crop=null) + { + if($w) + { + $this->thumbWidth = intval($w); + } + + if($h) + { + $this->thumbHeight = intval($h); + } + + if($crop) + { + $this->thumbCrop = intval($crop); + } + + } + + + /** * @param $url * @param $options ?? diff --git a/e107_handlers/form_handler.php b/e107_handlers/form_handler.php index f9c11d607..f2c7362c7 100644 --- a/e107_handlers/form_handler.php +++ b/e107_handlers/form_handler.php @@ -391,13 +391,15 @@ class e_form $pref = e107::getPref(); $attr = "aw=".$pref['im_width']."&ah=".$pref['im_height']; + $tp->setThumbSize($pref['im_width'],$pref['im_height']); + $blankImg = $tp->thumbUrl(e_IMAGE."generic/blank_avatar.jpg",$attr); $localonly = true; //TODO add a pref for allowing external or internal avatars or both. $idinput = $this->name2id($name); $previnput = $idinput."-preview"; $optioni = $idinput."-options"; - $img = (strpos($curVal,"://")!==false) ? $curVal : $tp->thumbUrl(e_AVATAR_DEFAULT.$curVal,"aw=".vartrue($width)."&ah=".vartrue($height),true); + $img = (strpos($curVal,"://")!==false) ? $curVal : $tp->thumbUrl(e_AVATAR_DEFAULT.$curVal); if(!$curVal) { @@ -433,7 +435,7 @@ class e_form foreach($avFiles as $fi) { - $img_path = $tp->thumbUrl(e_AVATAR_DEFAULT.$fi['fname'],$attr,true); + $img_path = $tp->thumbUrl(e_AVATAR_DEFAULT.$fi['fname']); $text .= "\n "; //TODO javascript CSS selector } diff --git a/usersettings.php b/usersettings.php index 4275eb8c7..a8d1182c9 100644 --- a/usersettings.php +++ b/usersettings.php @@ -772,9 +772,10 @@ if (e_QUERY == "update") $text .= "

".str_replace("*", "*", LAN_USET_9)."
".LAN_USET_10."

"; } - +// e107::scStyle($sc_style); e107::getScBatch('usersettings')->setVars($curVal); -$text .= $tp->parseTemplate($USERSETTINGS_EDIT, TRUE, $usersettings_shortcodes); + +$text .= $tp->parseTemplate($USERSETTINGS_EDIT, false, $usersettings_shortcodes); $text .= "