diff --git a/e107_core/shortcodes/batch/user_shortcodes.php b/e107_core/shortcodes/batch/user_shortcodes.php index d154dcfd0..a43d74dbb 100644 --- a/e107_core/shortcodes/batch/user_shortcodes.php +++ b/e107_core/shortcodes/batch/user_shortcodes.php @@ -421,7 +421,7 @@ class user_shortcodes extends e_shortcode if (USERID == $this->var['user_id']) { //return "".LAN_USER_38.""; - return "".LAN_USER_38.""; // TODO: repair dirty fix for usersettings + return "".LAN_USER_38.""; // TODO: repair dirty fix for usersettings } else if(ADMIN && getperms("4") && !$this->var['user_admin']) { @@ -469,6 +469,9 @@ class user_shortcodes extends e_shortcode function sc_user_picture($parm) { + $tp = e107::getParser(); + return $tp->parseTemplate("{USER_AVATAR=".$this->var['user_sess']."}",true); + if ($this->var['user_sess'] && file_exists(e_MEDIA."avatars/".$this->var['user_sess'])) { //return $tp->parseTemplate("{USER_AVATAR=".$this->var['user_image']."}", true); // this one will resize. diff --git a/e107_core/shortcodes/single/user_avatar.php b/e107_core/shortcodes/single/user_avatar.php index feeef3767..187dc837f 100644 --- a/e107_core/shortcodes/single/user_avatar.php +++ b/e107_core/shortcodes/single/user_avatar.php @@ -5,8 +5,8 @@ function user_avatar_shortcode($parm='') global $loop_uid; - $height = e107::getPref("im_height",100); - $width = e107::getPref("im_width",100); + //$height = e107::getPref("im_height",100); // these prefs are too limiting. + //$width = e107::getPref("im_width",100); $tp = e107::getParser(); if(intval($loop_uid) > 0 && trim($parm) == "") @@ -39,6 +39,8 @@ function user_avatar_shortcode($parm='') $image = ""; } + + $genericImg = $tp->thumbUrl(e_IMAGE."generic/blank_avatar.jpg","w=".$width."&h=".$height,true); if (vartrue($image)) { @@ -47,25 +49,35 @@ function user_avatar_shortcode($parm='') { $img = $image; } - elseif(file_exists(e_AVATAR_DEFAULT.$image)) // Local Default Image + elseif(substr($image,0,8) == "-upload-") { - $img = $tp->thumbUrl(e_AVATAR_DEFAULT.$image,"w=".$width."&h=".$height,true); + $image = substr($image,8); // strip the -upload- from the beginning. + if(file_exists(e_AVATAR_UPLOAD.$image)) // Local Default Image + { + $img = $tp->thumbUrl(e_AVATAR_UPLOAD.$image,"w=".$width."&h=".$height,true); + } + else + { + $img = $genericImg; + } } - elseif(file_exists(e_AVATAR_UPLOAD.$image)) // User-Uplaoded Image + elseif(file_exists(e_AVATAR_DEFAULT.$image)) // User-Uplaoded Image { - $img = $tp->thumbUrl(e_AVATAR_UPLOAD.$image,"w=".$width."&h=".$height,true); + $img = $tp->thumbUrl(e_AVATAR_DEFAULT.$image,"w=".$width."&h=".$height,true); } else // Image Missing. { - $img = $tp->thumbUrl(e_IMAGE."generic/blank_avatar.jpg","w=".$width."&h=".$height,true); + $img = $genericImg; } } else // No image provided - so send generic. { - $img = $tp->thumbUrl(e_IMAGE."generic/blank_avatar.jpg","w=".$width."&h=".$height,true); + $img = $genericImg; } - $text = ""; + $title = (ADMIN) ? $image : ""; + + $text = ""; // return $img; return $text; diff --git a/e107_core/templates/user_template.php b/e107_core/templates/user_template.php index f8e78d1d7..1b8455441 100644 --- a/e107_core/templates/user_template.php +++ b/e107_core/templates/user_template.php @@ -62,6 +62,7 @@ $USER_SHORT_TEMPLATE_START = " + {SETIMAGE: w=40} "; $USER_SHORT_TEMPLATE_END = " @@ -71,7 +72,7 @@ $USER_SHORT_TEMPLATE_END = " $USER_SHORT_TEMPLATE = " - {USER_ICON_LINK} + {USER_PICTURE} {USER_ID}: {USER_NAME_LINK} {USER_EMAIL} {USER_JOIN} @@ -95,6 +96,7 @@ $sc_style['USER_RATING']['post'] = ""; $sc_style['USER_LOGINNAME']['pre'] = " : "; +//FIXME TODO - Remove IF statements from template. if(isset($pref['photo_upload']) && $pref['photo_upload']) { $user_picture = "{USER_PICTURE}"; @@ -116,17 +118,21 @@ $span = 4; if ($tp->parseTemplate("{USER_SENDPM}", FALSE, $user_shortcodes)) $span++; $span = " rowspan='".$span."' "; -$sc_style['USER_PICTURE']['pre']=""; -$sc_style['USER_PICTURE']['post']=""; +//$sc_style['USER_PICTURE']['pre']=""; +//$sc_style['USER_PICTURE']['post']=""; -$USER_FULL_TEMPLATE = " + + + + +$USER_FULL_TEMPLATE = "{SETIMAGE: w=250}
- {$user_picture} +
".LAN_USER_58." {USER_ID} : {USER_NAME}{USER_LOGINNAME}
{USER_PICTURE}
{USER_REALNAME_ICON} ".LAN_USER_63."
{USER_REALNAME}