";
$text .= "
".$this->sc_username()."
";
diff --git a/e107_handlers/e_parse_class.php b/e107_handlers/e_parse_class.php
index 53ae91102..018665be3 100644
--- a/e107_handlers/e_parse_class.php
+++ b/e107_handlers/e_parse_class.php
@@ -748,7 +748,7 @@ class e_parse extends e_parser
$search = array('$', '"', '<', '>');
$replace = array('$', '"', '<', '>');
$text = str_replace($search, $replace, $text);
- if (e_WYSIWYG !== TRUE)
+ if (e107::wysiwyg() !== true)
{
// fix for utf-8 issue with html_entity_decode(); ???
$text = str_replace(" ", " ", $text);
@@ -2842,6 +2842,67 @@ class e_parser
+
+ /**
+ * Render an avatar based on supplied user data or current user when missing.
+ * @param @array - user data from e107_user.
+ * @return
![]()
tag of avatar.
+ */
+ public function toAvatar($userData=null)
+ {
+ $tp = e107::getParser();
+ $width = $tp->thumbWidth;
+ $height = ($tp->thumbHeight !== 0) ? $tp->thumbHeight : "";
+
+
+ if(!isset($userData['user_image']) && USERID)
+ {
+ $userData['user_image'] = USERIMAGE;
+ $userData['user_name'] = USERNAME;
+ }
+
+
+ $image = varset($userData['user_image']);
+
+ $genericImg = $tp->thumbUrl(e_IMAGE."generic/blank_avatar.jpg","w=".$width."&h=".$height,true);
+
+ if (!empty($image))
+ {
+
+ if(strpos($image,"://")!==false) // Remove Image
+ {
+ $img = $image;
+ }
+ elseif(substr($image,0,8) == "-upload-")
+ {
+
+ $image = substr($image,8); // strip the -upload- from the beginning.
+ $img = (file_exists(e_AVATAR_UPLOAD.$image)) ? $tp->thumbUrl(e_AVATAR_UPLOAD.$image,"w=".$width."&h=".$height) : $genericImg;
+ }
+ elseif(file_exists(e_AVATAR_DEFAULT.$image)) // User-Uplaoded Image
+ {
+ $img = $tp->thumbUrl(e_AVATAR_DEFAULT.$image,"w=".$width."&h=".$height);
+ }
+ else // Image Missing.
+ {
+
+ $img = $genericImg;
+ }
+ }
+ else // No image provided - so send generic.
+ {
+ $img = $genericImg;
+ }
+
+ $title = (ADMIN) ? $image : $tp->toAttribute($userData['user_name']);
+
+ $text = "

";
+ // return $img;
+ return $text;
+
+ }
+
+
/**
* Display an icon.
diff --git a/e107_plugins/chatbox_menu/chatbox_menu.php b/e107_plugins/chatbox_menu/chatbox_menu.php
index 524eb6a8a..d10f90a85 100644
--- a/e107_plugins/chatbox_menu/chatbox_menu.php
+++ b/e107_plugins/chatbox_menu/chatbox_menu.php
@@ -112,7 +112,7 @@ if(!class_exists('chatbox_shortcodes'))
function sc_cb_avatar($parm='')
{
- return e107::getParser()->parseTemplate("{USER_AVATAR=".vartrue($this->var['user_image'])."}");
+ return e107::getParser()->toAvatar($this->var); // parseTemplate("{USER_AVATAR=".vartrue($this->var['user_image'])."}");
}
function sc_cb_bullet($parm = '')
diff --git a/e107_plugins/online/online_menu.php b/e107_plugins/online/online_menu.php
index 2492225f4..c57020f0b 100644
--- a/e107_plugins/online/online_menu.php
+++ b/e107_plugins/online/online_menu.php
@@ -25,7 +25,11 @@ include_lan(e_PLUGIN.'online/languages/'.e_LANGUAGE.'.php');
require_once(e_PLUGIN.'online/online_shortcodes.php');
-if (is_readable(THEME.'online_menu_template.php'))
+if (is_readable(THEME.'templates/online/online_menu_template.php'))
+{
+ require(THEME.'templates/online/online_menu_template.php');
+}
+elseif (is_readable(THEME.'online_menu_template.php'))
{
require(THEME.'online_menu_template.php');
}
diff --git a/e107_plugins/online/online_menu_template.php b/e107_plugins/online/online_menu_template.php
index 3b14cc3b0..d444dbfdb 100644
--- a/e107_plugins/online/online_menu_template.php
+++ b/e107_plugins/online/online_menu_template.php
@@ -17,7 +17,7 @@
global $sc_style;
//##### LASTSEEN MENU ---------------------------------------------------------
-$LASTSEEN_TEMPLATE['start'] = "